MacOS CmdStan - xcode 12.2 update requires rebuild of binaries

looks like the latest Xcode release has a new version of clang - tried to compile a model and got the PCH warning:

make examples/bernoulli/bernoulli

--- Compiling, linking C++ code ---
clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes      -I stan/lib/stan_math/lib/tbb_2019_U8/include   -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.7 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include    -DBOOST_DISABLE_ASSERTS        -c -include-pch stan/src/stan/model/model_header.hpp.gch -x c++ -o examples/bernoulli/bernoulli.o examples/bernoulli/bernoulli.hpp
error: PCH file built from a different branch ((clang-1200.0.32.21)) than the compiler ((clang-1200.0.32.27))
1 error generated.
make: *** [examples/bernoulli/bernoulli] Error 1

to fix run commands make clean-all followed by make build (better yet, make -j4 build, if you’ve got the cores)

3 Likes

I couldn’t even arrive to the point where I was able to get that warning. I’m on a Mac too and getting error of all sort because of the compiler.

Any chance you can offer some support on how to get this to work?

Thanks

Submit a new post detailing your hw/sw specification and what error messages you got and I’m sure we’ll be able to help you :)

what torkar said, in particular:

  • what version of MacOS - Catalina? Big Sur?
  • is this a new Mac, or did you upgrade from previous version of the OS, if so, what what is?
  • did you ever have CmdStan installed and working?