RStan stopped working. So I deleted R RStudio, installed XCode anew. Installed R, RStudio, Rstan.
It all works, except compilation. For example, rstanarm works, so Stan works.
However it doesn’t compile. By trying to get a basic Stan model to compile, I get:
Error in compileCode(f, code, language = language, verbose = verbose) :
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cstring:66:5: error: <cstring> tried including <string.h> but didn't find libc++'s <string.h> header. This usually means that your header search paths are not configured properly. The header search paths should contain the C++ Standard Library headers before any C Standard Library, and you are probably using compiler flags that make that not be the case.# error <cstring> tried including <string.h> but didn't find libc++'s <string.h> header. \ ^fatal error: too many errors emitted, stopping now [-ferror-limit=]20 errors generated.make: *** [file75d10bdefef.o] Error 1
What I did:I removed Command Line Tools. I updated Sonoma to 14.1.1. I deleted completely Homebrew (this was radical and I’m not sure it was needed, but I didn’t really need Homebrew). I installed the latest regular (non-beta) Xcode. I had tried before with CLT only; that didn’t work. CLT 15.1 beta didn’t work for me. Actually all CLT didn’t work for me.
So, update sonoma to latest, update Xcode to latest.
I did my Sonoma upgrades on Mac, upgrading to 14.1.1.
I removed CLT from terminal: sudo rm -rf /Library/Developer/CommandLineTools
I installed Xcode from the Mac App Store. So here, since it’s not CLT I didn’t do anything from command line. Just literal download and install.
I’m not sure what rstan .dotR file is. I didn’t configure .R/Makevars. I’ve used Makevars in the past but now it’s empty. I’m not using it. I installed rstan the usual way with install.packages(“rstan”).
OK thanks for your help. I’m running a 2 year old intel Mac. Upgraded to Sonoma 14.1.1, removed CLT and installed a new Xcode 15.0.1. I just tried removing the makevars, and re-installing rstan. I still get the message “ERROR(s) during compilation: source code errors or compiler configuration errors!”
I did install cmdstan and cmdstanr, and this works as expected.
Now when I attempt to build/compile a stan model (in Rstudio) I get a message to “Install Build Tools”. However, the R session pukes when I try to install them.
“Error in sink(type = “output”) : invalid connection”