Hello,
I’m trying to run a brm model using Stan. After I run the brm model it says “Compiling Stan program…” and nothing happens. So when I run “summary(model1)” it says “object ‘model1’ not found”. I left the code running for hours for a couple of days now but still nothing. Would really appreciate some help here :) Thanks!
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! clang: warning: no such sysroot directory: ‘/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk’ [-Wmissing-sysroot]
In file included from :1:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppEigen/include/Eigen/Dense:1:
In file included from /Library/Frameworks/R.framework/Versions/3.6/Resources/library/RcppEigen/include/Eigen/Core:82:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/new:90:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/exception:81:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/…/include/c++/v1/cs
In addition: Warning message:
In find.package(package, lib.loc, verbose = verbose) :
package ‘base’ found more than once, using the first from
“/Library/Frameworks/R.framework/Resources/library/base”,
“/Library/Frameworks/R.framework/Versions/3.6/Resources/library/base”
I don’t know if I should update my R version to 4.0.1 or if it will mess up things worse
That looks like your c++ toolchain isn’t set up quite right. I’m not on Mac so I can’t help troubleshoot much more, but @jonah should be able to help here (or know who else to tag).
Jonah, this user is on Catalina with R 3.6.0 and is having compilation errors related to the toolchain not being found. What’s next for troubleshooting here?
Unfortunately it’s pretty hard right now to get it working with R 3.6 on Mac. It seems to require installing a bunch of packages from source (probably at least Rcpp, StanHeaders, RStan) and I’m not even sure what Makevars settings are required. @bgoodri do you know?
By far the easiest solution is to install the latest version of R (probably a good idea anyway) and use the following lines in the Makevars file:
# use file.edit(file.path(Sys.getenv("HOME"), ".R", "Makevars"))
# to edit the file and give it these contents:
CXX14FLAGS=-O3 -march=native -mtune=native
CXX14FLAGS += -arch x86_64 -ftemplate-depth-256
I meant to mention in my previous post, that if you really don’t want to upgrade to the latest R, you can use our new CmdStanR interface to run Stan from R, which I think should be fine with R 3.6.
@andrjohns Im having this issue on my windows PC. Trying to run brm( ) function in the brms package. It says Compiling Stan program... but nothing happens