I’m new to brms and running into a problem involving compilation. I followed all the instructions for downloading brms and rstan, but when trying to run:
fitlasso <- brm(count ~ log_Age_c + log_Base4_c * Trt_c,data = epilepsy, family = poisson(), prior = set_prior(“lasso(1)”, class = “b”))
I get the following 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 file39b540afc9a.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/autodiffstackstorage.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/memory/stack_alloc.hpp:8:
In file included from /usr/local/clang4/bin/…/include/c++/v1/cstdlib:86:
/
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file39b540afc9a.cpp 2> file39b540afc9a.cpp.err.txt’ had status 1
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from file5052cde5d04.cpp:8:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/autodiffstackstorage.hpp:4:
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/memory/stack_alloc.hpp:8:
In file included from /usr/local/clang4/bin/…/include/c++/v1/cstdlib:86:
/
This generated a lot of output too (more than I can see in the console). Would you like to see that as well? Thanks so much for your help!
/usr/local/clang4/bin/../include/c++/v1/stdlib.h:94:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
So, the compiler error is saying it cannot find your standard library headers and is basically completely lost. We have seen errors like this a few times in the past week, but do not know what triggers it. Did you either upgrade your operating system and / or (re)install Anaconda recently?
It can probably be overcome by adding CXX14FLAGS += -isystem /usr/include to your ~/.R/Makevars file but it would be better if we knew how it went wrong.
Unfortunately, I’m still getting the same error. Can you tell me if I added that command to the Makevars file correctly, or if there is anything else you would recommend me doing?
From the latest Xcode 10 Beta 2 release notes.
The Command Line Tools package installs the macOS system headers inside the macOS SDK. Software that compiles with the installed tools will search for macOS headers at the standard include path: /Applications/Xcodebeta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.1 4.sdk/usr/include For legacy software that looks for the macOS headers in the base system under /usr/include, please install the package file located at: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14. pkg