build(cgal): use CGAL_DISABLE_GMP, drop the GMP dependency#356
Merged
Conversation
The CGAL wall feature pulled in GMP: CGAL 6.0.1's bundled CORE defines CORE::BigInt as boost::multiprecision::mpz_int, which needs gmp.h. SIMPLE tried the system GMP and otherwise built it from source. Both are fragile: most HPC nodes ship libgmp.so without the -dev headers, the from-source build adds a configure/make ExternalProject to every CGAL build, and the CORE+GMP+Boost.MP combination fails to compile (CORE::BigInt undefined / mpz_int not a type). CGAL_DISABLE_GMP switches CORE to boost::multiprecision::cpp_int, which is header-only and always present with Boost. The wall feature then needs only Boost headers. Verified: stl_wall_cgal.cpp compiles cleanly with no GMP on the include path. Removes the system-GMP probe and the GMP-from-source ExternalProject.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enabling
SIMPLE_ENABLE_CGALpulled in GMP and broke the build on machineswithout GMP development headers (most HPC nodes ship
libgmp.sobut nogmp.h). CGAL 6.0.1's bundled CORE definesCORE::BigIntasboost::multiprecision::mpz_int, which requiresgmp.h. The previous CMaketried the system GMP, then fell back to building GMP 6.3.0 from source via an
ExternalProject. Both paths are fragile, and the CORE + GMP + Boost.Multiprecisioncombination fails to compile regardless (
CORE::BigInt does not name a type,mpz_int in namespace boost::multiprecision does not name a type), which iswhat kills the gfortran build whenever a stale cache leaves
SIMPLE_ENABLE_CGAL=ON.CGAL_DISABLE_GMPswitches CORE toboost::multiprecision::cpp_int, which isheader-only and always available with Boost. The wall feature then needs only
Boost headers, no GMP at all.
CGAL_DISABLE_GMPon thestl_wall_cgaltarget.ExternalProject.Verification
Before, compiling the CGAL wall TU without
gmp.hon the include path fails:After (this change adds
-DCGAL_DISABLE_GMP):g++ 12.2, CGAL 6.0.1, no GMP on the system. The wall feature builds with Boost
headers only.