I attempted to install rstan 2.19.2 on 64 bit Windows 10 from CRAN - the install fails (details below). I don’t see a 2.19.2 version of StanHeaders on CRAN - is this the cause?
install.packages(“rstan”, repos = “https://cloud.r-project.org/”, dependencies = TRUE)
There is a binary version available but the source version is later:
binary source needs_compilation
rstan 2.18.2 2.19.2 TRUE
The install fails as below:
… In file included from C:/Program Files/R/R-3.6.1/library/StanHeaders/include/src/stan/lang/generator/generate_function_instantiation.hpp:6:0,
from C:/Program Files/R/R-3.6.1/library/StanHeaders/include/src/stan/lang/generator/generate_function_instantiations.hpp:5,
from C:/Program Files/R/R-3.6.1/library/StanHeaders/include/src/stan/lang/generator/generate_standalone_functions.hpp:7,
from C:/Program Files/R/R-3.6.1/library/StanHeaders/include/src/stan/lang/compile_functions.hpp:4,
from stanc.cpp:23:
C:/Program Files/R/R-3.6.1/library/StanHeaders/include/src/stan/lang/generator/generate_function_instantiation_body.hpp: In function ‘void stan::lang::generate_function_instantiation_body(const stan::lang::function_decl_def&, const std::vector<std::basic_string >&, bool, bool, bool, const string&, std::ostream&)’:
C:/Program Files/R/R-3.6.1/library/StanHeaders/include/src/stan/lang/generator/generate_function_instantiation_body.hpp:44:45: error: range-based ‘for’ loops are not allowed in C++98 mode
for (const std::string& namespace_i : namespaces) {
^
make: *** [C:/PROGRA~1/R/R-3.6.1/etc/x64/Makeconf:215: stanc.o] Error 1
ERROR: compilation failed for package ‘rstan’
- removing ‘C:/Program Files/R/R-3.6.1/library/rstan’
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
Operating System: Windows 10
Interface Version: rstan
Compiler/Toolkit: Rtools version 3.5.0.4