Cpmpilation Error

Hey,

I’ve installed Rstan Package (2.21.1) on R 3.62 but eventually failed to run the eight schools example model. I’ve noticed I’m not the first one to deal with this compilation issue but readings plenty of previous threads didn’t help me to fix this issue…

The Error Message is the following :

*Error in compileCode(f, code, language = language, verbose = verbose) : *

  • Compilation ERROR, function(s)/method(s) not created! g++.exe: error: Ka/Documents/R/win-library/3.6/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp: No such file or directory*
    make: *** [C:/PROGRA~1/R/R-36~1.2/etc/x64/Makeconf:215: file32c4628b4b59.o] Error 1
    De plus : Warning messages:
    1: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
  • ‘-E’ not found*
    2: In system(cmd, intern = !verbose) :
  • l’exécution de la commande ‘C:/PROGRA~1/R/R-36~1.2/bin/x64/R CMD SHLIB file32c4628b4b59.cpp 2> file32c4628b4b59.cpp.err.txt’ renvoie un statut 1*
    Error in sink(type = “output”) : connexion incorrecte

FYI, I have the following path for StanHeaders

>system.file(“include”, “src”, “stan”, “model”, “model_header.hpp”, package = “StanHeaders”)
[1] “C:/Users/Paule Ka/Documents/R/win-library/3.6/StanHeaders/include/src/stan/model/model_header.hpp”

Thank you!

Hi,

see Workarounds for current Rstan Windows issues

You need to move your R library to a location without spaces.