I recently updated R 3.6.3 to R 4.0.3. I updated all packages including rstan. When I tried to fit a model with stan() function, error messages appear. R tools 4.0 was also automatically updated.
You can see the error message, below.
Error in compileCode(f, code, language = language, verbose = verbose) : sh: c:/rtools40/mingw64/bin/g++: No such file or directorymake: *** [C:/PROGRA~1/R/R-40~1.3/etc/x64/Makeconf:229: file131481e681912.o] Error 127 In addition: Warning message: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) : '-E' not found Error in sink(type = "output") : invalid connection
My session info is below.
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
Hi @andrjohns,
I have a quick question.
Should Sys.which("make") give me "C:\\rtools40\\usr\\bin\\make.exe as an output? Since it gives me an empty "" output.
library(rstan)
Error in library(rstan) : there is no package called ‘rstan’
example(stan_model,run.dontrun=T)
Warning message:
In example(stan_model, run.dontrun = T) : no help found for ‘stan_model’
It took quite a long time to download rstan. When tried your code, the results are:
library(rstan)
Loading required package: StanHeaders
Loading required package: ggplot2
rstan (Version 2.21.2, GitRev: 2e1f913d3ca3)
For execution on a local, multicore CPU with excess RAM we recommend calling
options(mc.cores = parallel::detectCores()).
To avoid recompilation of unchanged Stan programs, we recommend calling
rstan_options(auto_write = TRUE)
Do not specify ‘-march=native’ in ‘LOCAL_CPPFLAGS’ or a Makevars file
example(stan_model,run.dontrun=T)
stn_md> mod ← stan_model(model_code = stancode, verbose = TRUE)
TRANSLATING MODEL ‘73fc79f8b1915e8208c736914c86d1a1’ FROM Stan CODE TO C++ CODE NOW.
successful in parsing the Stan model ‘73fc79f8b1915e8208c736914c86d1a1’.
COMPILING THE C++ CODE FOR MODEL ‘73fc79f8b1915e8208c736914c86d1a1’ NOW.
OS: x86_64, mingw32; rstan: 2.21.2; Rcpp: 1.0.5; inline: 0.3.16
Error in cleanup_makevar(old) :
argument “RMU” is missing, with no default
In addition: Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
‘C:/rtools40/usr/mingw_/bin/g++’ not found