Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[package] boost/1.76: Fails to build on MacOS due to compiler version restrictions #7861

Closed
rprechelt opened this issue Oct 27, 2021 · 2 comments · Fixed by #7862
Closed
Labels
bug Something isn't working

Comments

@rprechelt
Copy link

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: boost/1.7.6 (and later)
  • Operating System+version: MacOS 12.0
  • Compiler+version: Apple Clang 13.0.0
  • Conan version: conan 1.41.0
  • Python version: Python 3.9.47

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os=Macos
os_build=Macos
arch=armv8
arch_build=armv8
compiler=apple-clang
compiler.version=13.0
compiler.libcxx=libc++
build_type=Release
[options]
[conf]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

Boost.Math 1.76/1.77 fails to build on MacOS due to a compiler restriction. I get the following error message when attempting to install via Conan:

boost/1.76.0: Invalid ID: Boost.Math requires a C++11 capable compiler

However, earlier versions of boost (<=1.75) does install successfully. The issue is in the definition of _min_compiler_version_default_cxx11 here. When v1.76 was added to Conan, a line was added that requires a compiler version of 99 on apple-clang which in effect just disables building on apple-clang entirely (at least until the year ~2100) considering we are on apple-clang 13.

The motivation given in the diff here says that disabling the MacOS build on apple-clang was due to C++11 support. However, according to this, apple-clang has supported C++11 since apple-clang 10.0 (which in turn is based off clang 6 which is the minimum version used in the definition of _min_compiler_version_default_cxx11). Indeed, the official Boost release page here lists Apple Clang 9.0/10.0/11.0 as supported compilers.

I'm able to build Boost.Math from source on MacOS without Conan but this (>99) change breaks all of my Conan builds. If I manually edit the ConanFile to build with apple-clang by setting the minimum version to 10.0, and set the compiler C++ version to gnu11/gnu14/gnu17 depending upon the project conanfile, I can successfully build Boost.Math so it isn't a limitation of apple-clang.

Is there some subtle reason why changing the minimum version of apple-clang to 10 won't work (because clearly we can build boost 1.76 on apple-clang)? (cc'ing the original folks who made the change @prince-chrismc @madebr)

@rprechelt rprechelt added the bug Something isn't working label Oct 27, 2021
@rprechelt rprechelt changed the title [package] <boost>/<1.77>: Fails to build on MacOS due to compiler version restrictions [package] boost/1.76: Fails to build on MacOS due to compiler version restrictions Oct 27, 2021
@madebr
Copy link
Contributor

madebr commented Oct 28, 2021

The problem is that the default c++ standard of the apple-clang compiler is below 2011.
So you need to explicitly do -s compiler.cppstd=11.

Perhaps we need to change the error message from Boost.Math requires a C++11 capable compiler to
Boost.Math requires cppstd>=2011, current one is lower?

@rprechelt
Copy link
Author

I think that's a big step in the right direction!

Right now, I found the error confusing since I know my compiler supports C++11 - something like what you said Boost.Math requires cppstd>=2011. Set compiler.cppstd to be greater than 11. would be good (since it provides a solution to the problem for projects that aren't explicitly setting a C++ standard) but anything would be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants