Lengthy errors on "cmdstan_model()" of cmdstanr

I have installed cmdstanr and cmdstan, following the guidance on https://mc-stan.org/cmdstanr/articles/cmdstanr.html .

  • Operating System: macOS Sequoia 15.0
  • CmdStan Version: 2.35.0
  • Compiler/Toolkit: CLI

When I try to get a model from a stan file using cmdstan_model("mymodel.stan"), I get so long errors like below.

I have totally no idea what I’m suppose to do to solve all these errors and get the stan model correctly.
Could anyone help? Thank you so much.

> df <- cmdstan_model("mymodel.stan")
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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:307:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assertion_handler:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:52:8: warning: "Libc++ only supports AppleClang 15 and later" [-W#warnings]
#      warning "Libc++ only supports AppleClang 15 and later"
       ^

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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:307:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assertion_handler:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__verbose_abort:20:1: error: expected identifier or '{'
_LIBCPP_BEGIN_NAMESPACE_STD
^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#  define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std {                                  \
                                                                                ^
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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:

In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:307:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assertion_handler:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__verbose_abort:20:1: error: C++ requires a type specifier for all declarations
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#  define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std {                                  \
                                                                                ^
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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:307:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assertion_handler:1
4:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__verbose_abort:20:1: error: expected expression
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:902:32: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
                               inline namespace _LIBCPP_ABI_NAMESPACE {
                               ^

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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:307:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assert:13:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__assertion_handler:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__verbose_abort:51:26: error: expected ';' after top level declarator
_LIBCPP_END_NAMESPACE_STD
                         ^

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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/type_traits:425:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/add_pointer.h:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/remove_reference.h:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstddef:57:1: error: expected identifier or '{'
_LIBCPP_BEGIN_NAMESPACE_STD
^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#  define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std {                                  \
                                                                                ^
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 fr
om 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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/type_traits:425:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/add_pointer.h:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/remove_reference.h:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstddef:57:1: error: C++ requires a type specifier for all declarations
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#  define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std {                                  \
                                                                                ^
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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:
19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/type_traits:425:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/add_pointer.h:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/remove_reference.h:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstddef:57:1: error: expected expression
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:902:32: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
                               inline namespace _LIBCPP_ABI_NAMESPACE {
                               ^
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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX
15.0.sdk/usr/include/c++/v1/type_traits:425:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/add_pointer.h:17:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/remove_reference.h:13:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstddef:67:26: error: expected ';' after top level declarator
_LIBCPP_END_NAMESPACE_STD
                         ^

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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/type_traits:508:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/is_trivially_copyable.h:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstdint:146:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/stdint.h:124:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/stdint.h:52:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/stdint.h:29:9: error: unknown type name 'int8_t'; did you mean 'uint8_t'?
typedef int8_t           int_least8_t;
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/_types/_uint8_t.h:31:23: note: 'uint8_t' declared here
typedef unsigned char uint8_t;
                      ^

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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/type_traits:508:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/is_trivially_copyable.h:14:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstdint:146:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/stdint.h:124:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/stdint.h:52:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/stdint.h:40:9: error: unknown type name 'int8_t'; did you mean 'uint8_t'?
typedef int8_t            int_fast8_t;
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/_types/_uint8_t.h:31:23: note: 'uint8_t' declared here
typedef unsigned char uint8_t;
                      ^

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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/type_traits:508:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/is_trivially_copyable.h:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstdint:160:1: error: expected identifier or '{'
_LIBCPP_BEGIN_NAMESPACE_STD
^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#  define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std {                                  \
                                                                                ^
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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/type_traits:508:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/is_trivially_copyable.h:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstdint:160:1: error: C++ requires a type specifier for all declarations
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:
901:81: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
#  define _LIBCPP_BEGIN_NAMESPACE_STD namespace _LIBCPP_TYPE_VISIBILITY_DEFAULT std {                                  \
                                                                                ^
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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/type_traits:508:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/is_trivially_copyable.h:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstdint:160:1: error: expected expression
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__config:902:32: note: expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'
                               inline namespace _LIBCPP_ABI_NAMESPACE {
                               ^
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 in
cluded 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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:19:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/Macros.h:679:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cmath:316:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/limits:819:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/type_traits:508:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__type_traits/is_trivially_copyable.h:14:
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/cstdint:198:26: error: expected ';' after top level declarator
_LIBCPP_END_NAMESPACE_STD
                         ^

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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/ConfigureVectorization.h:392:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/arm_neon.h:58:46: error: unknown type name 'int8_t'; did you mean 'uint8_t'?
typedef __attribute__((neon_vector_type(8))) int8_t int8x8_t;
                                             ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/_types/_uint8_t.h:31:23: note: 'uint8_t' declared here
typedef unsigned char uint8_t;
                      ^

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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/ConfigureVectorization.h:392:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/arm_neon.h:59:47: error: unknown type name 'int8_t'; did you mean 'uint8_t'?
typedef __attribute__((neon_vector_type(16))) int8_t int8x16_t;
                                              ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/_types/_uint8_t.h:31:23: note: 'uint8_t' declared here
typedef unsigned char uint8_t;
                      ^

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/stan/math/prim/fun/Eigen.hpp:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Dense:1:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/Core:22:
In file included from stan/lib/stan_math/lib/eigen_3.4.0/Eigen/src/Core/util/ConfigureVectorization.h:392:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/arm_neon.h:76:46: error: unknown type name 'float32_t'
typedef __attribute__((neon_vector_type(2))) float32_t float32x2_t;
                                             ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/arm_neon.h:77:46: error: unknown type name 'float32_t'
typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t;
                                             ^

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.5/include/arm_neon.h:6252:27: error: unknown type name 'int8_t'; did you mean 'uint8_t'?
__ai int8x16_t vdupq_n_s8(int8_t __p0) {
                          ^
/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/_types/_uint8_t.h:31:23: note: 'uint8_t' declared here
typedef unsigned char uint8_t;
                      ^

fatal error: too many errors emitted, stopping now [-ferror-limit=]

1 warning and 20 errors generated.

make: *** [src/cmdstan/main.o] Error 1

エラー: An error occured during compilation! See the message above for more information.

I’m not sure what “CLI” means—is that the command-line interface for Xcode?

Can you go into your terminal and enter this:

clang++ --version

and let us know what it returns? It looks like you’re not picking up the typedefs, which might happen with an old C++ compiler.

@stevebronder may also just know what’s up with this.

That error seems to mean that your clang++ version you are using is out of date. Are you using a conda environment?

Not the OP, but I also upgraded to Sequoia.

clang++ --version gives me:

Apple clang version 16.0.0 (clang-1600.0.26.3)
Target: arm64-apple-darwin24.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

make --version

GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

I get the errors whether I try doing it inside R with cmdstanr::cmdstan_install(overwrite = TRUE) or by cloning the cmdstan repo and using make build as in the cmdstan docs.

I’ve managed to compile Rcpp packages from source by setting up my .R/Makevars to use gcc-14 instead of Apple’s clang++, but haven’t been able to install cmdstan yet.

Here’s what my .R/Makevars looks like:

LOC = /opt/homebrew
CC = $(LOC)/bin/gcc-14 -fopenmp
CXX = $(LOC)/bin/g+±14 -fopenmp
CXX11 = $(LOC)/bin/g+±14 -fopenmp
CXX14 = $(LOC)/bin/g+±14 -fopenmp
CXX17 = $(LOC)/bin/g+±14 -fopenmp
CXX17STD = -std=gnu++17
CXX17FLAGS = -O3
MAKE = $(LOC)/opt/make

I piped the output of running make build into errors.txt which I’ve attached.
errors.txt (33.7 KB)

Can you remove and reinstall command line tools? My best guess is that apple moved around headers and libraries and so the current command line tools is confused. We run into this almost every time there is a major apple update

1 Like