The problem is as follows: I’m trying to reproduce the results of Aplin, Sheldon & McElreath (2017) by using “wythamewa” package, i.e., fitting a stan model via “ewa_fit” function to the data (all provided within the package).
While the model starts precompiling, the model fitting eventually fails at the compilation stage, producing the following messages and warnings:
Error in compileCode(f, code, language = language, verbose = verbose) :
from file166c284c27c5.cpp:14:C:/Users/User/Documents/R/win-library/4.0/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp:
At global scope:C:/Users/User/Documents/R/win-library/4.0/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp:14:13:
warning: 'void stan::math::set_zero_all_adjoints()' defined but not used [-Wunused-function] static void set_zero_all_adjoints()
{ ^~~~~~~~~~~~~~~~~~~~~make: *** [C:/PROGRA~1/R/R-40~1.2/etc/x64/Makeconf:229: file166c284c27c5.o] Error 1
In addition: Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
'C:/rtools40/usr/mingw_/bin/g++' not found
Error in sink(type = "output") : invalid connection
My sessionInfo():
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
system code page: 1251
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] wythamewa_1.03 rethinking_2.13 rstan_2.21.2 ggplot2_3.3.2 StanHeaders_2.21.0-6
[6] RcppArmadillo_0.9.900.3.0 Rcpp_1.0.5 inline_0.3.16
loaded via a namespace (and not attached):
[1] pillar_1.4.6 compiler_4.0.2 prettyunits_1.1.1 tools_4.0.2 pkgbuild_1.1.0 lattice_0.20-41 jsonlite_1.7.1
[8] lifecycle_0.2.0 tibble_3.0.3 gtable_0.3.0 pkgconfig_2.0.3 rlang_0.4.7 cli_2.0.2 rstudioapi_0.11
[15] curl_4.3 mvtnorm_1.1-1 loo_2.3.1 coda_0.19-3 gridExtra_2.3 withr_2.3.0 dplyr_1.0.2
[22] generics_0.0.2 vctrs_0.3.4 stats4_4.0.2 grid_4.0.2 tidyselect_1.1.0 glue_1.4.2 R6_2.4.1
[29] processx_3.4.4 fansi_0.4.1 purrr_0.3.4 callr_3.4.4 magrittr_1.5 MASS_7.3-51.6 codetools_0.2-16
[36] matrixStats_0.56.0 scales_1.1.1 ps_1.3.4 ellipsis_0.3.1 assertthat_0.2.1 shape_1.4.5 colorspace_1.4-1
[43] V8_3.2.0 RcppParallel_5.0.2 munsell_0.5.0 crayon_1.3.4
I have browsed through several discussions that seemed relevant to me as a novice to Stan (e.g., “Error in compileCode” kind), yet none of the proposed solutions (e.g., clean installation into default locations without spaces in names) solved the problem thus far .
Any help will be greatly appreciated & thanks for reading!