Compilation issue

Hello, I have been very happy using Stan, but now, with a new computer (MacOS Big Sur Version 11.2), I am running into trouble compiling my model using Pystan. I am able to import the package in python, but once I compile the C++ code, I receive the error message ``CompileError: command ‘x86_64-apple-darwin13.4.0-clang’ failed with exit status 254’’. The entire, very long error message is below. I have tried solutions given on other forums, but none have yet worked.
Thank you very much in advance!

DIAGNOSTIC(S) FROM PARSER:
Info:
Left-hand side of sampling statement (~) may contain a non-linear transform of a parameter or local variable.
If it does, you need to include a target += statement with the log absolute determinant of the Jacobian of the transform.
Left-hand-side of sampling statement:
resid_q[i] ~ normal(…)
Info:
Left-hand side of sampling statement (~) may contain a non-linear transform of a parameter or local variable.
If it does, you need to include a target += statement with the log absolute determinant of the Jacobian of the transform.
Left-hand-side of sampling statement:
resid_theta[i] ~ normal(…)

clang-10: warning: -Wl,-export_dynamic: ‘linker’ input unused [-Wunused-command-line-argument]
In file included from /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.cpp:63:
/Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:14:2: error: “Something’s broken. UCHAR_MAX should be defined in limits.h.”
#error “Something’s broken. UCHAR_MAX should be defined in limits.h.”
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:18:2: error: “Python’s source code assumes C’s unsigned char is an 8-bit type.”
#error “Python’s source code assumes C’s unsigned char is an 8-bit type.”
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:27:5: error: “Python.h requires that stdio.h define NULL.”

error “Python.h requires that stdio.h define NULL.”

^

In file included from /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.cpp:63:
In file included from /Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:30:
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:73:64: error: use of undeclared identifier ‘strchr’
char* __libcpp_strchr(const char* __s, int __c) {return (char*)strchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:80:75: error: use of undeclared identifier ‘strpbrk’
char* __libcpp_strpbrk(const char* __s1, const char* __s2) {return (char*)strpbrk(__s1, __s2);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:87:65: error: use of undeclared identifier ‘strrchr’; did you mean ‘strchr’?
char* __libcpp_strrchr(const char* __s, int __c) {return (char*)strrchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:75:13: note: ‘strchr’ declared here
const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:94:49: error: unknown type name ‘size_t’
void* __libcpp_memchr(const void* __s, int __c, size_t __n) {return (void*)memchr(__s, __c, __n);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:96:46: error: unknown type name ‘size_t’
const void* memchr(const void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:98:46: error: unknown type name ‘size_t’
void* memchr( void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:101:74: error: use of undeclared identifier ‘strstr’; did you mean ‘strchr’?
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:77:13: note: ‘strchr’ declared here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:101:74: error: no matching function for call to ‘strchr’
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:77:13: note: candidate disabled:
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:101:81: error: cannot initialize a parameter of type 'char ’ with an lvalue of type 'const char
char
__libcpp_strstr(const char
__s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^~~~
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:77:32: note: passing argument to parameter ‘__s’ here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
In file included from /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.cpp:63:
In file included from /Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:34:
In file included from /Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/stdlib.h:100:
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:773:12: error: no member named ‘labs’ in the global namespace; did you mean ‘abs’?
return ::labs(__x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:772:39: note: ‘abs’ declared here
inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:777:12: error: no member named ‘llabs’ in the global namespace
return ::llabs(__x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:785:12: error: no member named ‘fabsf’ in the global namespace
return ::fabsf(__lcpp_x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:789:12: error: no member named ‘fabs’ in the global namespace; did you mean ‘abs’?
return ::fabs(__lcpp_x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:772:39: note: ‘abs’ declared here
inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:794:12: error: no member named ‘fabsl’ in the global namespace
return ::fabsl(__lcpp_x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:808:34: error: unknown type name ‘ldiv_t’
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:809:12: error: no member named ‘ldiv’ in the global namespace
return ::ldiv(__x, __y);
~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
Stack dump:
0. Program arguments: x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map={SRC_DIR}=/usr/local/src/conda/{PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/annalea_albright/opt/anaconda3/envs/bayesian=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/annalea_albright/opt/anaconda3/envs/bayesian/include -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/annalea_albright/opt/anaconda3/envs/bayesian/include -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I/var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk -Iopt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/src -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/eigen_3.3.3 -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0 -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/sundials_4.1.0/include -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/numpy/core/include -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8 -c /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.cpp -o /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.o -O2 -ftemplate-depth-256 -Wno-unused-function -Wno-uninitialized -std=c++1y

  1. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:169:74: current parser token ‘type’
  2. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:19:1: parsing namespace ‘boost’
  3. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:21:1: parsing namespace ‘boost::units’
  4. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:26:1: parsing namespace ‘boost::units::detail’
  5. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:163:1: parsing struct/union/class body ‘boost::units::detail::static_int_power_sign_impl<N, true>’
  6. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:166:5: parsing struct/union/class body ‘boost::units::detail::static_int_power_sign_impl<N, true>::apply’
    0 libLLVM-10.dylib 0x000000010ead5765 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
    1 libLLVM-10.dylib 0x000000010ead4668 llvm::sys::RunSignalHandlers() + 248
    2 libLLVM-10.dylib 0x000000010ead4d32 llvm::sys::CleanupOnSignal(unsigned long) + 210
    3 libLLVM-10.dylib 0x000000010ea185ad CrashRecoverySignalHandler(int) + 189
    4 libsystem_platform.dylib 0x00007fff2038ed7d _sigtramp + 29
    5 libclang-cpp.10.dylib 0x0000000108f4e62e clang::Sema::BuildDeclarationNameExpr(clang::CXXScopeSpec const&, clang::LookupResult&, bool, bool) + 670
    clang-10: error: clang frontend command failed due to signal (use -v to see invocation)
    clang version 10.0.0
    Target: x86_64-apple-darwin13.4.0
    Thread model: posix
    InstalledDir: /Users/annalea_albright/opt/anaconda3/envs/bayesian/bin
    clang-10: note: diagnostic msg: PLEASE submit a bug report to and include the crash backtrace, preprocessed source, and associated run script.
    Traceback (most recent call last):

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/unixccompiler.py”, line 117, in _compile
self.spawn(compiler_so + cc_args + [src, ‘-o’, obj] +

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/ccompiler.py”, line 910, in spawn
spawn(cmd, dry_run=self.dry_run)

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/spawn.py”, line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/spawn.py”, line 157, in _spawn_posix
raise DistutilsExecError(

DistutilsExecError: command ‘x86_64-apple-darwin13.4.0-clang’ failed with exit status 254

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/Users/annalea_albright/Dropbox/EUREC4A/Conceptual_Model/bayesian/joint_inversion_A_Cth.py”, line 215, in
sm = pystan.StanModel(file,

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/model.py”, line 378, in init
build_extension.run()

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/command/build_ext.py”, line 340, in run
self.build_extensions()

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/command/build_ext.py”, line 449, in build_extensions
self._build_extensions_serial()

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/command/build_ext.py”, line 474, in _build_extensions_serial
self.build_extension(ext)

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/command/build_ext.py”, line 528, in build_extension
objects = self.compiler.compile(sources,

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/ccompiler.py”, line 574, in compile
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)

File “/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/distutils/unixccompiler.py”, line 120, in _compile
raise CompileError(msg)

CompileError: command ‘x86_64-apple-darwin13.4.0-clang’ failed with exit status 254

DIAGNOSTIC(S) FROM PARSER:
Info:
Left-hand side of sampling statement (~) may contain a non-linear transform of a parameter or local variable.
If it does, you need to include a target += statement with the log absolute determinant of the Jacobian of the transform.
Left-hand-side of sampling statement:
resid_q[i] ~ normal(…)
Info:
Left-hand side of sampling statement (~) may contain a non-linear transform of a parameter or local variable.
If it does, you need to include a target += statement with the log absolute determinant of the Jacobian of the transform.
Left-hand-side of sampling statement:
resid_theta[i] ~ normal(…)

clang-10: warning: -Wl,-export_dynamic: ‘linker’ input unused [-Wunused-command-line-argument]
In file included from /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.cpp:63:
/Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:14:2: error: “Something’s broken. UCHAR_MAX should be defined in limits.h.”
#error “Something’s broken. UCHAR_MAX should be defined in limits.h.”
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:18:2: error: “Python’s source code assumes C’s unsigned char is an 8-bit type.”
#error “Python’s source code assumes C’s unsigned char is an 8-bit type.”
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:27:5: error: “Python.h requires that stdio.h define NULL.”

error “Python.h requires that stdio.h define NULL.”

^

In file included from /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.cpp:63:
In file included from /Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:30:
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:73:64: error: use of undeclared identifier ‘strchr’
char* __libcpp_strchr(const char* __s, int __c) {return (char*)strchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:80:75: error: use of undeclared identifier ‘strpbrk’
char* __libcpp_strpbrk(const char* __s1, const char* __s2) {return (char*)strpbrk(__s1, __s2);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:87:65: error: use of undeclared identifier ‘strrchr’; did you mean ‘strchr’?
char* __libcpp_strrchr(const char* __s, int __c) {return (char*)strrchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:75:13: note: ‘strchr’ declared here
const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:94:49: error: unknown type name ‘size_t’
void* __libcpp_memchr(const void* __s, int __c, size_t __n) {return (void*)memchr(__s, __c, __n);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:96:46: error: unknown type name ‘size_t’
const void* memchr(const void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:98:46: error: unknown type name ‘size_t’
void* memchr( void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:101:74: error: use of undeclared identifier ‘strstr’; did you mean ‘strchr’?
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:77:13: note: ‘strchr’ declared here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:101:74: error: no matching function for call to ‘strchr’
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:77:13: note: candidate disabled:
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:101:81: error: cannot initialize a parameter of type 'char ’ with an lvalue of type 'const char
char
__libcpp_strstr(const char
__s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^~~~
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/string.h:77:32: note: passing argument to parameter ‘__s’ here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
In file included from /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.cpp:63:
In file included from /Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8/Python.h:34:
In file included from /Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/stdlib.h:100:
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:773:12: error: no member named ‘labs’ in the global namespace; did you mean ‘abs’?
return ::labs(__x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:772:39: note: ‘abs’ declared here
inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:777:12: error: no member named ‘llabs’ in the global namespace
return ::llabs(__x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:785:12: error: no member named ‘fabsf’ in the global namespace
return ::fabsf(__lcpp_x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:789:12: error: no member named ‘fabs’ in the global namespace; did you mean ‘abs’?
return ::fabs(__lcpp_x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:772:39: note: ‘abs’ declared here
inline _LIBCPP_INLINE_VISIBILITY long abs(long __x) _NOEXCEPT {
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:794:12: error: no member named ‘fabsl’ in the global namespace
return ::fabsl(__lcpp_x);
~~^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:808:34: error: unknown type name ‘ldiv_t’
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {
^
/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/…/include/c++/v1/math.h:809:12: error: no member named ‘ldiv’ in the global namespace
return ::ldiv(__x, __y);
~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
Stack dump:
0. Program arguments: x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map={SRC_DIR}=/usr/local/src/conda/{PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/annalea_albright/opt/anaconda3/envs/bayesian=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/annalea_albright/opt/anaconda3/envs/bayesian/include -D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/annalea_albright/opt/anaconda3/envs/bayesian/include -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I/var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk -Iopt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/src -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/eigen_3.3.3 -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0 -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/sundials_4.1.0/include -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/numpy/core/include -I/Users/annalea_albright/opt/anaconda3/envs/bayesian/include/python3.8 -c /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.cpp -o /var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/pystan_r125f1rk/stanfit4anon_model_ca7796d6d6cd0b8fb0ccbed2777eb05e_4452662775328707948.o -O2 -ftemplate-depth-256 -Wno-unused-function -Wno-uninitialized -std=c++1y

  1. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:169:74: current parser token ‘type’
  2. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:19:1: parsing namespace ‘boost’
  3. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:21:1: parsing namespace ‘boost::units’
  4. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:26:1: parsing namespace ‘boost::units::detail’
  5. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:163:1: parsing struct/union/class body ‘boost::units::detail::static_int_power_sign_impl<N, true>’
  6. /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib/python3.8/site-packages/pystan/stan/lib/stan_math/lib/boost_1.69.0/boost/units/detail/static_rational_power.hpp:166:5: parsing struct/union/class body ‘boost::units::detail::static_int_power_sign_impl<N, true>::apply’
    0 libLLVM-10.dylib 0x000000010ead5765 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
    1 libLLVM-10.dylib 0x000000010ead4668 llvm::sys::RunSignalHandlers() + 248
    2 libLLVM-10.dylib 0x000000010ead4d32 llvm::sys::CleanupOnSignal(unsigned long) + 210
    3 libLLVM-10.dylib 0x000000010ea185ad CrashRecoverySignalHandler(int) + 189
    4 libsystem_platform.dylib 0x00007fff2038ed7d _sigtramp + 29
    5 libclang-cpp.10.dylib 0x0000000108f4e62e clang::Sema::BuildDeclarationNameExpr(clang::CXXScopeSpec const&, clang::LookupResult&, bool, bool) + 670
    clang-10: error: clang frontend command failed due to signal (use -v to see invocation)
    clang version 10.0.0
    Target: x86_64-apple-darwin13.4.0
    Thread model: posix
    InstalledDir: /Users/annalea_albright/opt/anaconda3/envs/bayesian/bin
    clang-10: note: diagnostic msg: PLEASE submit a bug report to and include the crash backtrace, preprocessed source, and associated run script.
    clang-10: note: diagnostic msg: Error generating preprocessed source(s).

There is probably some clash between system compiler and anaconda compiler.

What does these give

gcc --version
which gcc

Thank you for your response!

gcc --version gives:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1

Apple clang version 12.0.5 (clang-1205.0.22.9)

Target: arm64-apple-darwin20.3.0

Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

which gcc gives:
/usr/bin/gcc

Ok,

Have you defined CXX or CC env variables

env

Your python tries to compile with conda compiler, but is it might be missing some files.

Try to define

CC=gcc
CXX=g++

I think a problem may already be in ``env’’
I get the following message:
TMPDIR=/var/folders/8t/v51849h92dsb7qvyx0cxz_d40000gn/T/

__CFBundleIdentifier=com.apple.Terminal

XPC_FLAGS=0x0

TERM=xterm-256color

SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.LsgKOyUaBY/Listeners

XPC_SERVICE_NAME=0

TERM_PROGRAM=Apple_Terminal

TERM_PROGRAM_VERSION=440

TERM_SESSION_ID=3BE3ECDE-0625-4B64-82D4-75A8C1F66A1C

SHELL=/bin/zsh

HOME=/Users/annalea_albright

LOGNAME=annalea_albright

USER=annalea_albright

PATH=/Users/annalea_albright/opt/anaconda3/bin:/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin:/Users/annalea_albright/opt/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

SHLVL=1

PWD=/Users/annalea_albright

OLDPWD=/Users/annalea_albright

CONDA_EXE=/Users/annalea_albright/opt/anaconda3/bin/conda

_CE_M=

_CE_CONDA=

CONDA_PYTHON_EXE=/Users/annalea_albright/opt/anaconda3/bin/python

CONDA_SHLVL=2

CONDA_PREFIX=/Users/annalea_albright/opt/anaconda3/envs/bayesian

CONDA_DEFAULT_ENV=bayesian

CONDA_PROMPT_MODIFIER=(bayesian)

CONDA_PREFIX_1=/Users/annalea_albright/opt/anaconda3

CONDA_BACKUP_HOST=x86_64-apple-darwin13.4.0

HOST=x86_64-apple-darwin13.4.0

AR=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-ar

AS=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-as

CHECKSYMS=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-checksyms

CODESIGN_ALLOCATE=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-codesign_allocate

INDR=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-indr

INSTALL_NAME_TOOL=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-install_name_tool

LIBTOOL=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-libtool

LIPO=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-lipo

NM=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-nm

NMEDIT=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-nmedit

OTOOL=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-otool

PAGESTUFF=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-pagestuff

RANLIB=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-ranlib

REDO_PREBINDING=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-redo_prebinding

SEG_ADDR_TABLE=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-seg_addr_table

SEG_HACK=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-seg_hack

SEGEDIT=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-segedit

SIZE=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-size

STRINGS=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-strings

STRIP=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-strip

LD=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-ld

CLANG=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-clang

CC=gcc

CPPFLAGS=-D_FORTIFY_SOURCE=2 -mmacosx-version-min=10.9 -isystem /Users/annalea_albright/opt/anaconda3/envs/bayesian/include

CFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/annalea_albright/opt/anaconda3/envs/bayesian/include

LDFLAGS=-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib -L/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib

LDFLAGS_LD=-pie -headerpad_max_install_names -dead_strip_dylibs -rpath /Users/annalea_albright/opt/anaconda3/envs/bayesian/lib -L/Users/annalea_albright/opt/anaconda3/envs/bayesian/lib

DEBUG_CFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -Og -g -Wall -Wextra -isystem /Users/annalea_albright/opt/anaconda3/envs/bayesian/include

_CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_apple_darwin13_4_0

CMAKE_PREFIX_PATH=:/Users/annalea_albright/opt/anaconda3/envs/bayesian

CONDA_BUILD_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

CLANGXX=/Users/annalea_albright/opt/anaconda3/envs/bayesian/bin/x86_64-apple-darwin13.4.0-clang++

CXX=g++

CXXFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -isystem /Users/annalea_albright/opt/anaconda3/envs/bayesian/include

DEBUG_CXXFLAGS=-march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 -Og -g -Wall -Wextra -isystem /Users/annalea_albright/opt/anaconda3/envs/bayesian/include

PROJ_LIB=/Users/annalea_albright/opt/anaconda3/envs/bayesian/share/proj

LANG=en_US.UTF-8

_=/usr/bin/env

But I have run
env
followed by
CC=gcc
CXX=g++
then reloaded pystan, and unfortunately I still get the same error message.