I wanted to run some models making use of `cmdstanr`

but I get error messages the whole time. I checked my cdmstan installation etc and tried to compile the example of the website. This generates the following errors:

```
> check_cmdstan_toolchain()
The C++ toolchain required for CmdStan is setup properly!
> cmdstan_path()
[1] "/Users/demaeyer/.cmdstanr/cmdstan-2.28.2"
> cmdstan_version()
[1] "2.28.2"
> file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
> mod <- cmdstan_model(file)
Compiling Stan program...
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast.hpp:32:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/try_lexical_convert.hpp:44:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical.hpp:54:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical_streams.hpp:63:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/inf_nan.hpp:34:
stan/lib/stan_math/lib/boost_1.75.0/boost/math/special_functions/sign.hpp:30:22: error: reference to unresolved using declaration
return (std::signbit)(x) ? 1 : 0;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:1: note: using declaration annotated with 'using_if_exists' here
using ::signbit _LIBCPP_USING_IF_EXISTS;
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast.hpp:32:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/try_lexical_convert.hpp:44:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical.hpp:54:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical_streams.hpp:63:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/inf_nan.hpp:35:
stan/lib/stan_math/lib/boost_1.75.0/boost/math/special_functions/fpclassify.hpp:155:17: error: reference to unresolved using declaration
return (std::fpclassify)(t);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:322:1: note: using declaration annotated with 'using_if_exists' here
using ::fpclassify _LIBCPP_USING_IF_EXISTS;
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast.hpp:32:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/try_lexical_convert.hpp:44:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical.hpp:54:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/le
xical_cast/detail/converter_lexical_streams.hpp:63:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/inf_nan.hpp:35:
stan/lib/stan_math/lib/boost_1.75.0/boost/math/special_functions/fpclassify.hpp:314:22: error: reference to unresolved using declaration
return (std::isfinite)(x);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:323:1: note: using declaration annotated with 'using_if_exists' here
using ::isfinite _LIBCPP_USING_IF_EXISTS;
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast.hpp:32:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/try_lexical_convert.hpp:44:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical.hpp:54:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical_streams.hpp:63:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/inf_nan.hpp:35:
stan/lib/stan_math/lib/boost_1.75.0/boost/math/special_functions/fpclassify.hpp:385:22: error: reference to unresolved using declaration
return (std::isnormal)(x);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:326:1: note: using declaration annotated with 'using_if_exists' here
using ::isnormal _LIBCPP_USING_IF_EXISTS;
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast.hpp:32:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/try_lexical_convert.hpp:44:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical.hpp:54:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical_streams.hpp:63:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/inf_nan.hpp:35:
stan/lib/stan_math/lib/boost_1.75.0/boost/math/special_functions/fpclassify.hpp:456:22: error: reference to unresolved using declaration
return (std::isinf)(x);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:324:1: note: using declaration annotated with 'using_if_exists' here
using ::isinf _LIBCPP_USING_IF_EXISTS;
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:4:
In file included from src/cmdstan/arguments/arg_data.hpp:4:
In file included from src/cmdstan/arguments/categorical_argument.hpp:4:
In file included from src/cmdstan/arguments/argument.hpp:4:
In file included from stan/src/stan/callbacks/writer.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast.hpp:32:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/try_lexical_convert.hpp:44:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical.hpp:54:
In file included from
stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/converter_lexical_streams.hpp:63:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/lexical_cast/detail/inf_nan.hpp:35:
stan/lib/stan_math/lib/boost_1.75.0/boost/math/special_functions/fpclassify.hpp:552:22: error: reference to unresolved using declaration
return (std::isnan)(x);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:325:1: note: using declaration annotated with 'using_if_exists' here
using ::isnan _LIBCPP_USING_IF_EXISTS;
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:8:
In file included from src/cmdstan/arguments/arg_num_threads.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/err/invalid_argument.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/meta.hpp:176:
In file included from stan/lib/stan_math/stan/math/prim/meta/append_return_type.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.3.9/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.3.9/Eigen/Core:374:
stan/lib/stan_math/lib/eigen_3.3.9/Eigen/src/Core/MathFunctions.h:723:12: error: reference to unresolved using declaration
return isfinite EIGEN_NOT_A_MACRO (x);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:323:1: note: using declaration annotated with 'using_if_exists' here
using ::isfinite _LIBCPP_USING_IF_EXISTS;
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:8:
In file included from src/cmdstan/arguments/arg_num_threads.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/err/invalid_argument.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/meta.hpp:176:
In file included from stan/lib/stan_math/stan/math/prim/meta/append_return_type.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.3.9/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.3.9/Eigen/Core:374:
stan/lib/stan_math/lib/eigen_3.3.9/Eigen/src/Core/MathFunctions.h:738:12: error: reference to unresolved using declaration
return isinf EIGEN_NOT_A_MACRO (x);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:324:1: note: using declaration annotated with 'using_if_exists' here
using ::isinf _LIBCPP_USING_IF_EXISTS;
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:8:
In file included from src/cmdstan/arguments/arg_num_threads.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/err/invalid_argument.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/meta.hpp:176:
In file included from stan/lib/stan_math/stan/math/prim/meta/append_return_type.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.3.9/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.3.9/Eigen/Core:374:
stan/lib/stan_math/lib/eigen_3.3.9/Eigen/src/Core/MathFunctions.h:753:12: error: reference to unresolved using declaration
return isnan EIGEN_NOT_A_MACRO (x);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:325:1: note: using declaration annotated with 'using_if_exists' here
using ::isnan _LIBCPP_USING_IF_EXISTS;
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:29:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_divide_equal.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_division.hpp:8:
In file included from stan/lib/stan_math/stan/math/prim/fun/is_any_nan.hpp:4:
stan/lib/stan_math/stan/math/prim/fun/is_nan.hpp:20:15: error: expected unqualified-id
return std::isnan(x);
^
/usr/local/include/math.h:165:5: note: expanded from macro 'isnan'
( sizeof(x) == sizeof(float) ? __inline_isnanf((float)(x)) \
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:29:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_divide_equal.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_division.hpp:13:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_multiplication.hpp:10:
In file included from stan/lib/stan_math/stan/math/prim/fun/isinf.hpp:5:
stan/lib/stan_math/stan/math/prim/fun/is_inf.hpp:18:44: error: expected unqualified-id
inline bool is_inf(double x) { return std::isinf(x); }
^
/usr/local/include/math.h:160:5: note: expanded from macro 'isinf'
( sizeof(x) == sizeof(float) ? __inline_isinff((float)(x)) \
^
In file included from src/cmdstan/main.cpp:1:
In file included from
src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:29:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_divide_equal.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_division.hpp:13:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_multiplication.hpp:10:
stan/lib/stan_math/stan/math/prim/fun/isinf.hpp:23:13: error: expected unqualified-id
inline bool isinf(const T& v) {
^
/usr/local/include/math.h:160:7: note: expanded from macro 'isinf'
( sizeof(x) == sizeof(float) ? __inline_isinff((float)(x)) \
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:29:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_divide_equal.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_division.hpp:13:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_multiplication.hpp:10:
stan/lib/stan_math/stan/math/prim/fun/isinf.hpp:23:13: error: expected ')'
/usr/local/include/math.h:160:7: note: expanded from macro 'isinf'
( sizeof(x) == sizeof(float) ? __inline_isinff((float)(x)) \
^
stan/lib/stan_math/stan/math/prim/fun/isinf.hpp:23:13: note: to match this '('
/usr/local/include/math.h:160:5: note: expanded from macro 'isinf'
( sizeof(x) == sizeof(float) ? __inline_isinff((float)(x)) \
^
In file included from src/cmdstan/main.cpp:1:
In file
included from src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:29:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_divide_equal.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_division.hpp:13:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_multiplication.hpp:11:
stan/lib/stan_math/stan/math/prim/fun/isnan.hpp:21:13: error: expected unqualified-id
inline bool isnan(const T& x) {
^
/usr/local/include/math.h:165:7: note: expanded from macro 'isnan'
( sizeof(x) == sizeof(float) ? __inline_isnanf((float)(x)) \
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:29:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_divide_equal.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_division.hpp:13:
In file included from stan/lib/stan_math/stan/math/rev/core/operator_multiplication.hpp:11:
stan/lib/stan_math/stan/math/prim/fun/isnan.hpp:21:13: error: expected ')'
/usr/local/include/math.h:165:7: note: expanded from macro 'isnan'
( sizeof(x) == sizeof(float) ? __inline_isnanf((float)(x)) \
^
stan/lib/stan_math/stan/math/prim/fun/isnan.hpp:21:13: note: to match this '('
/usr/local/include/math.h:165:5: note: expanded from macro 'isnan'
( sizeof(x) == sizeof(float) ? __inline_isnanf((float)(x)) \
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:62:
stan/lib/stan_math/stan/math/rev/core/std_isinf.hpp:16:13: error: expected unqualified-id
inline bool isinf(const stan::math::var& a) {
^
/usr/local/include/math.h:160:7: note: expanded from macro 'isinf'
( sizeof(x) == sizeof(float) ? __inline_isinff((float)(x)) \
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:62:
stan/lib/stan_math/stan/math/rev/core/std_isinf.hpp:16:13: error: expected ')'
/usr/local/include/math.h:160:7: note: expanded from macro 'isinf'
( sizeof(x) == sizeof(float) ? __inline_isinff((float)(x)) \
^
stan/lib/stan_math/stan/math/rev/core/std_isinf.hpp:16:13: note: to match this '('
/usr/local/include/math.h:160:5: note: expanded from macro 'isinf'
( sizeof(x) == sizeof(float) ? __inline_isinff((float)(x)) \
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:63:
stan/lib/stan_math/stan/math/rev/core/std_isnan.hpp:18:13: error: expected unqualified-id
inline bool isnan(const stan::math::var& a) { return isnan(a.val()); }
^
/usr/local/include/math.h:165:7: note: expanded from macro 'isnan'
( sizeof(x) == sizeof(float) ? __inline_isnanf((float)(x)) \
^
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:21:
In file included from src/cmdstan/write_profiling.hpp:4:
In file included from stan/lib/stan_math/stan/math/rev/core/profiling.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/fun/value_of.hpp:5:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:63:
stan/lib/stan_math/stan/math/rev/core/std_isnan.hpp:18:13: error: expected ')'
/usr/local/include/math.h:165:7: note: expanded from macro 'isnan'
( sizeof(x) == sizeof(float) ? __inline_isnanf((float)(x)) \
^
stan/lib/stan_math/stan/math/rev/core/std_isnan.hpp:18:13: note: to match this '('
/usr/local/include/math.h:165:5: note: expanded from macro 'isnan'
( sizeof(x) == sizeof(float) ? __inline_isnanf((float)(x)) \
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [src/cmdstan/main.o] Error 1
Error: An error occured during compilation! See the message above for more information.
```

I’m really not so familiar with all what is going on in the background (like Xcode stuff and so on) but it used to work in the past (before updating to MacOS Monterey I guess.

- Operating System: MacOS Monterey

Can anyone help?