Installation issue: C++14 and Makevars


#1

I recently got a new computer in my office, running Windows 10 x64. I initially got had Rstan up and running on this computer, but now (about a month later) I am encountering some issues I have not been able to fix.

Having de-installed and re-installed R (3.5.1) and Rools (3.5), I have no Makevars-file, and I get Rcpp to run fine:

library(Rcpp)
evalCpp(“1+1”)
[1] 2

However, if I try to install Rstan (2.18.2), I get the message:

Error in .shlib_internal(args) :
C++14 standard requested but CXX14 is not defined

In this post, I read that a solution might be to create a Makevars.win variable, following the instructions here. However, this gives a new error:

evalCpp(“1+1”)
make: \kant\sv-arena-u1\jorgebo\pc\Dokumenter/.R/Makevars.win: No such file or directory
make: *** No rule to make target ‘\kant\sv-arena-u1\jorgebo\pc\Dokumenter/.R/Makevars.win’. Stop.
Error in sourceCpp(code = code, env = env, rebuild = rebuild, cacheDir = cacheDir, :
Error 1 occurred building shared library.

If I remove the Makevars-file, Rcpp starts working again, but the original error appears when trying to install Rstan. Is there some change I can make to the Makevars-file to make this work? I see that R (or make?) adds forward slashes instead of backward slashes to the file-paths reported in the last error-message, but I don’t know if this is the source of the problem?

Any help would be greatly appreciated!


#2

You can delete ~/.R/Makevars and ~/.R/Makevars.win for now. Do

install.packages("https://win-builder.r-project.org/tJ1528Lvo0H3/rstan_2.18.2.zip", 
                           repos = NULL)

to install the rstan binary, and then it should work.


#3

Great, thank you for the quick response!