New error: cleanup_makevar(old) : argument "RMU" is missing, with no default

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.

Can you try installing the preview of next version of rstan? The withr issues have been patched.

You just need to restart R, making sure that RStan doesn’t get loaded, and run:

    remove.packages(c("StanHeaders", "rstan"))
    install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
    install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

Thanks @andrjohns, that did the trick! No other bugs so far, knock on wood.

@andrjohns

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

This part of the output:

rstan_2.21.2         StanHeaders_2.21.0-7

Indicates that you’re not using the preview version (those should be 2.26), so try installing those again.

Also, the output shows that you’re using R4.1.0, but the call to g++:

C:/Rtools/mingw_64/bin/g++ 

Indicates that you’re using RTools 3.5, when you need to be using RTools 4

Hmm, worked great for Stan Headers but for rstan, I’m getting:

compilation terminated.
make: *** [C:/PROGRA~1/R/R-41~1.0/etc/i386/Makeconf:245: version.o] Error 1
ERROR: compilation failed for package 'rstan'
Warning in install.packages :
  installation of package ‘rstan’ had non-zero exit status

Can you copy more of the output? There should be compilation errors above it that will have the issue

Ahh, sorry about that! Super appreciate the help!

The output is super long, but here’s what seems to be the relevant part.

sh: tail: command not found
sh: tail: command not found
C:/Rtools/mingw_32/bin/g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS  -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/Rcpp/include' -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/RcppEigen/include' -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/BH/include' -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/StanHeaders/include' -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c misc.cpp -o misc.o
sh: tail: command not found
sh: tail: command not found
sh: tail: command not found
sh: tail: command not found
C:/Rtools/mingw_32/bin/g++  -std=gnu++14 -I"C:/PROGRA~1/R/R-41~1.0/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS  -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/Rcpp/include' -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/RcppEigen/include' -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/BH/include' -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/StanHeaders/include' -I'C:/Users/Matthewclark989/Documents/R/win-library/4.1/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c version.cpp -o version.o
sh: tail: command not found
sh: tail: command not found
version.cpp:18:28: fatal error: stan/version.hpp: No such file or directory
 #include <stan/version.hpp>

Your R installation is still using the old RTools35, not Rtools4. Can you try the Getting Started instructions for R4.0: Configuring C Toolchain for Windows · stan-dev/rstan Wiki · GitHub

They cover the changes in configuration that are needed when upgrading from R3.x → R4.x

Got it, I think the issue is coming from my “make” file not being able to be found. I have rtools4. I get:

> file.exists("C:\\rtools40\\usr\\bin\\make.exe")
[1] TRUE

and I’ve ran

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.

Can you post the output you get from restarting R and running:

Sys.getenv("PATH")

[1] “\usr\bin;C:\Program Files\R\R-4.1.0\bin\x64;C:\Rtools\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin;C:\RBuildTools\3.4\bin;C:\RBuildTools\3.4\gcc-4.6.3\bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\PharosSystems\Core;C:\Users\Matthewclark989\AppData\Roaming\TinyTeX\bin\win32;C:\Users\Matthewclark989\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\SSH Communications Security\SSH Secure Shell;C:\Users\Matthewclark989\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;C:\Users\Matthewclark989\AppData\Local\GitHubDesktop\bin;C:\Users\Matthewclark989\AppData\Local\atom\bin”

Interesting. Judging by the start of the PATH variable: “\usr\bin;, it looks like the RTOOLS40_HOME environment variable is blank.

Try using the path to rtools directly:

writeLines('PATH="C:\\rtools40\\usr\\bin;${PATH}"', con = "~/.Renviron")

Then restart R and run Sys.which("make") again

Hmm, still doesn’t look like it’s working:

> writeLines('PATH="C:\\rtools40\\usr\\bin;${PATH}"', con = "~/.Renviron")
> Sys.which("make")
                              make 
"C:\\rtools40\\usr\\bin\\make.exe" 
> install.packages("jsonlite", type = "source")
Installing package into ‘C:/Users/Matthewclark989/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/jsonlite_1.7.2.tar.gz'
Content type 'application/x-gzip' length 421716 bytes (411 KB)
downloaded 411 KB

* installing *source* package 'jsonlite' ...
** package 'jsonlite' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
C:/rtools40/usr/mingw_32/bin/gcc  -I"C:/PROGRA~1/R/R-41~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: line 1: C:/rtools40/usr/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-41~1.0/etc/i386/Makeconf:238: base64.o] Error 127
ERROR: compilation failed for package 'jsonlite'
* removing 'C:/Users/Matthewclark989/Documents/R/win-library/4.1/jsonlite'
* restoring previous 'C:/Users/Matthewclark989/Documents/R/win-library/4.1/jsonlite'
Warning in install.packages :
  installation of package ‘jsonlite’ had non-zero exit status

The output: C:/rtools40/usr/mingw_32/ indicates that your R installation is still configured for RTools 3.5 (i.e., the BINPREF environment variable).

Can you try the instructions in the RStan getting started guide for this: Configuring C Toolchain for Windows · stan-dev/rstan Wiki · GitHub

1 Like