Error and warning messages when using brm function

Hello,

I would like to run this model:
brm (y ~ B + C + (1 | Ra) + (1 | Rb), family = categorical, data = d)

My outcome variable is “y” (with 3 nominal categories).
My two fixed variables are “B” (with 2 nominal categories) and “C” (with 3 nominal categories).
My two random variables are “Ra” and “Rb”.

However, after running it, I got these error and warning messages:

Compiling Stan program…
make cmd is
make -f “C:/PROGRA~1/R/R-36~1.3/etc/x64/Makeconf” -f “C:/PROGRA~1/R/R-36~1.3/share/make/winshlib.mk” CXX=’ (CXX11) (CXX11STD)’ CXXFLAGS=’ (CXX11FLAGS)′CXXPICFLAGS=′ (CXX11PICFLAGS)’ SHLIB_LDFLAGS=’ (SHLIBCXX11LDFLAGS)′SHLIBLD=′ (SHLIB_CXX11LD)’ SHLIB=“file106047a54bf1.dll” WIN=64 TCLBIN=64 OBJECTS=“file106047a54bf1.o”

make would use
if test “zfile106047a54bf1.o” != “z”; then
if test -e “file106047a54bf1-win.def”; then
echo C:/RBuildTools/3.5/mingw_64/bin/g++ -shared -s -static-libgcc -o file106047a54bf1.dll file106047a54bf1-win.def file106047a54bf1.o “C:/Users/Pianobot/Documents/R/win-library/3.6/rstan/lib/x64/libStanServices.a” -L"C:/Users/Pianobot/Documents/R/win-library/3.6/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Pianobot/Documents/R/win-library/3.6/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA~1/R/R-36~1.3/bin/x64" -lR ;
C:/RBuildTools/3.5/mingw_64/bin/g++ -shared -s -static-libgcc -o file106047a54bf1.dll file106047a54bf1-win.def file106047a54bf1.o “C:/Users/Pianobot/Documents/R/win-library/3.6/rstan/lib/x64/libStanServices.a” -L"C:/Users/Pianobot/Documents/R/win-library/3.6/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Pianobot/Documents/R/win-library/3.6/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA~1/R/R-36~1.3/bin/x64" -lR ;
else
echo EXPORTS > tmp.def;
C:/RBuildTools/3.5/mingw_64/bin/nm file106047a54bf1.o | sed -n ‘s/^.* [BCDRT] / /p’ | sed -e ‘/[.]refptr[.]/d’ -e ‘/[.]weak[.]/d’ | sed ‘s/[^ ][^ ]*/"&"/g’ >> tmp.def;
echo C:/RBuildTools/3.5/mingw_64/bin/g++ -shared -s -static-libgcc -o file106047a54bf1.dll tmp.def file106047a54bf1.o “C:/Users/Pianobot/Documents/R/win-library/3.6/rstan/lib/x64/libStanServices.a” -L"C:/Users/Pianobot/Documents/R/win-library/3.6/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Pianobot/Documents/R/win-library/3.6/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA~1/R/R-36~1.3/bin/x64" -lR ;
C:/RBuildTools/3.5/mingw_64/bin/g++ -shared -s -static-libgcc -o file106047a54bf1.dll tmp.def file106047a54bf1.o “C:/Users/Pianobot/Documents/R/win-library/3.6/rstan/lib/x64/libStanServices.a” -L"C:/Users/Pianobot/Documents/R/win-library/3.6/StanHeaders/libs/x64" -lStanHeaders -L"C:/Users/Pianobot/Documents/R/win-library/3.6/RcppParallel/lib/x64" -ltbb -L"C:/PROGRA~1/R/R-36~1.3/bin/x64" -lR ;
rm -f tmp.def;
fi
fi
Error in compileCode(f, code, language = language, verbose = verbose) :
file106047a54bf1.o:file106047a54bf1.cpp:(.data$_ZZN5boost4math6detail9bessel_y0IeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_SB_RKT0_E2P1[_ZZN5boost4math6detail9bessel_y0IeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_SB_RKT0_E2P1]+0x0): first defined hereC:/Users/Pianobot/Documents/R/win-library/3.6/rstan/lib/x64/libStanServices.a(stan_fit.o):stan_fit.cpp:(.rdata$_ZZN5boost4math6detail9bessel_y0IeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_SB_RKT0_E2Q2[_ZZN5boost4math6detail9bessel_y0IeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_SB_RKT0_E2Q2]+0x0): multiple definition of `long double boost::math::detail::bessel_y0<long double, boost::ma
In addition: Warning messages:
1: Rows containing NAs were excluded from the model.
2: In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
‘-E’ not found
Error in sink(type = “output”) : invalid connection

Could you please help me to solve these issues?
Many thanks in advance for your response.
Best regards,

brm(y ~ B + C + (1 | Ra) + (1 | Rb), family = categorical, data = d)

Operating System: Windows 7 Professional
brms Version: 2.14.4

Hi, I am in no way an expert as I’ve just been learning brms and Stan but I had a similar error after I tried to update brms and @andrjohns gave me this advice:

Compile packages using all cores

Sys.setenv(MAKEFLAGS = paste0("-j",parallel::detectCores()))

install.packages(c(“StanHeaders”,“rstan”),type=“source”)
Stan post error code

I’ve included the link to the original post. Once again, I’m no expert and don’t want to be giving you incorrect advice, but seeing no one answered and how similar it looked to my error, this might be worth a try.

Hi Rokh42,
Thanks a lot for your message and your help. Unfortunately, it did not work to solve my issues.
Best regards,