I’m trying to run an example brms model and it’s crashing R. I get the R Session Aborted; R encountered fatal error pop up on RStudio.
When I run the model it prints this:
‘’Compiling Stan program... sh: -c: line 0: syntax error near unexpected token
(’
sh: -c: line 0: 'clang++ -mmacosx-version-min=10.13' -E -nostdinc -x c++ -P -C -I /var/folders/fd/kl1ybw3s1ddfq3yzd87yg1qr0000gn/T//Rtmp8axabJ -I /Users/my_name/project -o /var/folders/fd/kl1ybw3s1ddfq3yzd87yg1qr0000gn/T//Rtmp8axabJ/file14222067410.stan /var/folders/fd/kl1ybw3s1ddfq3yzd87yg1qr0000gn/T//Rtmp8axabJ/file14225d439d36.stan'
Though it used to work regardless of that.
rstanarm models work fine.
library(brms)
fit1 <- brm(count ~ zAge + zBase * Trt + (1|patient),
data = epilepsy, family = poisson(), chains = 1)
- Operating System: macOS Catalina
- brms Version: 2.13.5
- R Version: 4.0.2
- RStudio Version: RStudio Desktop 1.3.1073
Any help much appreciated!
Thanks
bgoodri
2
Do
install.packages("inline")
example(stan_model, package = "rstan", run.dontrun = TRUE)
and tell us what is the commands listed under “make would do …”.
Under ‘make would use’ it says:
make would use clang++ -mmacosx-version-min=10.13 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/unsupported" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/BH/include" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/src/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/include" -DEIGEN_NO_DEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -DSTAN_THREADS -DBOOST_NO_AUTO_PTR -include '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp' -D_REENTRANT -DRCPP_PARALLEL_USE_TBB=1 -I/usr/local/include -fPIC -Wall -g -O2 -c file6e77eb72401.cpp -o file6e77eb72401.o if test "zfile6e77eb72401.o" != "z"; then \ echo clang++ -mmacosx-version-min=10.13 -std=gnu++14 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L"/Library/Frameworks/R.framework/Resources/lib" -L/usr/local/lib -o file6e77eb72401.so file6e77eb72401.o /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/lib//libStanServices.a -L'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/lib/' -lStanHeaders -L'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/lib/' -ltbb -ltbbmalloc -ltbbmalloc_proxy -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation; \ clang++ -mmacosx-version-min=10.13 -std=gnu++14 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L"/Library/Frameworks/R.framework/Resources/lib" -L/usr/local/lib -o file6e77eb72401.so file6e77eb72401.o /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/lib//libStanServices.a -L'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/lib/' -lStanHeaders -L'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/lib/' -ltbb -ltbbmalloc -ltbbmalloc_proxy -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation; \ fi
Though i have managed to get it running now without crashing - by commenting out the line in the Makevars file…(not sure why that helps!).
However I still get this printed:
Compiling Stan program... sh: -c: line 0: syntax error near unexpected token
(’
sh: -c: line 0: 'clang++ -mmacosx-version-min=10.13' -E -nostdinc -x c++ -P -C -I /var/folders/fd/kl1ybw3s1ddfq3yzd87yg1qr0000gn/T//Rtmp0rVUg1 -I /Users/name/project -o /var/folders/fd/kl1ybw3s1ddfq3yzd87yg1qr0000gn/T//Rtmp0rVUg1/file6e714588fca.stan /var/folders/fd/kl1ybw3s1ddfq3yzd87yg1qr0000gn/T//Rtmp0rVUg1/file6e7738c9c0a.stan' Start sampling
Thanks!