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

errors building with clang on ubuntu 24.04 #464

Closed
gregjhogan opened this issue Oct 16, 2024 · 3 comments
Closed

errors building with clang on ubuntu 24.04 #464

gregjhogan opened this issue Oct 16, 2024 · 3 comments
Labels

Comments

@gregjhogan
Copy link

gregjhogan commented Oct 16, 2024

compiling with clang fails with errors related to enum values being out of bounds

In file included from bpl-subset/bpl_subset/libs/python/src/converter/builtin_converters.cpp:6:
In file included from bpl-subset/bpl_subset/boost/python/handle.hpp:10:
In file included from bpl-subset/bpl_subset/boost/python/cast.hpp:10:
In file included from bpl-subset/bpl_subset/boost/type_traits/same_traits.hpp:13:
In file included from bpl-subset/bpl_subset/boost/type_traits/is_same.hpp:31:
In file included from bpl-subset/bpl_subset/boost/type_traits/detail/bool_trait_def.hpp:15:
In file included from bpl-subset/bpl_subset/boost/type_traits/integral_constant.hpp:11:
In file included from bpl-subset/bpl_subset/boost/mpl/integral_c.hpp:32:
bpl-subset/bpl_subset/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum' [-Wenum-constexpr-conversion]
   73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
      |                               ^

because clang no longer allows downgrading this to a warning
https://reviews.llvm.org/D150226

which it appears was fixed in boost version 1.81
https://reviews.llvm.org/D150226#4338856

and this project seems to still be on boost version 1.52
https://github.com/inducer/bpl-subset/blob/7bf979035e33df582cadf610a6645af1f6a62661/bpl_subset/boost/version.hpp#L30

clang++ version that doesn't work

$ clang++ --version
Ubuntu clang version 18.1.3 (1ubuntu1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

g++ version that works

$ g++ --version
g++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

maybe you can force using g++ if this won't be fixed soon (I am having issues when both are installed)

@inducer
Copy link
Owner

inducer commented Oct 17, 2024

Thanks for the detailed analysis! The real solution to this will be to stop relying on a hacked-up Boost that's a pain to upgrade, see #393 for work towards that (not even that far to go). Nonetheless, in the short run, boostorg/mpl#69 points to two specific fixes:

that might make this go. Those two applied cleanly to our Boost subset, so I've pushed them. Could you give this a try and report back?

@guoriyue
Copy link

guoriyue commented Nov 4, 2024

Hi @inducer this works for me. thanks a lot!

@inducer
Copy link
Owner

inducer commented Nov 5, 2024

Thanks! A release with this is forthcoming.

@inducer inducer closed this as completed Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants