I am using Rstudio 1.3.959 R for windows 4.0.2 and Rtools 4.0 . Facing issue while trying to use rstan package.
when running the below sample code
scode <- "
data {
int y;
int n;
}
parameters {
real<lower=0, upper=1> pi;
}
model {
pi ~ beta(0.5, 0.5);
y ~ binomial(n, pi);
}
"
sfit1 <- stan(model_code = scode, data=list(y=5, n=20))
I am getting the below error message.
The NEXT version of Stan will not be able to pre-process your Stan program.
Please open an issue at
https://github.com/stan-dev/stanc3/issues
if you can share or at least describe your Stan program. This will help ensure that Stan
continues to work on your Stan programs in the future. Thank you!
This message can be avoided by wrapping your function call inside suppressMessages().
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file45286876c5a.o:file45286876c5a.cpp:(.text+0x71c): 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: file45286876c5a.o:file45286876c5a.cpp:(.text+0x1397): undefined reference to
rstan::stan_fit::stan_fit(SEXPREC*, int)'
C:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: file45286876c5a.o:file45286876c5a.cpp:(.text+0x75e): 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: file45286876c5a.o:file45286876c5a.cpp:(.text$_ZN3tbb8internal26task_scheduler_observer_v3D1Ev[_ZN3tbb8internal26task_scheduler_observe
In addition: Warning message:
In file.remove(c(unprocessed, processed)) :
cannot remove file 'C:\Users*\AppData\Local\Temp\1\RtmpMPVjAM\file452876186a62.stan', reason 'No such file or directory'
Error in sink(type = "output") : invalid connection"