cmdstan: Unable to complete `make build` on Mac M1

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 a pip install prophet will build the prophet wheel appropriately. The result is a colorful log referencing a lot of seeming C++ build errors like:

image image

Along with a variety of deprecation warnings that suggest to me that there’s just something wrong with my C++ tool chain.

Reproducible Steps:

  1. git clone cmdstan --recursive
  2. make build

Current Output:

See description for some screen shots.

Expected Output:

Just a finished build.

Additional Information:

Provide any additional information here.

karsten.chu@AMB-96K7YK cmdstan % clang++ --version
Homebrew clang version 16.0.2
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm/bin
image

Current Version:

v2.32.0

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 19 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Someone helping me out in the conda-forge chat has informed me that LLVM made some changes which are likely the result of this:

libc++ 16 made some changes that prevents ADL for the real type std::complex with a custom type is undefined behavior in the C++ standard

See also https://github.com/JohnCremona/eclib/pull/74#issue-1674192628

It seems that the claim about std::complex is true, see page 926 bullet point 2: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4296.pdf

The effect of instantiating the template complex for any type other than float, double, or long double is unspecified.

Do you mind trying all the files in https://github.com/stan-dev/stanc3/tree/master/test/integration/good/code-gen/complex_numbers (after your fixes)?

If we define that many overloads it might be worth soon thinking about making our own complex template type, since future compiler versions are still free to break anything they want it seems.

Should we add an extra CI run (maybe monthly?) which uses bleeding-edge LLVM and GCC builds? We also just caught https://github.com/stan-dev/math/issues/2889

That is very similiar (if not completely identical) to the errors I’ve seeing in the conda CI