Compilation error using brms

I am fitting a Poisson regression with brms, but I am having problems with the compilation of my model in a cluster. I got the following error message:

Compiling Stan program...
'config' variable 'CPP' is deprecated
icc -E
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! In file included from /home/jomartinez/R/x86_64-pc-linux-gnu-library/4.0/StanHeaders/include/stan/math/rev/mat/functor/idas_forward_system.hpp(9),
                 from /home/jomartinez/R/x86_64-pc-linux-gnu-library/4.0/StanHeaders/include/stan/math/rev/mat/functor/integrate_dae.hpp(5),
                 from /home/jomartinez/R/x86_64-pc-linux-gnu-library/4.0/StanHeaders/include/stan/math/rev/mat.hpp(72),
                 from /home/jomartinez/R/x86_64-pc-linux-gnu-library/4.0/StanHeaders/include/stan/math.hpp(4),
                 from /home/jomartinez/R/x86_64-pc-linux-gnu-library/4.0/StanHeaders/include/src/stan/model/model_header.hpp(4),
                 from file286011e0d7630.cpp(14):
/home/jomartinez/R/x86_64-pc-linux-gnu-library/4.0/StanHeaders/include/stan/math/rev/mat/functor/idas_system.hpp(283): warning #858: type qualifier on return type is meaningless
    const size_t n() { return N_; }

In file included f
In addition: Warning messages:
1: In system(paste(CPP, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
  error in running command
2: In system(cmd, intern = !verbose) :
  running command '/workspace/easybuild/x86_64/software/R/4.0.0-intel-2019b/lib64/R/bin/R CMD SHLIB file286011e0d7630.cpp 2> file286011e0d7630.cpp.err.txt' had status 1
Error in sink(type = "output") : invalid connection

The code that I am running is:

prior1 <- prior(normal(0,10), class = b) +
+   prior(cauchy(0,2), class = sd)
> fit1 <- brm(count ~ zAge + zBase * Trt + (1|patient),
+             data = epilepsy, family = poisson(), prior = prior1)

Some session Info:
R version 4.0.0 (2020-04-24)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Version of relevant libraries:
[1] brms_2.15.0 Rcpp_1.0.4.6 rstan_2.21.3
[4] ggplot2_3.3.0 StanHeaders_2.21.0-7

Many thanks for your help.

just to be clear - are you able to compile some models in the cluster or are you unable to compile any models?

Will tag @rok_cesnovar as I have little experience with installation issues on Linux


Thanks for answering!

I am not able to compile any model… Just took this Poisson regression as an example.

Bumping this up, hopefully somebody with more expertise can answer.

Sorry we were not able to help you so far. A quick suggestion: you can try if you can get cmdstanr to work (Getting started with CmdStanR • cmdstanr) which is often easier to get going. You can then use options(brms.backend = "cmdstanr") to have brms use cmdstanr instead of rstan

1 Like

Sorry for missing this! I’d second @martinmodrak’s suggestion to install cmdstanr and use that as a backend, as it uses a more recent version of Stan which has more features and optimisations.

But let me know if you’d like to troubleshoot the existing rstan installation, and I can help with that as well