Hi, I just tried for a few hours to install rstan on a new computer (Win10, 64bit). On my old machine everthing worked fine, but now I can’t get the 8school example running.
I get (as obviously quite a lot of people before me) the following error message:
fit ← stan(file = ‘8schools.stan’, data = schools_dat)
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from C:/R/R-3.5.2/library/BH/include/boost/random/detail/integer_log2.hpp:19:0,
from C:/R/R-3.5.2/library/BH/include/boost/random/detail/int_float_pair.hpp:26,
from C:/R/R-3.5.2/library/BH/include/boost/random/exponential_distribution.hpp:27,
from C:/R/R-3.5.2/library/BH/include/boost/random/gamma_distribution.hpp:25,
from C:/R/R-3.5.2/library/StanHeaders/include/stan/math/prim/mat/prob/dirichlet_rng.hpp:5,
from C:/R/R-3.5.2/library/StanHeaders/include/stan/math/prim/mat.hpp:276,
from C:/R/R-3.5.2/library/StanHeaders/include/stan/math/rev/mat.hpp:12,
from C:/R/R-3.5.2/library/StanHeaders/include/stan/math.hpp:4,
from C:/R/R-3.5.2/library/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file1f081362874.cpp:8:
C:/R/R-3.5.2/library/BH/include/boost
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘C:/R/R-35~1.2/bin/x64/R CMD SHLIB file1f081362874.cpp 2> file1f081362874.cpp.err.txt’ had status 1
Error in sink(type = “output”) : invalid connection
However I tried all suggested solutions I found (e.g. avoiding folder-names containing spaces, updating BH, …) and still cannot solve this. Any suggestion is highly welcome!
I got the exactly same problem as Andeas reported above.
I tried sm <- stan_model('8schools.stan', verbose = TRUE)
and the error is:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from C:/Users/Administrator/Documents/R/win-library/3.5/BH/include/boost/random/detail/integer_log2.hpp:19:0,
from C:/Users/Administrator/Documents/R/win-library/3.5/BH/include/boost/random/detail/int_float_pair.hpp:26,
from C:/Users/Administrator/Documents/R/win-library/3.5/BH/include/boost/random/exponential_distribution.hpp:27,
from C:/Users/Administrator/Documents/R/win-library/3.5/BH/include/boost/random/gamma_distribution.hpp:25,
from C:/Users/Administrator/Documents/R/win-library/3.5/StanHeaders/include/stan/math/prim/mat/prob/dirichlet_rng.hpp:5,
from C:/Users/Administrator/Documents/R/win-library/3.5/StanHeaders/include/stan/math/prim/mat.hpp:276,
from C:/Users/Administrator/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/mat.hpp:12,
from C:/Users/Administrator/Docum
Ok, as far as I understand the comments of other people having this issue, the C-compiler does not work for some processors with some optimization flags in the 64 bit version.
So, a work-around would be to change the compiler flags for optimization, or to go for 32 bit version. Is either possible in rstan?
Probably not. RTools 3.5 works more reliably than 3.4, etc. You might try adding -fno-asynchronous-unwind-tables to the CXX11FLAGS or any of the other things when you google for “Error: invalid register for .seh_savexmm”.