Brms (via ordbetareg) errors during compilation

I am brand new to Rstan, my first attempt to use it was with ordbetareg in brms. My model:

ordbetareg(Quad ~ Genotype * Dose + (1 | Mouse), data = probe.dat)

The output:
make cmd is
make -f “C:/PROGRA~1/R/R-42~1.3/etc/x64/Makeconf” -f “C:/PROGRA~1/R/R-42~1.3/share/make/winshlib.mk” CXX=‘(CXX14) (CXX14STD)’ CXXFLAGS=‘(CXX14FLAGS)' CXXPICFLAGS='(CXX14PICFLAGS)’ SHLIB_LDFLAGS=‘(SHLIB_CXX14LDFLAGS)' SHLIB_LD='(SHLIB_CXX14LD)’ SHLIB=“file11a82d7f1ecf.dll” WIN=64 TCLBIN= OBJECTS=“file11a82d7f1ecf.o”

make would use
if test “zfile11a82d7f1ecf.o” != “z”; then
if test -e “file11a82d7f1ecf-win.def”; then
echo g++ -shared -s -static-libgcc -o file11a82d7f1ecf.dll file11a82d7f1ecf-win.def file11a82d7f1ecf.o -L"C:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64" -L"C:/rtools42/x86_64-w64-mingw32.static.posix/lib" -L"C:/PROGRA~1/R/R-42~1.3/bin/x64" -lR ;
g++ -shared -s -static-libgcc -o file11a82d7f1ecf.dll file11a82d7f1ecf-win.def file11a82d7f1ecf.o -L"C:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64" -L"C:/rtools42/x86_64-w64-mingw32.static.posix/lib" -L"C:/PROGRA~1/R/R-42~1.3/bin/x64" -lR ;
else
echo EXPORTS > tmp.def;
nm file11a82d7f1ecf.o | sed -n ‘s/^.* [BCDRT] / /p’ | sed -e ‘/[.]refptr[.]/d’ -e ‘/[.]weak[.]/d’ | sed ‘s/[^ ][^ ]*/“&”/g’ >> tmp.def;
echo g++ -shared -s -static-libgcc -o file11a82d7f1ecf.dll tmp.def file11a82d7f1ecf.o -L"C:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64" -L"C:/rtools42/x86_64-w64-mingw32.static.posix/lib" -L"C:/PROGRA~1/R/R-42~1.3/bin/x64" -lR ;
g++ -shared -s -static-libgcc -o file11a82d7f1ecf.dll tmp.def file11a82d7f1ecf.o -L"C:/rtools42/x86_64-w64-mingw32.static.posix/lib/x64" -L"C:/rtools42/x86_64-w64-mingw32.static.posix/lib" -L"C:/PROGRA~1/R/R-42~1.3/bin/x64" -lR ;
rm -f tmp.def;
fi
fi
Error in compileCode(f, code, language = language, verbose = verbose) :
C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: file11a82d7f1ecf.o:file11a82d7f1ecf.cpp:(.text$_ZN3tbb8internal26task_scheduler_observer_v3D0Ev[_ZN3tbb8internal26task_scheduler_observer_v3D0Ev]+0x1d): undefined reference to tbb::internal::task_scheduler_observer_v3::observe(bool)'C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: file11a82d7f1ecf.o:file11a82d7f1ecf.cpp:(.text$_ZN3tbb10interface623task_scheduler_observerD1Ev[_ZN3tbb10interface623task_scheduler_observerD1Ev]+0x1d): undefined reference to tbb::internal::task_scheduler_observer_v3::observe(bool)'C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: file11a82d7f1ecf.o:file11a82d7f1ecf.cpp:(.text$_ZN3tbb10interface623task_scheduler_observerD1Ev[_ZN3tbb10interface623task_scheduler_observerD1Ev]+0x3a): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:\rtools42\x86_64-w64-mingw32.static.posix\bin/ld.exe: file11a82d7f1ecf.o:file11a82d7f1ecf.cpp:(.text$_ZN3tbb10interface
Error in sink(type = “output”) : invalid connection

A new version of RStan just made it onto CRAN just in the past few days. What happens if you install the new version?

# right now you probably need 'source' until binaries are built by CRAN
install.packages(c("rstan","StanHeaders"), type ="source")

Worked like a charm.
Thank you.

1 Like