Closed chukarsten closed 1 year ago
This is likely due to the homebrew toolchain. I have no issues building cmdstan on an M1 with the xcode toolchain
I’ve just run into the same issue trying to build CmdStan for conda: https://github.com/conda-forge/cmdstan-feedstock/pull/33
Using XCode is not an option here, so if we could fix this in our code it would be nice
Thanks for the quick response...I guess I am personally able to switch to the xcode toolchain. I'm not super familiar with C++ and C++ development on Mac. Any suggestions how I can switch?
@WardBrian I can't replicate locally, but the error output indicates that the culprit is this line in the asinh
function attempting to call the cmath
sqrt
instead of the Stan overload.
If you change that to:
auto y = log(z + math::sqrt(1 + z * z));
It should compile (or at least get further)
Are you sure? The error specifically calls out operator*
It looks very similar to this older issue (which never got an in-code resolution?) https://github.com/stan-dev/math/issues/1282
I'm not sure if it's helpful, but here is the full error output of my make build
````
--- Compiling the main object file. This might take up to a minute. ---
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 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.4.0 -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 -I/opt/homebrew/opt/libomp/include -DBOOST_DISABLE_ASSERTS -c -o src/cmdstan/main.o src/cmdstan/main.cpp
In file included from src/cmdstan/main.cpp:1:
In file included from src/cmdstan/command.hpp:14:
In file included from src/cmdstan/command_helper.hpp:5:
In file included from stan/src/stan/io/dump.hpp:7:
In file included from stan/lib/stan_math/stan/math/prim.hpp:14:
In file included from stan/lib/stan_math/stan/math/prim/fun.hpp:124:
In file included from stan/lib/stan_math/stan/math/prim/fun/grad_2F1.hpp:14:
In file included from stan/lib/stan_math/stan/math/prim/fun/hypergeometric_2F1.hpp:19:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/optional.hpp:15:
In file included from stan/lib/stan_math/lib/boost_1.78.0/boost/optional/optional.hpp:38:
stan/lib/stan_math/lib/boost_1.78.0/boost/type_traits/has_nothrow_constructor.hpp:27:84: warning: builtin __has_nothrow_constructor is deprecated; use __is_nothrow_constructible instead [-Wdeprecated-builtins]
template
Summary:
Running
make build
results in 38 warnings and 14 failures.Description:
On a Mac M1, I have cloned (recursively) the cmdstan repo and tried to run
make build
in order to verify that I can build it. The intent is to ensure that apip install prophet
will build the prophet wheel appropriately. The result is a colorful log referencing a lot of seeming C++ build errors like:Along with a variety of deprecation warnings that suggest to me that there's just something wrong with my C++ tool chain.
Reproducible Steps:
Current Output:
See description for some screen shots.
Expected Output:
Just a finished build.
Additional Information:
Provide any additional information here.
Current Version:
v2.32.0