I have used Rstan on Rstudio with my Windows 10 after a week. After some update of packages, i tried to run my previous model (that didn’t have any problem) and now it gives me a problem in the compilation Error. I tried everything, also uninstalling everything of R, Rstudio, but it was useless
Current Output: That’s the error it returns
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! g++.exe: error: base/Documents/R/win-library/3.6/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp: No such file or directory
g++.exe: error: base/Documents/R/win-library/3.6/StanHeaders/include: No such file or directory
g++.exe: error: base/Documents/R/win-library/3.6/RcppEigen/include: No such file or directory
make: *** [C:/PROGRA1/R/R-361.2/etc/x64/Makeconf:215: file480c619142e6.o] Error 1
Expected Output:
It hadn’t had any error before, everything was fine.
Hi - I have the same error. I can find the file that it is looking for in “C:\Program Files\R\R-3.6.0\library\StanHeaders\include\stan\math\prim\mat\fun”. I also have a space in “Program Files”. Unfortunately, I can’t rename the location or change to location of the R folder due to company rules.
I tried reinstalling StanHeaders and it did not help. Any suggestions?
Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! g++.exe: error: Files/R/R-3.6.0/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp: No such file or directory g++.exe: error: Files/R/R-3.6.0/library/StanHeaders/include: No such file or directory g++.exe: error: Files/R/R-3.6.0/library/RcppEigen/include: No such file or directory make: *** [C:/PROGRA~1/R/R-36~1.0/etc/x64/Makeconf:215: file18b8644e4c53.o] Error 1 In addition: Warning message: In system(cmd, intern = !verbose) : running command ‘C:/PROGRA~1/R/R-36~1.0/bin/x64/R CMD SHLIB file18b8644e4c53.cpp 2> file18b8644e4c53.cpp.err.txt’ had status 1 Error in sink(type = “output”) : invalid connection
I am having this same problem, where the directory path has a space in it.
I tried running
install.packages(c(“rstan”,“StanHeaders”),type=“source”)
as recommended, but am getting an error:
C++14 standard requested but CXX14 is not defined
I ran the code on the RStan Getting Started: Configuration of the C++ Toolchain and have a Makevars.win file in Documents/.R
However, when I run:
Sys.getenv(“R_MAKEVARS_USER”)
it returns an empty string.
How do I tell R where to look for the Makevars.win file?
without having to mess with the Makevars.win file (which is at ~/.R/Makevars.win). However, in the future if you needed to modify that, there are instructions at
Now I can install the package, but when I try to load the library I get this error:
Loading required package: StanHeaders
Loading required package: ggplot2
Error: package or namespace load failed for ‘rstan’ in inDL(x, as.logical(local), as.logical(now), …):
unable to load shared object ‘C:/Users/Kiva Oken/Documents/R/win-library/3.6/rstan/libs/x64/rstan.dll’:
LoadLibrary failure: The specified procedure could not be found.
Unfortunately I still get the same error. There is also a popup box that reads:
The procedure entry point CAR0 could not be located in the dynamic link library C:/Users/Kiva Oken/Documents/R/win-library/3.6/rstan/libs/x64/rstan.dll
(This seems like the same error I get in the RStudio console.)