【问题标题】:bsts package installation errorbsts包安装错误
【发布时间】:2016-09-11 14:50:32
【问题描述】:

尝试在 R 中安装 bsts 包时收到以下错误:

bsts.cc:71:5: error: 'clock_t' was not declared in this scope
     clock_t start_time = clock();
     ^
bsts.cc:72:29: error: 'CLOCKS_PER_SEC' was not declared in this scope
     double time_threshold = CLOCKS_PER_SEC * timeout_threshold_seconds;
                             ^
bsts.cc:82:17: error: expected ';' before 'current_time'
         clock_t current_time = clock();
                 ^
bsts.cc:83:13: error: 'current_time' was not declared in this scope
         if (current_time - start_time > time_threshold) {
             ^
bsts.cc:83:28: error: 'start_time' was not declared in this scope
         if (current_time - start_time > time_threshold) {
                            ^
make: *** [bsts.o] Error 1
Warning: running command 'make -f "Makevars" -f "C:/PROGRA~1/R/R-33~1.0/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.0/share/make/winshlib.mk" CXX='$(CXX1X) $(CXX1XSTD)' CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)' SHLIB="bsts.dll" OBJECTS="aggregate_time_series.o bsts.o mixed_frequency.o model_manager.o state_space_gaussian_model_manager.o state_space_logit_model_manager.o state_space_poisson_model_manager.o state_space_regression_model_manager.o state_space_student_model_manager.o utils.o"' had status 2
ERROR: compilation failed for package 'bsts'

我尝试了以下方法:

  1. devtools::install_github('cran/bsts')

  2. 直接来自 R Studio,这将下载 .tar 文件,我在尝试安装时收到相同的错误。

install error of bsts package in R 有类似的问题,但 BOOMBoomSpikeSlab 已为我正确安装。如果需要,我可以从错误中提供更多详细信息。如何安装该软件包?

我的会话信息:

> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
[1] LC_COLLATE=Finnish_Finland.1252  LC_CTYPE=Finnish_Finland.1252    LC_MONETARY=Finnish_Finland.1252 LC_NUMERIC=C                    
[5] LC_TIME=Finnish_Finland.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] devtools_1.11.1

loaded via a namespace (and not attached):
[1] httr_1.1.0    R6_2.1.2      tools_3.3.0   withr_1.0.1   curl_0.9.7    memoise_1.0.0 git2r_0.15.0  digest_0.6.9 

【问题讨论】:

  • 好的,谢谢。我会写信给包维护者。
  • 我尝试在 Mac 和 windows 上使用 Rstudio 安装它,它在 mac 上运行良好,但在 windows 上它无法运行,因为我的 R 不是正确的版本。
  • 不知道为什么这个问题被否决了......这是一个明确的问题,提供了必要的信息。

标签: r package failed-installation


【解决方案1】:

作为一种解决方法,您可以在 Windows 上安装以前的版本 (0.6.2.):

install.packages("https://cran.r-project.org/bin/windows/contrib/3.2/bsts_0.6.2.zip", 
                  repos = NULL, type = "local")

【讨论】:

    【解决方案2】:

    这实际上与this question 是相同的问题——本质上,它是“操作员错误”,因为该软件包没有附带来自 CRAN 的 Windows 二进制文件,这通常是一个 非常强烈的迹象表明它不是在 Windows 上构建的。

    CRAN 并没有出于恶意而不在 Windows 上构建的习惯——由 Uwe Ligges 运营的多特蒙德站点通常构建一切可以合理构建的东西。我怀疑存在潜在的技术问题。

    【讨论】:

    • 你是对的,这看起来和我的问题一样。将不得不等待维护人员修复它。谢谢。
    • 我在安装了最新的 R 和 R Studio 以及 Rtools (v33) 的 Win 10(64 位)上遇到了同样的问题。奇怪的是,我确实设法将它安装在另一台 Win 10 计算机(相同的 R 版本)上,所以我不确定在这种情况下出了什么问题。
    • 事实证明,在另一台计算机上(参见上面的评论)版本为 0.6.2。已安装(bsts),效果很好。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-28
    • 2017-05-24
    • 2021-05-23
    • 2018-06-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多