# Trouble with installing cmdstan on Mac OS X - Big Sur

**URL:** <https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308>\
**Category:** Interfaces\
**Tags:** installation\
**Created:** [May 4, 2021, 8:59pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308 "2021-05-04T20:59:31Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![defjaf](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/defjaf/32/413_2.png) [@defjaf](https://discourse.mc-stan.org/u/defjaf)\
**Post date:** [May 7, 2021, 8:12am UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/21 "2021-05-07T08:12:59Z")

</div>

I don’t have an M1, so take this with a grain of salt, but a couple of points:

- You can and probably should use the Apple-supplied clang, not the homebrew/llvm version.

- After an upgrade, you usually have to upgrade to the latest version of the Xcode command-line tools, either by launching Xcode and/or running `xcode-select --install`.

---

<div class="post-metadata">

**Author:** ![kgoldfeld](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/kgoldfeld/32/6833_2.png) [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Post date:** [May 7, 2021, 1:50pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/22 "2021-05-07T13:50:44Z")

</div>

Thanks for the suggestion. Unfortunately, that is exactly what I have done and still not working. -I removed homebrew entirely and reinstalled Xcode and the latest version of the command-line tools. And this is my $PATH setting:

```
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/Applications/RStudio.app/Contents/MacOS/postback

```

And this is the clang version:

```
clang++ --version

Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin20.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

```

But, still no luck.

---

<div class="post-metadata">

**Author:** ![stevebronder](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/stevebronder/32/17242_2.png) [@stevebronder](https://discourse.mc-stan.org/u/stevebronder)\
**Post date:** [May 7, 2021, 3:44pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/23 "2021-05-07T15:44:59Z")

</div>

Can you run the following just to check whether this is an issue with cmdstan or cmdstanr?

```
git clone --recursive https://github.com/stan-dev/cmdstan
cd cmdstan
make build
make examples/bernoulli/bernoulli

```

This seems to be a pretty common problem for macs across C++ projects. the stackoverflow post below may also be helpful (though be careful with copy pasting some of the code in the answers as that is messing with some stuff in the system. The second answer to check for CPATH in `.bashrc` could be a culprit)

> <https://stackoverflow.com/questions/58628377/catalina-c-using-cmath-headers-yield-error-no-member-named-signbit-in-th>

---

<div class="post-metadata">

**Author:** ![kgoldfeld](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/kgoldfeld/32/6833_2.png) [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Post date:** [May 7, 2021, 3:50pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/24 "2021-05-07T15:50:58Z")

</div>

Here’s the error message I get after `make build`:

```
curl -L https://github.com/stan-dev/stanc3/releases/download/nightly/mac-stanc -o bin/stanc --retry 5 --retry-delay 10
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 617 100 617 0 0 2134 0 --:--:-- --:--:-- --:--:-- 2127
100 10.6M 100 10.6M 0 0 10.5M 0 0:00:01 0:00:01 --:--:-- 10.5M
chmod +x bin/stanc
clang++ -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.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_5.7.0/include -DBOOST_DISABLE_ASSERTS -c -fvisibility=hidden -o bin/cmdstan/stansummary.o src/cmdstan/stansummary.cpp
In file included from src/cmdstan/stansummary.cpp:1:
In file included from src/cmdstan/stansummary_helper.hpp:4:
In file included from stan/src/stan/mcmc/chains.hpp:4:
In file included from stan/src/stan/io/stan_csv_reader.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string.hpp:23:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/split.hpp:16:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/iter_find.hpp:27:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/find_iterator.hpp:24:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/detail/find_iterator.hpp:18:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function/detail/prologue.hpp:17:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function/function_base.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/type_index.hpp:29:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/type_index/stl_type_index.hpp:47:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/hash.hpp:22:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/detail/hash_float.hpp:14:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/detail/float_functions.hpp:14:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/config/no_tr1/cmath.hpp:21:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace
using ::isfinite;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:324:9: error: no member named 'isinf' in the global namespace
using ::isinf;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:325:9: error: no member named 'isnan' in the global namespace
using ::isnan;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:326:9: error: no member named 'isnormal' in the global namespace
using ::isnormal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:327:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
using ::isgreater;
      ^~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:738:29: note: '::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
                            ^
In file included from src/cmdstan/stansummary.cpp:1:
In file included from src/cmdstan/stansummary_helper.hpp:4:
In file included from stan/src/stan/mcmc/chains.hpp:4:
In file included from stan/src/stan/io/stan_csv_reader.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string.hpp:23:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/split.hpp:16:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/iter_find.hpp:27:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/find_iterator.hpp:24:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/detail/find_iterator.hpp:18:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function/detail/prologue.hpp:17:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function/function_base.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/type_index.hpp:29:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/type_index/stl_type_index.hpp:47:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/hash.hpp:22:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/detail/hash_float.hpp:14:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/detail/float_functions.hpp:14:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/config/no_tr1/cmath.hpp:21:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:328:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
using ::isgreaterequal;
      ^~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/functional:767:29: note: '::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
                            ^
In file included from src/cmdstan/stansummary.cpp:1:
In file included from src/cmdstan/stansummary_helper.hpp:4:
In file included from stan/src/stan/mcmc/chains.hpp:4:
In file included from stan/src/stan/io/stan_csv_reader.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string.hpp:23:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/split.hpp:16:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/iter_find.hpp:27:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/find_iterator.hpp:24:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/detail/find_iterator.hpp:18:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function/detail/prologue.hpp:17:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function/function_base.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/type_index.hpp:29:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/type_index/stl_type_index.hpp:47:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/hash.hpp:22:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/detail/hash_float.hpp:14:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/detail/float_functions.hpp:14:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/config/no_tr1/cmath.hpp:21:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:329:7: error: no member named 'isless' in the global namespace; did you mean 'boost::is_less'?
using ::isless;
      ^~
stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/compare.hpp:191:22: note: 'boost::is_less' declared here
    using algorithm::is_less;
                     ^
In file included from src/cmdstan/stansummary.cpp:1:
In file included from src/cmdstan/stansummary_helper.hpp:4:
In file included from stan/src/stan/mcmc/chains.hpp:4:
In file included from stan/src/stan/io/stan_csv_reader.hpp:4:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string.hpp:23:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/split.hpp:16:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/iter_find.hpp:27:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/find_iterator.hpp:24:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/algorithm/string/detail/find_iterator.hpp:18:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function.hpp:30:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function/detail/prologue.hpp:17:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/function/function_base.hpp:21:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/type_index.hpp:29:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/type_index/stl_type_index.hpp:47:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/hash.hpp:22:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/detail/hash_float.hpp:14:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/container_hash/detail/float_functions.hpp:14:
In file included from stan/lib/stan_math/lib/boost_1.75.0/boost/config/no_tr1/cmath.hpp:21:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
In file included from src/cmdstan/stansummary.cpp:1:
In file included from src/cmdstan/stansummary_helper.hpp:4:
In file included from stan/src/stan/mcmc/chains.hpp:4:
In file included from stan/src/stan/io/stan_csv_reader.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim.hpp:10:
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: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:722:16: error: no member named 'isfinite' in namespace 'std'
    using std::isfinite;
          ~~~~~ ^
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 src/cmdstan/stansummary.cpp:1:
In file included from src/cmdstan/stansummary_helper.hpp:4:
In file included from stan/src/stan/mcmc/chains.hpp:4:
In file included from stan/src/stan/io/stan_csv_reader.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim.hpp:10:
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 src/cmdstan/stansummary.cpp:1:
In file included from src/cmdstan/stansummary_helper.hpp:4:
In file included from stan/src/stan/mcmc/chains.hpp:4:
In file included from stan/src/stan/io/stan_csv_reader.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim.hpp:10:
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 src/cmdstan/stansummary.cpp:1:
In file included from src/cmdstan/stansummary_helper.hpp:4:
In file included from stan/src/stan/mcmc/chains.hpp:4:
In file included from stan/src/stan/io/stan_csv_reader.hpp:5:
In file included from stan/lib/stan_math/stan/math/prim.hpp:10:
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 [-ferror-limit=]
20 errors generated.
make: *** [bin/cmdstan/stansummary.o] Error 1

```

---

<div class="post-metadata">

**Author:** ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)\
**Post date:** [May 7, 2021, 4:35pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/25 "2021-05-07T16:35:26Z")

</div>

here’s a report of a similar problem: [http://mac-os-forge.2317878.n4.nabble.com/62770-clang-11-broken-by-MacOS-11-3-update-td417563.html#a417565](http://mac-os-forge.2317878.n4.nabble.com/62770-clang-11-broken-by-MacOS-11-3-update-td417563.html#a417565)

they say:

> The update to MacOS 11.3 and Xcode 12.5, with Command Line Tools, broke  
> clang++ 11: It can not find system headers such as wchar.h, it seems.  
> Unclear with workarounds. Curiously, g++ 10 works.

---

<div class="post-metadata">

**Author:** ![kgoldfeld](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/kgoldfeld/32/6833_2.png) [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Post date:** [May 7, 2021, 4:39pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/26 "2021-05-07T16:39:06Z")

</div>

Well - I guess there’s comfort in company. And I guess no Stan for me until someone finds a solution or fixes it.

---

<div class="post-metadata">

**Author:** ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)\
**Post date:** [May 7, 2021, 4:55pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/27 "2021-05-07T16:55:57Z")

</div>

sorry you had to be a canary in a coal mine.

dockerized CmdStan?  
found this one - [GitHub - tpapp/cmdstan-docker: Docker container with CmdStan installed.](https://github.com/tpapp/cmdstan-docker)

---

<div class="post-metadata">

**Author:** ![kgoldfeld](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/kgoldfeld/32/6833_2.png) [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Post date:** [May 7, 2021, 4:58pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/28 "2021-05-07T16:58:46Z")

</div>

I’ll check that out - but I do have my old computer (I suspected there might be problems, so I held onto that, just in case). My guess this is kind of a big deal, so they should have a fix for this soon, right? Thanks for all of your efforts.

---

<div class="post-metadata">

**Author:** ![stevebronder](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/stevebronder/32/17242_2.png) [@stevebronder](https://discourse.mc-stan.org/u/stevebronder)\
**Post date:** [May 7, 2021, 5:18pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/29 "2021-05-07T17:18:49Z")

</div>

Did you check out the two answers in the stackoverflow post above? It looks like it’s a weird thing that can be caused by something in your .bashrc or bad linking by Apple in the includes file.

Sorry I can’t be more help here as I don’t own a Mac 😑 but if you search for those error messages on stackoverflow it seems like a good few Qs come up related. My guess is that this will effect any R packages with C inside of them that use the cmath header

---

<div class="post-metadata">

**Author:** ![kgoldfeld](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/kgoldfeld/32/6833_2.png) [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Post date:** [May 7, 2021, 5:23pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/30 "2021-05-07T17:23:48Z")

</div>

I did see that, but I do not believe there is a .bashrc file anymore, only a .zshrc file, which currently only sets my $PATH. And mucking around with linking in includes files is above my pay grade.

---

<div class="post-metadata">

**Author:** ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)\
**Post date:** [May 8, 2021, 5:33pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/31 "2021-05-08T17:33:51Z")

</div>

someone posted this in the slack for Aki’s online BDA class:

![58lnl7](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/e/eae9934f1f205136e5fb45e3a971b981627bb7fb.jpeg)

---

<div class="post-metadata">

**Author:** ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)\
**Post date:** [May 8, 2021, 5:42pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/32 "2021-05-08T17:42:35Z")

</div>

working hypothesis is the latest version of Big Sur has new version of clang++ compiler and SDK, correct?

you can get old versions by registering with the Apple developer site, and then going to this page: [https://developer.apple.com/download/more/?=xcode](https://developer.apple.com/download/more/?=xcode)

 ![Untitled](https://canada1.discourse-cdn.com/flex030/uploads/mc_stan/original/2X/5/5fb4e30b96cb036ff7313725ca7ea12f61ec8e37.jpeg)

here’s the link to the dmg for an older version of Xcode command line tools - [https://download.developer.apple.com/Developer\_Tools/Command\_Line\_Tools\_for\_Xcode\_12.4/Command\_Line\_Tools\_for\_Xcode\_12.4.dmg](https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_12.4/Command_Line_Tools_for_Xcode_12.4.dmg)

---

<div class="post-metadata">

**Author:** ![kgoldfeld](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/kgoldfeld/32/6833_2.png) [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Post date:** [May 8, 2021, 7:44pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/33 "2021-05-08T19:44:09Z")

</div>

Not sure if it is an Xcode problem or Big Sur 11.3 problem. I just installed Xcode 12.4 and CLT 12.4 - and still getting the same error messages.

---

<div class="post-metadata">

**Author:** ![mitzimorris](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mitzimorris/32/29_2.png) [@mitzimorris](https://discourse.mc-stan.org/u/mitzimorris)\
**Post date:** [May 8, 2021, 7:53pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/34 "2021-05-08T19:53:22Z")

</div>

where is the compiler looking here for the std c++ library headers - this path -

> `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/`

is this the 12.4 SDK?

what does `clang -v` say w/r/t version?

---

<div class="post-metadata">

**Author:** ![kgoldfeld](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/kgoldfeld/32/6833_2.png) [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Post date:** [May 8, 2021, 8:30pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/35 "2021-05-08T20:30:17Z")

</div>

I assume it is the 12.4 SDK since I just installed it after completely removing 12.5. Here is my `clang -v`:

```
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: arm64-apple-darwin20.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

```

The one answer I don’t know is where the compiler is looking - how can I determine that? This is my current path:

```
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/opt/homebrew/bin

```

---

<div class="post-metadata">

**Author:** ![kgoldfeld](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/kgoldfeld/32/6833_2.png) [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Post date:** [May 8, 2021, 9:47pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/36 "2021-05-08T21:47:19Z")

</div>

I confirmed with `xcode-select -p` that the compiler is looking in `/Applications/Xcode.app/Contents/Developer`

I also switched it to `/Library/Developer/CommandLineTools` but generates the same errors.

---

<div class="post-metadata">

**Author:** ![kgoldfeld](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/kgoldfeld/32/6833_2.png) [@kgoldfeld](https://discourse.mc-stan.org/u/kgoldfeld)\
**Post date:** [May 13, 2021, 9:10pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/37 "2021-05-13T21:10:45Z")

</div>

I have finally had success. I found a solution [here](https://github.com/stan-dev/rstan/issues/904), on the rstan development site no less.

Essentially the solution that worked for me was to install Xcode (I installed the latest version 12.5), but **without** separately installing the CommandLineTools using `xcode-select --install`. Again, I did not install CommandLineTools using `xcode-select --install`. Apparently, the Xcode installation includes an installation of the tools in `/Applications/Xcode.app/Contents/Developer`. I don’t think I needed to this, but to be safe I made sure the path was set to this directory by executing `sudo xcode-select --switch /Applications/Xcode.app`.

After that, within Rstudio I installed `cmdstan` with `cmdstanr::install_cmdstan()`. And I was able to compile my test stan code and estimate a model.

Thank you for all of your efforts to help out. I hope that others find this useful if they run into the same problem.

---

<div class="post-metadata">

**Author:** ![jonah](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jonah/32/200_2.png) [@jonah](https://discourse.mc-stan.org/u/jonah)\
**Post date:** [May 13, 2021, 10:33pm UTC](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308/38 "2021-05-13T22:33:59Z")

</div>

Really glad that it’s working now. Thanks for your patience!

[Previous page](https://discourse.mc-stan.org/t/trouble-with-installing-cmdstan-on-mac-os-x-big-sur/22308.md?page=1)
