Hi,
just to be sure, have you also done the new steps required with Rtools 4.0 to put Rtools on your path? It’s described in section " Putting Rtools on the PATH" there: https://cran.r-project.org/bin/windows/Rtools/
I also had the error about ‘make’ not found because I first did not see that there was this extra step now.
Cheers
mauthier, yes, I did, I followed the steps but the last step–installing from source–threw an error.
C:/Rtools/mingw_32/bin/gcc -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -Iyajl/api -D__USE_MINGW_ANSI_STDIO -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c base64.c -o base64.o
sh: C:/Rtools/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.0/etc/i386/Makeconf:222: base64.o] Error 127
ERROR: compilation failed for package ‘jsonlite’
restoring previous ‘C:/Users/tschwoerer/Documents/R/win-library/4.0/jsonlite’
Warning in install.packages :
installation of package ‘jsonlite’ had non-zero exit status
Ran model from within R (x64) pointing to proper working directory and got the following:
Compilation argument:
C:/PROGRA~1/R/R-40~1.0/bin/x64/R CMD SHLIB file3f383f61ee.cpp 2> file3f383f61ee.cpp.err.txt
C:/Rtools/mingw_64/bin/g++ -m64 -std=c++1y -std=gnu++14 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I"C:/Users/tschwoerer/Documents/R/win-library/4.0/Rcpp/include/" -I"C:/Users/tschwoerer/Documents/R/win-library/4.0/RcppEigen/include/" -I"C:/Users/tschwoerer/Documents/R/win-library/4.0/RcppEigen/include/unsupported" -I"C:/Users/tschwoerer/Documents/R/win-library/4.0/BH/include" -I"C:/Users/tschwoerer/Documents/R/win-library/4.0/StanHeaders/include/src/" -I"C:/Users/tschwoerer/Documents/R/win-library/4.0/StanHeaders/include/" -I"C:/Users/tschwoerer/Documents/R/win-library/4.0/rstan/include" -DEIGEN_NO_DEBUG -D_REENTRANT -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -include stan/math/prim/mat/fun/Eigen.hpp -std=c++1y -march=native -O3 -march=native -mtune=native -c file3f383f61ee.cpp -o file3f383f61ee.o
sh: C:/Rtools/mingw_64/bin/g++: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.0/etc/x64/Makeconf:229: file3f383f61ee.o] Error 127
Error in file(con, “r”) : cannot open the connection
In addition: Warning message:
In file(con, “r”) :
cannot open file ‘file3f383f61ee.cpp.err.txt’: No such file or directory
Are you absolutely, positively, 100% certain you have renamed or deleted your Makevars.win file, in Documents/.R/Makevars.win ? Because yes, it is looking for a compiler in C:/Rtools, which doesn’t exist.
And are you 100% certain you only have PATH="${RTOOLS40_HOME}\usr\bin;${PATH}" in Documents/.Renviron ?
And are you 100% certain you are starting with a clean workspace?
If so, then click start, and search for ‘environment variables’, then click ‘edit system environment variables’. Then click environment variables. Go to system variables, and edit Path. Remove only the line that has Rtools in it.
Ok, again - You should not have anything defined in your Makevars.win right now. Move, delete, or rename it to something else. BINPREF is pointing to C:/Rtools, and it shouldn’t be.
Do you have a .Rprofile somewhere defining BINPREF?
It seems like there is some configuration, somewhere on your system (Makevars.win, .Renviron, .Rprofile) that is telling R that the compiler should be in BINPREF, defined somewhere as being C:/Rtools.
Edit: As for Windows saying that Makevars.win is an adobe CMS type, ignore it. Windows has a really rudimentary, stupid way of finding filetypes. It thinks Makevars.win is really a file named Makevars with extension win, which it apparently thinks is adobe. It is in reality a plain text file that defines compiler options on windows - hence why I said it should be removed from the equation for now.
Is there anything else I should know to not run into the same issue again when updating to new versions or R? What about the edits to .Rprofile and the renaming of Makevars.win?
Do you happen to know which solution solved the problem, for future users to know?
As for what not to run: You do not need to specify a compiler. You may want to include a Makevars.win that has compiler optimizations defined, but not paths to compilers. There are some listed around here, and they look like CXX14FLAGS += -march=native -mtune=native -O3 -Wno-unused-variable -Wno-unused-function -fPIC if I recall correctly. That’s what I have on linux, unsure whether those options hold up on windows. Basically, just avoid modifying paths, or specifying which compiler to use, unless you know for certain what you’re doing. Future versions of R should continue working as far as I know.
Thanks a lot for sticking with me through this very long problem solving act.
Remove Sys.setenv(BINPREF = “C:/Rtools/mingw_$(WIN)/bin/”) from your .Rprofile.
And
moving or rename Documents/.R/Makevars.win.
solved the problem