I cannot seem to make Stan (the latest build) work. I fought for a while and RTools seems to work (I have installed RTools 4.0 and can install jsonlite from source a la here).
The forums have been very helpful and I cannot rule out missing something obvious. But I’ve tried the solutions provided here, but the closest problem (#3) doesn’t apply, because my RTools path is “C:\rtools40\usr\bin\make.exe” (from Sys.which("make")
).
Here is the code I cannot run (I cannot run even a simple toy model, e.g. y~ rnorm(N, mu, sigma)):
library(rstan)
example(stan_model, run.dontrun = TRUE)
Here is the error message:
Error in compileCode(f, code, language = language, verbose = verbose) :
C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file17e050ee2870.o:file17e050ee2870.cpp:(.text$_ZN3tbb8internal26task_scheduler_observer_v3D1Ev[_ZN3tbb8internal26task_scheduler_observer_v3D1Ev]+0x14): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file17e050ee2870.o:file17e050ee2870.cpp:(.text$_ZN3tbb8internal26task_scheduler_observer_v3D0Ev[_ZN3tbb8internal26task_scheduler_observer_v3D0Ev]+0x1c): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file17e050ee2870.o:file17e050ee2870.cpp:(.text$_ZN4stan4math16ad_tape_observerD1Ev[_ZN4stan4math16ad_tape_observerD1Ev]+0x15): undefined reference to `tbb::internal::task_scheduler_observer_v3::observe(bool)'C:/rt
In addition: Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
'C:/rtools40/usr/mingw_/bin/g++' not found
Error in sink(type = "output") : invalid connection
Here is my Makevars.win file:
CXX14FLAGS=-O3 -mtune=native
CXX11FLAGS=-O3 -march=corei7 -mtune=corei7
I am hoping I missed the answer somewhere. Somehow, I fixed the problem two nights ago but it has returned and I do not know why.
sapply(c("StanHeaders", "rstan", "inline"), packageVersion)
$StanHeaders
[1] 2 21 0 6
$rstan
[1] 2 21 2
$inline
[1] 0 3 16
I’d appreciate any and all help.
Sincerely,
Josh Malnight