- Operating System: Microsoft Windows [Version 10.0.17134.345]
- brms Version: 2.5.0
I have been using rstan and brms but today they stopped working unexpectedly.
I have tried uninstalling and reinstalling following the instructions from here Home · stan-dev/rstan Wiki · GitHub and I am able to get 10 when I do
fx <- inline::cxxfunction( signature(x = “integer”, y = “numeric” ) , ’ return ScalarReal( INTEGER(x)[0] * REAL(y)[0] ) ; ’ ) fx( 2L, 5 ) # should be 10
Still, when I run the code:
DT<-structure(list(c = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L), .Label = c("a", "b"), class = "factor"),
x = c(2004L, 2005L, 2006L, 2007L, 2008L, 2010L, 2012L, 2010L,
2012L, 2010L, 2005L, 2007L, 2012L, 2005L), y = c(11.05826397,
15.56776557, 49.50980392, 64.53900709, 75, 68.18181818, 99.86357435,
100, 99.26739927, 98.52941176, 100, 95.94594595, 99.64157706,
100)), class = "data.frame", row.names = c(NA, -14L))
library(brms)
fit <- brm(y~ x, data = DT)
I get the error:
Compiling the C++ model
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from C:/Users/…/Documents/R/win-library/3.5/BH/include/boost/config.hpp:39:0,
from C:/Users/…/Documents/R/win-library/3.5/BH/include/boost/math/tools/config.hpp:13,
from C:/Users/…/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/core/var.hpp:7,
from C:/Users/…/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5,
from C:/Users/…/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/core.hpp:12,
from C:/Users/…/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/mat.hpp:4,
from C:/Users/…/Documents/R/win-library/3.5/StanHeaders/include/stan/math.hpp:4,
from C:/Users/…/Documents/R/win-library/3.5/StanHeaders/include/src/stan
In addition: Warning messages:
1: In rstan::stan_model(model_code = x$model, save_dso = save_dso) :
StanHeaders version is ahead of rstan version; update to latest rstan
2: In system(cmd, intern = !verbose) :
running command ‘C:/PROGRA~1/R/R-3.5.1/bin/x64/R CMD SHLIB file110c1cb656fa.cpp 2> file110c1cb656fa.cpp.err.txt’ had status 1
I get the same error when I run stan model from here:
I have reinstalled Rtools several times and even uninstalled and reinstalled R and R Studio, without success.
Any help would be much appreciated.