I’m also in this doom loop again. It’s the same behavior I encountered last fall:
When the error described in the thread title occurs, my Makevars.win file is completely deleted.
If I run without a Makevars.win, I don’t get the error (but this is not a viable solution in general, for the reasons discussed above).
The difference this time is that I am no longer able to roll back to withr 2.2.0. Now remotes::install_version("withr", "2.2.0") fails with error
Downloading package from url: https://cran.rstudio.com//src/contrib/Archive/withr/withr_2.2.0.tar.gz
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called 'withr'
Calls: loadNamespace ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
Warning message:
In i.p(...) :
installation of package ‘C:/Users/Buhle/AppData/Local/Temp/Rtmp61iDTf/remotes12783cca28cc/withr’ had non-zero exit status
I got a similar error when I tried downloading and installing the withr 2.2.0 source tarball.
It seems like this problem (re)started last week after I uninstalled and reinstalled R 4.1.0 and RTools40 to resolve yet another (sigh) mysterious error when compiling one of my rstantools-based packages. I have no idea why, though, as none of the versions of anything changed AFAIK; all packages were already up to date. (Meaning, presumably, that the current version of withr wasn’t causing problems anymore. I hadn’t noticed; TBH, I’d completely forgotten about this thread until now.)
Any suggestions? For example, how to get the withr reversion to work? Thanks in advance.
I was also having this same “RMU” error when trying to fit a stan model. I followed the instructions above and installed the next version of rstan. I’m now getting a massive error vomit (below). I’ve also pasted my session info. Not sure if this might be a clue, but I’m trying to solve an ODE using integrate_ode_rk45() in stan
Session:
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rstan_2.21.2 StanHeaders_2.21.0-7 ggplot2_3.3.3
[4] dplyr_1.0.6 deSolve_1.28
Error:
make cmd is
make -f "C:/PROGRA~1/R/R-41~1.0/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-41~1.0/share/make/winshlib.mk" CXX='$(CXX14) $(CXX14STD)' CXXFLAGS='$(CXX14FLAGS)' CXXPICFLAGS='$(CXX14PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX14LDFLAGS)' SHLIB_LD='$(SHLIB_CXX14LD)' SHLIB="file3f7c58e24952.dll" WIN=64 TCLBIN=64 OBJECTS="file3f7c58e24952.o"
make would use
if test "zfile3f7c58e24952.o" != "z"; then \
if test -e "file3f7c58e24952-win.def"; then \
echo C:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o file3f7c58e24952.dll file3f7c58e24952-win.def file3f7c58e24952.o "C:/Users/Matthewclark989/Documents/R/win-library/4.1/rstan/lib/x64/libStanServices.a" -L"C:/Users/Matthewclark989/Documents/R/win-library/4.1/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Matthewclark989/Documents/R/win-library/4.1/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA~1/R/R-41~1.0/bin/x64" -lR ; \
C:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o file3f7c58e24952.dll file3f7c58e24952-win.def file3f7c58e24952.o "C:/Users/Matthewclark989/Documents/R/win-library/4.1/rstan/lib/x64/libStanServices.a" -L"C:/Users/Matthewclark989/Documents/R/win-library/4.1/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Matthewclark989/Documents/R/win-library/4.1/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA~1/R/R-41~1.0/bin/x64" -lR ; \
else \
echo EXPORTS > tmp.def; \
C:/Rtools/mingw_64/bin/nm file3f7c58e24952.o | sed -n 's/^.* [BCDRT] / /p' | sed -e '/[.]refptr[.]/d' -e '/[.]weak[.]/d' | sed 's/[^ ][^ ]*/"&"/g' >> tmp.def; \
echo C:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o file3f7c58e24952.dll tmp.def file3f7c58e24952.o "C:/Users/Matthewclark989/Documents/R/win-library/4.1/rstan/lib/x64/libStanServices.a" -L"C:/Users/Matthewclark989/Documents/R/win-library/4.1/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Matthewclark989/Documents/R/win-library/4.1/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA~1/R/R-41~1.0/bin/x64" -lR ; \
C:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o file3f7c58e24952.dll tmp.def file3f7c58e24952.o "C:/Users/Matthewclark989/Documents/R/win-library/4.1/rstan/lib/x64/libStanServices.a" -L"C:/Users/Matthewclark989/Documents/R/win-library/4.1/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Matthewclark989/Documents/R/win-library/4.1/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA~1/R/R-41~1.0/bin/x64" -lR ; \
rm -f tmp.def; \
fi \
fi
writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron")
But when I check for make:
> Sys.which("make")
make
""
I just get an empty vector.
This is confirmed when I try to install a package from source:
install.packages("jsonlite", type = "source")
*** arch - i386
Warning in system(cmd) : 'make' not found
ERROR: compilation failed for package 'jsonlite'
I’ve tried playing with the PATH, but to no avail. My guess is that something needs to change there, but I can’t figure out what it is. I also tried deleting and reinstalling rtools. I also deleted the old version of RTOOLS.