2016-05-15 121 views
1

我receving以下錯誤嘗試R中安裝bsts包時: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是否正確安裝我。如果需要,我可以提供更多來自錯誤的細節。我怎樣才能安裝這個軟件包?

我session.info:

> 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 
+0

好的,謝謝。我會寫信給包維護者。 – Viitama

+0

我試圖在Mac和Windows上使用Rstudio安裝它,它在Mac上運行正常,但在Windows上它不會工作,因爲我的R不是正確的版本。 – JKJ

+0

不知道爲什麼這個問題被降低了......這是一個明確的問題,提供了必要的信息。 – sparrow

回答

0

這實際上是同一個問題的this question - 在本質上,它是「操作錯誤」,因爲包不附帶由CRAN一個Windows二進制文件,通常是非常強表示它不是在Windows上構建的。

CRAN是不是在Windows上無法擴建儘管習慣---由烏韋Ligges操作多特蒙德網站通常建立一切可以合理構建。我懷疑潛在的技術問題。

+0

你是對的,看起來像我一樣的問題。將不得不等待維護人員修復它。謝謝。 – Viitama

+0

我在安裝Win 10(64位),最新的R和R Studio以及Rtools(v33)時遇到了同樣的問題。奇怪的是,我確實設法將它安裝在另一臺Win 10計算機(相同的R版本)上,所以我不確定在這種情況下有什麼問題。 – sparrow

+0

事實證明,在另一臺計算機上(見上面的評論)版本0.6.2。被安裝(bsts),這工作正常。 – sparrow

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")