Brms errors

Hi,
I’ve suddenly started getting errors when trying to run models in brms. I’ve reinstalled RTools, rstan, and brms, which popped up a new error that was solved by reinstalling callr. This is what I’m getting now:

brm(x~y, data=z)
Compiling the C++ model
Error in rethrow_call(c_processx_exec, command, c(command, args), stdin, :
Incorrect number of arguments (16), expecting 14 for ‘processx_exec’
Error in sink(type = “output”) : invalid connection

And now this happened -

brm(x~y, data=z)
Compiling the C++ model
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! sh: g++: command not found
make: *** [C:/PROGRA~1/R/R-36~1.0/etc/x64/Makeconf:215: file20b427a45d95.o] Error 127
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘C:/PROGRA~1/R/R-36~1.0/bin/x64/R CMD SHLIB file20b427a45d95.cpp 2> file20b427a45d95.cpp.err.txt’ had status 1
Error in sink(type = “output”) : invalid connection

I think all this is since upgrading R from 3.5.2 to 3.6. I don’t for the life of me understand the fixes I’ve seen online with makevars.win … thanks for any help

If it’s a big change like that, it might be worth trying to reinstall your libraries.

At least give:

remove.packages("brms")
install.packages("brms")

a go.

I’ve done that, along with reinstalling rstan and rstanarm, no luck

I had a similar problem after upgrading R to 3.6.0 under Windows (no problems under Linux). It looked as if rstan couldn’t locate the compiler g++.exe, so I changed the second line of Makevars.win to include the full path to g++.exe, like this:

CXX14FLAGS=-O3 -march=native
CXX14 = “C:\Rtools\mingw_64\bin\g++.exe” -m$(WIN) -std=c++1y
CXX11FLAGS=-O3 -march=native

and that fixed it for me.

Error in rethrow_call(c_processx_exec, command, c(command, args), stdin, :
Incorrect number of arguments (16), expecting 14 for ‘processx_exec’
Error in sink(type = “output”) : invalid connection

I encountered this error today for the first time with rstan after updating some (other) R packages. Re-installing R (and all the packages) did work for me.

That was on Win7 with R 3.6.

Oof, I see you said that already in your original post. My apologies. Yeah I don’t know what to do other than that.

Google showed like two other references to a processx_exec thing. Looks like that’s in some weird package here: https://github.com/tidyverse/reprex/issues/136#issuecomment-345590577

Maybe just nuke all your R packages? That’s probably not a very helpful suggestion though :(. There’s a stackoverflow thread here on it: https://stackoverflow.com/a/16384342 . The checkBuilt argument looks like it makes sure packages were built with the current R.