First time user of rstan/Rtools here. After installing Rtools 43 and rstan and
running the test model
example(stan_model, package = “rstan”, run.dontrun = TRUE)
I see the following error message…
“Error in compileCode(f, code, language = language, verbose = verbose) :
/bin/sh: line 1: g++: command not foundmake: *** [C:/PROGRA~1/R/R-44~1.0/etc/x64/Makeconf:296: file2490587a21dd.o] Error 127”
After searching throuch discourse and online, none of the fixes solved this error
Here is some relevant results based on requests seen in other threads:
Sys.which(“make”)
make
“C:\rtools43\usr\bin\make.exe”
Sys.getenv(“BINPREF”)
[1] “”
readLines(“~/.Renviron”)
[1] “PATH="{RTOOLS43_HOME}\\usr\\bin;{PATH}"”
readLines(“~/.R/Makevars.win”)
[1] “”
[2] " CXX14FLAGS += -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2"
Sys.getenv(“R_LIBS_USER”)
[1] “C:\Users\chris\AppData\Local/R/win-library/4.4”
And lastly…
Sys.getenv(“PATH”)
[1] “c:\rtools44\x86_64-w64-mingw32.static.posix\bin;c:\rtools44\usr\bin;C:\rtools43\usr\bin;C:\rtools43\usr\bin;C:\Program Files\R\R-4.4.0\bin\x64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\chris\AppData\Local\Microsoft\WindowsApps;C:\Program Files\RStudio\resources\app\bin\quarto\bin;C:\Program Files\RStudio\resources\app\bin\postback”
Operating System: Windows11 Pro
R Version: 4.4.0
Rtools 4.3
rstan: 2.32.6
RStudio: 2024.04.2
Thank you. -Chris