Unable to compile Bernoulli in conda-forge CmdStan 2.31 on MacOS Ventura

Hello Cmdstan community! I upgraded to MacOS Ventura recently, and (as usual) it screwed up my whole conda data science setup.

I am hoping to use Cmdstan with conda (miniforge, specfically); and I cannot compile the Bernoulli example.

My setup is the following:

  • Operating System: MacOS Ventura 13.3.1
  • CmdStan Version: 2.31 (conda-forge)
  • Compiler/Toolkit: Xcode 14.3

After getting stuck in a spagetti of installations I uninstalled as much as possible and did as fresh as possible of full installation. Here is my step-by-step procedure. I hope someone can help.

My procedure

  1. Deleted XCode Command Line Tools, Xcode, and entire conda installation (miniconda3)
  2. Restarted computer
  3. Made sure clang --version fails
  4. Installed Xcode 14.3 from App Store
  5. Opened Xcode
  6. Check clang --version:
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: x86_64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Looks good!
7. Restarted computer
8. Installed miniforge
9. Created env: conda create -n Stan232 cmdstan (success)

Conda packages:

## Package Plan ##

  environment location: /Users/thomaskeefe/miniforge3/envs/Stan233

  added / updated specs:
    - cmdstan


The following NEW packages will be INSTALLED:

  ca-certificates    conda-forge/osx-64::ca-certificates-2022.12.7-h033912b_0
  cctools_osx-64     conda-forge/osx-64::cctools_osx-64-973.0.1-hcc6d90d_13
  clang              conda-forge/osx-64::clang-14.0.6-h694c41f_0
  clang-14           conda-forge/osx-64::clang-14-14.0.6-default_h55ffa42_0
  clang_osx-64       conda-forge/osx-64::clang_osx-64-14.0.6-h3113cd8_6
  clangxx            conda-forge/osx-64::clangxx-14.0.6-default_h55ffa42_0
  clangxx_osx-64     conda-forge/osx-64::clangxx_osx-64-14.0.6-h6f97653_6
  cmdstan            conda-forge/osx-64::cmdstan-2.31.0-h21365d3_0
  compiler-rt        conda-forge/osx-64::compiler-rt-14.0.6-h613da45_0
  compiler-rt_osx-64 conda-forge/noarch::compiler-rt_osx-64-14.0.6-hab78ec2_0
  ld64_osx-64        conda-forge/osx-64::ld64_osx-64-609-hfd63004_13
  libclang-cpp14     conda-forge/osx-64::libclang-cpp14-14.0.6-default_h55ffa42_0
  libcxx             conda-forge/osx-64::libcxx-16.0.1-h71dddab_0
  libllvm14          conda-forge/osx-64::libllvm14-14.0.6-h5b596cc_1
  libzlib            conda-forge/osx-64::libzlib-1.2.13-hfd90126_4
  llvm-tools         conda-forge/osx-64::llvm-tools-14.0.6-h5b596cc_1
  make               conda-forge/osx-64::make-4.3-h22f3db7_1
  openssl            conda-forge/osx-64::openssl-3.1.0-hfd90126_0
  sigtool            conda-forge/osx-64::sigtool-0.1.3-h88f4db0_0
  tapi               conda-forge/osx-64::tapi-1100.0.11-h9ce4665_0
  tbb                conda-forge/osx-64::tbb-2021.9.0-hb8565cd_0
  tbb-devel          conda-forge/osx-64::tbb-devel-2021.9.0-hb8565cd_0

Env looks good, now we activate it and try to compile Bernoulli:

  1. conda activate Stan232
  2. Navigate to cmdstan dir: cd $CMDSTAN
  3. export CXXFLAGS="$CXXFLAGS -Wno-deprecated-declarations" (to hide some warnings)
  4. make examples/bernoulli/bernoulli

I have to post the output in 2 parts to fit the 32,000 char limit.

--- Compiling, linking C++ code ---
x86_64-apple-darwin13.4.0-clang++ -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /Users/thomaskeefe/miniforge3/envs/Stan232/include -Wno-deprecated-declarations -std=c++1y -Wno-unknown-warning-option -Wno-tautological-compare -Wno-sign-compare -D_REENTRANT -Wno-ignored-attributes      -I /Users/thomaskeefe/miniforge3/envs/Stan232/include/    -O3 -I src -I stan/src -I stan/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.78.0 -I stan/lib/stan_math/lib/sundials_6.1.1/include -I stan/lib/stan_math/lib/sundials_6.1.1/src/sundials -D_FORTIFY_SOURCE=2 -isystem /Users/thomaskeefe/miniforge3/envs/Stan232/include    -DBOOST_DISABLE_ASSERTS   -DTBB_INTERFACE_NEW  -DTBB_INTERFACE_NEW     -c  -x c++ -o examples/bernoulli/bernoulli.o examples/bernoulli/bernoulli.hpp
In file included from examples/bernoulli/bernoulli.hpp:3:
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/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:236:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:607:12: error: no matching function for call to 'isinf'
    return std::isinf(__lcpp_x);
           ^~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:598:29: note: in instantiation of function template specialization 'std::__constexpr_isinf<stan::math::var_value<double>>' requested here
        bool __z_inf = std::__constexpr_isinf(__a) || std::__constexpr_isinf(__b);
                            ^
stan/lib/stan_math/stan/math/prim/fun/asinh.hpp:64:31: note: in instantiation of function template specialization 'std::operator*<stan::math::var_value<double>>' requested here
  auto y = log(z + sqrt(1 + z * z));
                              ^
stan/lib/stan_math/stan/math/rev/fun/asinh.hpp:89:32: note: in instantiation of function template specialization 'stan::math::internal::complex_asinh<stan::math::var_value<double>>' requested here
  return stan::math::internal::complex_asinh(z);
                               ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:429:87: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT {
                                                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:433:114: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isinf(double __x) _NOEXCEPT {
                                                                                                                 ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:437:87: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(long double __x) _NOEXCEPT {
                                                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:417:80: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>]
_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1 __x) _NOEXCEPT {
                                                                               ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:424:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>]
    isinf(_A1) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:236:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:587:12: error: no matching function for call to 'isnan'
    return std::isnan(__lcpp_x);
           ^~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:601:19: note: in instantiation of function template specialization 'std::__constexpr_isnan<stan::math::var_value<double>>' requested here
            (std::__constexpr_isnan(__a) && std::__constexpr_isnan(__b))
                  ^
stan/lib/stan_math/stan/math/prim/fun/asinh.hpp:64:31: note: in instantiation of function template specialization 'std::operator*<stan::math::var_value<double>>' requested here
  auto y = log(z + sqrt(1 + z * z));
                              ^
stan/lib/stan_math/stan/math/rev/fun/asinh.hpp:89:32: note: in instantiation of function template specialization 'stan::math::internal::complex_asinh<stan::math::var_value<double>>' requested here
  return stan::math::internal::complex_asinh(z);
                               ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:455:87: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT {
                                                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:459:114: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI _LIBCPP_PREFERRED_OVERLOAD bool isnan(double __x) _NOEXCEPT {
                                                                                                                 ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:463:87: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
_LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(long double __x) _NOEXCEPT {
                                                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:445:80: note: candidate template ignored: requirement 'std::is_floating_point<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>]
_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1 __x) _NOEXCEPT {
                                                                               ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/math.h:450:80: note: candidate template ignored: requirement 'std::is_integral<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>]
_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(_A1) _NOEXCEPT {
                                                                               ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:637:19: error: no matching function for call to '__constexpr_copysign'
            __a = std::__constexpr_copysign(std::__constexpr_isinf(__a) ? _Tp(1) : _Tp(0), __a);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
stan/lib/stan_math/stan/math/prim/fun/asinh.hpp:64:31: note: in instantiation of function template specialization 'std::operator*<stan::math::var_value<double>>' requested here
  auto y = log(z + sqrt(1 + z * z));
                              ^
stan/lib/stan_math/stan/math/rev/fun/asinh.hpp:89:32: note: in instantiation of function template specialization 'stan::math::internal::complex_asinh<stan::math::var_value<double>>' requested here
  return stan::math::internal::complex_asinh(z);
                               ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^

Grateful for any help. Thank you!

Here is the second part of the output of make examples/bernoulli/bernoulli:

In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:638:19: error: no matching function for call to '__constexpr_copysign'
            __b = std::__constexpr_copysign(std::__constexpr_isinf(__b) ? _Tp(1) : _Tp(0), __b);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:640:23: error: no matching function for call to '__constexpr_copysign'
                __c = std::__constexpr_copysign(_Tp(0), __c);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:642:23: error: no matching function for call to '__constexpr_copysign'
                __d = std::__constexpr_copysign(_Tp(0), __d);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:647:19: error: no matching function for call to '__constexpr_copysign'
            __c = std::__constexpr_copysign(std::__constexpr_isinf(__c) ? _Tp(1) : _Tp(0), __c);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:648:19: error: no matching function for call to '__constexpr_copysign'
            __d = std::__constexpr_copysign(std::__constexpr_isinf(__d) ? _Tp(1) : _Tp(0), __d);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:650:23: error: no matching function for call to '__constexpr_copysign'
                __a = std::__constexpr_copysign(_Tp(0), __a);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:652:23: error: no matching function for call to '__constexpr_copysign'
                __b = std::__constexpr_copysign(_Tp(0), __b);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:659:23: error: no matching function for call to '__constexpr_copysign'
                __a = std::__constexpr_copysign(_Tp(0), __a);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:661:23: error: no matching function for call to '__constexpr_copysign'
                __b = std::__constexpr_copysign(_Tp(0), __b);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:663:23: error: no matching function for call to '__constexpr_copysign'
                __c = std::__constexpr_copysign(_Tp(0), __c);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
In file included from examples/bernoulli/bernoulli.hpp:3:
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:
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/complex:665:23: error: no matching function for call to '__constexpr_copysign'
                __d = std::__constexpr_copysign(_Tp(0), __d);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:630:54: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'float' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI float __constexpr_copysign(float __x, float __y) _NOEXCEPT {
                                                     ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:634:55: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'double' for 1st argument
_LIBCPP_CONSTEXPR inline _LIBCPP_HIDE_FROM_ABI double __constexpr_copysign(double __x, double __y) _NOEXCEPT {
                                                      ^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:639:1: note: candidate function not viable: no known conversion from 'stan::math::var_value<double>' to 'long double' for 1st argument
__constexpr_copysign(long double __x, long double __y) _NOEXCEPT {
^
/Users/thomaskeefe/miniforge3/envs/Stan232/bin/../include/c++/v1/cmath:647:5: note: candidate template ignored: requirement 'std::is_arithmetic<stan::math::var_value<double, void>>::value' was not satisfied [with _A1 = stan::math::var_value<double>, _A2 = stan::math::var_value<double>]
    __constexpr_copysign(_A1 __x, _A2 __y) _NOEXCEPT {
    ^
14 errors generated.
make: *** [make/program:58: examples/bernoulli/bernoulli] Error 1

Hi - this is a known issue with Stan and libc++ 16 (Unable to complete `make build` on Mac M1 · Issue #1158 · stan-dev/cmdstan · GitHub). We’re working on some changes which fix it.

For now, you may be able to avoid the issue by manually requesting an older version of the libcxx conda package, e.g. conda install "libcxx<16"

1 Like