I have been unable to use cmdstan due to compiler issues that are obscure to me. Today I reinstalled cmdstan through conda. (I also tried installing via cmdstanr but ran into the same issue)… The conda installation seems to work, but when I try to compile an example model it fails, complaining about missing functions (I think? see below).
I’ve tried most advice I’ve seen here and on Github, but I must be missing something. Any suggestions would be appreciated. Thanks in advance!
Other info:
 MacBook Pro with Intel processor
 Operating System: MacOS 11.6 (Big Sur)
 CmdStan Version: 2.29.2
 Compiler/Toolkit: conda

which clang
returns the conda version of clang (miniconda3/envs/stanenv/bin/clang
) 
which g++
returns/usr/bin/g++
Here’s the output when I run make examples/bernoulli/bernoulli
:
(stanenv) ~/opt/miniconda3/envs/stanenv/bin/cmdstan ᐅ make examples/bernoulli/bernoulli
 Compiling precompiled header. This might take a few seconds. 
x86_64appledarwin13.4.0clang++ march=core2 mtune=haswell mssse3 ftreevectorize fPIC fPIE fstackprotectorstrong O2 pipe stdlib=libc++ fvisibilityinlineshidden std=c++14 fmessagelength=0 isystem /Users/wpmarble/opt/miniconda3/envs/stanenv/include std=c++1y Wnounknownwarningoption Wnotautologicalcompare Wnosigncompare D_REENTRANT Wnoignoredattributes I /Users/wpmarble/opt/miniconda3/envs/stanenv/include/ O3 I src I stan/src I lib/rapidjson_1.1.0/ I lib/CLI111.9.1/ I stan/lib/stan_math/ I stan/lib/stan_math/lib/eigen_3.3.9 I stan/lib/stan_math/lib/boost_1.75.0 I stan/lib/stan_math/lib/sundials_6.0.0/include I stan/lib/stan_math/lib/sundials_6.0.0/src/sundials D_FORTIFY_SOURCE=2 isystem /Users/wpmarble/opt/miniconda3/envs/stanenv/include DBOOST_DISABLE_ASSERTS DTBB_INTERFACE_NEW DTBB_INTERFACE_NEW c stan/src/stan/model/model_header.hpp o stan/src/stan/model/model_header.hpp.gch
In file included from stan/src/stan/model/model_header.hpp:4:
In file included from stan/lib/stan_math/stan/math.hpp:19:
In file included from stan/lib/stan_math/stan/math/rev.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:96:
In file included from /Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/complex:235:
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
using ::signbit _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite _LIBCPP_USING_IF_EXISTS;
~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h:752:12: note: 'finite' declared here
extern int finite(double)
^
In file included from stan/src/stan/model/model_header.hpp:4:
In file included from stan/lib/stan_math/stan/math.hpp:19:
In file included from stan/lib/stan_math/stan/math/rev.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:96:
In file included from /Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/complex:235:
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace
using ::isnan _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:327:9: error: no member named 'isgreater' in the global namespace
using ::isgreater _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:328:9: error: no member named 'isgreaterequal' in the global namespace
using ::isgreaterequal _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered _LIBCPP_USING_IF_EXISTS;
~~^
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered _LIBCPP_USING_IF_EXISTS;
~~^
In file included from stan/src/stan/model/model_header.hpp:4:
In file included from stan/lib/stan_math/stan/math.hpp:19:
In file included from stan/lib/stan_math/stan/math/rev.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:722:16: error: no member named 'isfinite' in namespace 'std'; did you mean 'finite'?
using std::isfinite;
~~~~~^~~~~~~~
finite
/Users/wpmarble/opt/miniconda3/envs/stanenv/bin/../include/c++/v1/cmath:323:9: note: 'finite' declared here
using ::isfinite _LIBCPP_USING_IF_EXISTS;
^
In file included from stan/src/stan/model/model_header.hpp:4:
In file included from stan/lib/stan_math/stan/math.hpp:19:
In file included from stan/lib/stan_math/stan/math/rev.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:737:16: error: no member named 'isinf' in namespace 'std'
using std::isinf;
~~~~~^
stan/lib/stan_math/lib/eigen_3.3.9/Eigen/src/Core/MathFunctions.h:752:16: error: no member named 'isnan' in namespace 'std'
using std::isnan;
~~~~~^
In file included from stan/src/stan/model/model_header.hpp:4:
In file included from stan/lib/stan_math/stan/math.hpp:19:
In file included from stan/lib/stan_math/stan/math/rev.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:10:
In file included from stan/lib/stan_math/stan/math/rev/core/chainable_object.hpp:6:
In file included from stan/lib/stan_math/stan/math/rev/core/typedefs.hpp:7:
In file included from stan/lib/stan_math/stan/math/rev/core/Eigen_NumTraits.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim/core.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:6:
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:17: error: no member named 'signbit' in namespace 'std'; did you mean simply 'signbit'?
return (std::signbit)(x) ? 1 : 0;
^~~~~~~~~~~~
signbit
stan/lib/stan_math/lib/boost_1.75.0/boost/math/special_functions/math_fwd.hpp:891:8: note: 'signbit' declared here
int signbit BOOST_NO_MACRO_EXPAND(T x);
^
In file included from stan/src/stan/model/model_header.hpp:4:
In file included from stan/lib/stan_math/stan/math.hpp:19:
In file included from stan/lib/stan_math/stan/math/rev.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:10:
In file included from stan/lib/stan_math/stan/math/rev/core/chainable_object.hpp:6:
In file included from stan/lib/stan_math/stan/math/rev/core/typedefs.hpp:7:
In file included from stan/lib/stan_math/stan/math/rev/core/Eigen_NumTraits.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim/core.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:6:
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:12: error: no member named 'fpclassify' in namespace 'std'; did you mean simply 'fpclassify'?
return (std::fpclassify)(t);
^~~~~~~~~~~~~~~
fpclassify
stan/lib/stan_math/lib/boost_1.75.0/boost/math/special_functions/math_fwd.hpp:876:8: note: 'fpclassify' declared here
int fpclassify BOOST_NO_MACRO_EXPAND(T t);
^
In file included from stan/src/stan/model/model_header.hpp:4:
In file included from stan/lib/stan_math/stan/math.hpp:19:
In file included from stan/lib/stan_math/stan/math/rev.hpp:8:
In file included from stan/lib/stan_math/stan/math/rev/core.hpp:10:
In file included from stan/lib/stan_math/stan/math/rev/core/chainable_object.hpp:6:
In file included from stan/lib/stan_math/stan/math/rev/core/typedefs.hpp:7:
In file included from stan/lib/stan_math/stan/math/rev/core/Eigen_NumTraits.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim/core.hpp:4:
In file included from stan/lib/stan_math/stan/math/prim/core/init_threadpool_tbb.hpp:6:
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:314:17: error: no member named 'isfinite' in namespace 'std'; did you mean simply 'isfinite'?
return (std::isfinite)(x);
^~~~~~~~~~~~~
isfinite
stan/lib/stan_math/lib/boost_1.75.0/boost/math/special_functions/math_fwd.hpp:879:9: note: 'isfinite' declared here
bool isfinite BOOST_NO_MACRO_EXPAND(T z);
^
fatal error: too many errors emitted, stopping now [ferrorlimit=]
20 errors generated.
make: *** [make/program:27: stan/src/stan/model/model_header.hpp.gch] Error 1