I would like to discuss RStan compiling issue. My code was working before last night. However, when I tried to compile with parallel computing by introducing the command – options(mc.cores = parallel::detectCores()), I found the sampling iteration will stay at the 1/5000 (warm-up) stage. I left my computer on to run the RStan code last night and eventually found out R session quit.
When I tried to run the Stan code again, I start to receive the error message:
stanmodel <- stan_model(file='model.stan') Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! In file included from C:/Users/Qiangsuper/Documents/R/win-library/3.5/BH/include/boost/config.hpp:39:0, from C:/Users/Qiangsuper/Documents/R/win-library/3.5/BH/include/boost/math/tools/config.hpp:13, from C:/Users/Qiangsuper/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/core/var.hpp:7, from C:/Users/Qiangsuper/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5, from C:/Users/Qiangsuper/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/core.hpp:12, from C:/Users/Qiangsuper/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/mat.hpp:4, from C:/Users/Qiangsuper/Documents/R/win-library/3.5/StanHeaders/include/stan/math.hpp:4, from C:/Users/Qiangsuper/Documents/R/win-library/3.5/StanHeaders/include/src/stan/model/model_header.hpp:4, In addition: Warning messages: 1: In readLines(file, warn = TRUE) : incomplete final line found on 'C:\Users\Qiangsuper\Dropbox\Spatial Tweedie\CAR code\Complex simulation data - Copy\model.stan' 2: In stan_model(file = "model.stan") : StanHeaders version is ahead of rstan version; update to latest rstan 3: In system(cmd, intern = !verbose) : running command 'C:/PROGRA~1/R/R-35~1.1/bin/x64/R CMD SHLIB file12244e5665c9.cpp 2> file12244e5665c9.cpp.err.txt' had status 1
In order to solve this problem by myself, I reinstalled RStan and RTool. But nothing changes. So I have to come to ask for help.
The session information is as following:
> sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200) Matrix products: default locale:  LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252  LC_MONETARY=English_United States.1252  LC_NUMERIC=C  LC_TIME=English_United States.1252 attached base packages:  stats graphics grDevices utils  datasets methods base other attached packages:  rstan_2.17.4 StanHeaders_2.18.0  ggplot2_3.0.0 dplyr_0.7.6  data.table_1.11.8 tweedie_2.3.2  Matrix_1.2-14 MASS_7.3-50 loaded via a namespace (and not attached):  Rcpp_0.12.19 rstudioapi_0.8  bindr_0.1.1 magrittr_1.5  munsell_0.5.0 tidyselect_0.2.4  colorspace_1.3-2 lattice_0.20-35  R6_2.3.0 rlang_0.2.2  plyr_1.8.4 tools_3.5.1  grid_3.5.1 gtable_0.2.0  withr_2.1.2 lazyeval_0.2.1  yaml_2.2.0 assertthat_0.2.0  tibble_1.4.2 crayon_1.3.4  bindrcpp_0.2.2 gridExtra_2.3  purrr_0.2.5 inline_0.3.15  glue_1.3.0 compiler_3.5.1  pillar_1.3.0 scales_1.0.0  stats4_3.5.1 pkgconfig_2.0.2
Thank you very much for your help.