I am trying to install Rstan. I have no problem installing the package and running it. However, when I try running a program that uses the library I get the following error:
Error in compileCode(f, code, language = language, verbose = verbose) :
sh: line 1: K:/Software/rtools40/ucrt64/mingw_64/bin/g++:
No such file or directorymake: *** [K:/Software/R-41~1.2/etc/x64/Makeconf:245: file9706b781d3e.o] Error 127
Error in sink(type = "output") : invalid connection
I have spent some time trying to trouble shoot it but I simply cannot solve it. I have checked that rtools is in the path using:
writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")
When I went directly into the directorymake referenced by the error [K:/Software/R-41~1.2/etc/x64/Makeconf:245: file9706b781d3e.o]
it is there!
But the K:/Software/rtools40/ucrt64/mingw_64/bin/g++
is not. Specifically the ~/mingw_64/bin/g++
.
Does anyone has had this issue?
How can I point rstan to a different directory or restore the default one? (Note: I have uninstall it and install it using the headers and without headers and updated rtools and R