Dealing with Mojave



For the first time, getting rstan to work on Windows seems to be easier than getting it to work on the Mojave version Mac OS X. Mojave seems to affect different people in different ways. Here are the things I would try if rstan is not working:

  1. Make sure you have opened Xcode once via Spotlight to accept its license
  2. If that doesn’t work but you have a /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14. pkg, install that so it puts C++ headers back in /usr/include
  3. If that doesn’t work, rename / delete / empty the ~/.R/Makevars file to use Xcode’s clang++ rather than LLVM’s
  4. If that doesn’t work, recreate ~/.R/Makevars with a line that says CXX14FLAGS = -isystem ??? where ??? means the path to the C++ header files such as /usr/include

I don’t have a Mac so if anyone has any further suggestions, chime in.

Installing RStan on Mac Mohave
Stan with Mojave MacOS