Upgrade to MacOS Big Sur - CmdStan and CmdStanPy notes

I upgraded from High Sierra to Big Sur, this meant that I hit some XCode changes.
These were solved via the following two commands:

xcode-select --install
sudo xcode-select -switch /Library/Developer/CommandLineTools

(perhaps the xcode-select -switch isn’t necessary when upgrading from Catalina)

Then I went to my existing install of the GitHub CmdStan repo, which had existing CmdStan binaries and header files and tried to compile a model.
This failed because the PCH header file was out of date, so I did:

make clean-all; make -j4 build

Then I fired up Python and tried to do the same via CmdStanPy - all good!

As CmdStanPy doesn’t yet have a “rebuild CmdStan” utility, options are to
rebuild existing CmdStan install from the command line, per above commands,
or to run the install_cmdstan function with argument overwrite=True.

6 Likes

XCode is ok, I just upgraded from Catalina. PCH files were not. After cleanup and rebuild like above I was able to compile and run cmdstan through CmdStanR.

2 Likes

I tried to follow the same steps but the install_cmdstan script never terminates (with cmdstanpy 0.9.68).
With the --verbose option, it is stuck at (probably waiting for something, not consuming any CPU):

make[1]: Entering directory '.../.cmdstan/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb'

However, I was able to reinstall cmdstan directly from source and run models with cmdstanpy.
The only thing I add to do was to comment out the following line in make/stanc.

xattr -d com.apple.quarantine bin/stanc

thanks - will investigate the xattr call - it was necessary to add this for Catalina. guess things have changed again.