I had been happily using Rstan on several Windows 10 machines with R 3.5.3. However, after updating each to R 3.6.0, I have been unable to compile the C++ code for Stan. The error messages suggest that there are problems finding the C++14 standard.
To troubleshoot, I uninstalled R and Rtools and then reinstalled R 3.6.0 and Rtools 3.5 in the default locations. I then followed the instructions on https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started and got the following error when I ran the
Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! Error in .shlib_internal(commandArgs(TRUE)) : C++14 standard requested but CXX14 is not defined Calls: <Anonymous> -> .shlib_internal Execution halted In addition: Warning message: In system(cmd, intern = !verbose) : running command 'C:/PROGRA~1/R/R-3.6.0/bin/x64/R CMD SHLIB file31c4b6d5db0.cpp 2> file31c4b6d5db0.cpp.err.txt' had status 1 Error in sink(type = "output") : invalid connection
My Makevars.win file includes the following:
CXX14FLAGS=-O3 -march=native -mtune=native CXX11FLAGS=-O3 -march=native -mtune=native
I assume that it is looking for a definition for
CXX14 but that is not there by default. So even though Rtools is installed, R does not seem to finding g++ correctly.
This is all a bit over my head, so any advice would be really appreciated.