From d8e17c22c5dcfc54eea8a26f94c4de3ed5305d0a Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Thu, 15 May 2025 10:43:34 +0200 Subject: [PATCH 1/4] Don't generate a CMake error if GMP has not been found --- Installation/cmake/modules/CGAL_SetupGMP.cmake | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Installation/cmake/modules/CGAL_SetupGMP.cmake b/Installation/cmake/modules/CGAL_SetupGMP.cmake index f4797f39e0a..f4059c9f2cf 100644 --- a/Installation/cmake/modules/CGAL_SetupGMP.cmake +++ b/Installation/cmake/modules/CGAL_SetupGMP.cmake @@ -21,9 +21,18 @@ set(CGAL_SetupGMP_included TRUE) # That is required to find the FindGMP and FindMPFR modules. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CGAL_MODULES_DIR}) -find_package(GMP REQUIRED) -find_package(MPFR REQUIRED) -find_package(GMPXX QUIET) +find_package(GMP QUIET) +find_package(MPFR QUIET) + +if (GMP_FOUND) + find_package(GMPXX QUIET) +endif() + +if(NOT GMP_FOUND OR NOT MPFR_FOUND) + message(STATUS "GMP not found.") + set(CGAL_DISABLE_GMP ON) + return() +endif() if(NOT GMPXX_FOUND) option(CGAL_WITH_GMPXX "Use CGAL with GMPXX: use C++ classes of GNU MP instead of CGAL wrappers" OFF) From 1ec16b9ac7ad74cc72e60feaa38aaa865897e332 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 22 May 2025 11:01:55 +0100 Subject: [PATCH 2/4] Add section on boodt::mp --- Number_types/doc/Number_types/NumberTypeSupport.txt | 9 +++++++++ Number_types/doc/Number_types/PackageDescription.txt | 3 +++ Number_types/include/CGAL/Exact_integer.h | 3 +-- Number_types/include/CGAL/Exact_rational.h | 3 +-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Number_types/doc/Number_types/NumberTypeSupport.txt b/Number_types/doc/Number_types/NumberTypeSupport.txt index d22aee9d648..1da205cb16b 100644 --- a/Number_types/doc/Number_types/NumberTypeSupport.txt +++ b/Number_types/doc/Number_types/NumberTypeSupport.txt @@ -115,6 +115,15 @@ requirements. To use these classes, \gmp and \mpfr must be installed. + +\section Number_typesBoost Number Types Provided by boost + +\anchor boostnt + +Boost provides an arbitrary precision integer and rational number type. +These number types can have \gmp as backend, but they can also be used +with a native backend. + \section Number_typesLEDA Number Types Provided by LEDA \anchor ledant diff --git a/Number_types/doc/Number_types/PackageDescription.txt b/Number_types/doc/Number_types/PackageDescription.txt index 84bfd6debbd..0fe0870dcf1 100644 --- a/Number_types/doc/Number_types/PackageDescription.txt +++ b/Number_types/doc/Number_types/PackageDescription.txt @@ -15,6 +15,9 @@ /// \defgroup nt_gmp GMP /// \ingroup PkgNumberTypesRef +/// \defgroup nt_boost boost multiprecision +/// \ingroup PkgNumberTypesRef + /// \defgroup nt_cgal CGAL Number Types /// \ingroup PkgNumberTypesRef diff --git a/Number_types/include/CGAL/Exact_integer.h b/Number_types/include/CGAL/Exact_integer.h index fe5d793a99c..7bc5767650d 100644 --- a/Number_types/include/CGAL/Exact_integer.h +++ b/Number_types/include/CGAL/Exact_integer.h @@ -27,8 +27,7 @@ namespace CGAL { `Exact_integer` is an exact integer number type. It is a typedef of another number type. Its exact definition depends on -the availability the third-party libraries \gmp, \core, and \leda. \cgal must -be configured with at least one of those libraries. +the availability the third-party libraries \gmp and \leda. \cgalModels{EuclideanRing,RealEmbeddable} diff --git a/Number_types/include/CGAL/Exact_rational.h b/Number_types/include/CGAL/Exact_rational.h index a80795a61dc..5fbb46dec99 100644 --- a/Number_types/include/CGAL/Exact_rational.h +++ b/Number_types/include/CGAL/Exact_rational.h @@ -27,8 +27,7 @@ namespace CGAL { `Exact_rational` is an exact rational number type, constructible from `double`. It is a typedef of another number type. Its exact definition depends on -the availability the third-party libraries \gmp, \core, and \leda. \cgal must -be configured with at least one of those libraries. +the availability the third-party libraries \gmp and \leda. \cgalModels{Field,RealEmbeddable,Fraction,FromDoubleConstructible} From d8298ae79058bfcbb28fe0148ba5288b3e140b57 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 22 May 2025 13:17:16 +0100 Subject: [PATCH 3/4] Fixes --- Number_types/doc/Number_types/NumberTypeSupport.txt | 12 ++++++++---- Number_types/doc/Number_types/PackageDescription.txt | 10 ++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Number_types/doc/Number_types/NumberTypeSupport.txt b/Number_types/doc/Number_types/NumberTypeSupport.txt index 1da205cb16b..e395630a434 100644 --- a/Number_types/doc/Number_types/NumberTypeSupport.txt +++ b/Number_types/doc/Number_types/NumberTypeSupport.txt @@ -116,13 +116,17 @@ requirements. To use these classes, \gmp and \mpfr must be installed. -\section Number_typesBoost Number Types Provided by boost +\section Number_typesBoost Number Types Provided by Boost \anchor boostnt -Boost provides an arbitrary precision integer and rational number type. -These number types can have \gmp as backend, but they can also be used -with a native backend. +Boost provides arbitrary precision integer and rational number types. +The number types `boost::multiprecision::gmp_int` and `boost::multiprecision::gmp_rational` +have \gmp as backend, while the number types `boost::multiprecision::cpp_int` +and `boost::multiprecision::cpp_rational` have a native backend. +The file CGAL/boost_mp.h provides the functions to make +these classes models of number type concepts. + \section Number_typesLEDA Number Types Provided by LEDA diff --git a/Number_types/doc/Number_types/PackageDescription.txt b/Number_types/doc/Number_types/PackageDescription.txt index 0fe0870dcf1..5c851aafb7a 100644 --- a/Number_types/doc/Number_types/PackageDescription.txt +++ b/Number_types/doc/Number_types/PackageDescription.txt @@ -9,6 +9,9 @@ /// \defgroup nt_core CORE /// \ingroup PkgNumberTypesRef +/// \defgroup nt_boost Boost +/// \ingroup PkgNumberTypesRef + /// \defgroup nt_leda LEDA /// \ingroup PkgNumberTypesRef @@ -74,6 +77,13 @@ - `leda_bigfloat` - `leda_real` +\cgalCRPSubsection{Boost} + +- `boost::multiprecision::cpp_int` +- `boost::multiprecision::cpp_rational` +- `boost::multiprecision::gmp_int` +- `boost::multiprecision::gmp_rational` + \cgalCRPSubsection{GMP} - `mpz_class` From 821514ef5bd30200ff8944a296dd77a72309bdc2 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 22 May 2025 15:51:10 +0100 Subject: [PATCH 4/4] double group definition --- Number_types/doc/Number_types/PackageDescription.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/Number_types/doc/Number_types/PackageDescription.txt b/Number_types/doc/Number_types/PackageDescription.txt index 5c851aafb7a..36676bd07ab 100644 --- a/Number_types/doc/Number_types/PackageDescription.txt +++ b/Number_types/doc/Number_types/PackageDescription.txt @@ -18,9 +18,6 @@ /// \defgroup nt_gmp GMP /// \ingroup PkgNumberTypesRef -/// \defgroup nt_boost boost multiprecision -/// \ingroup PkgNumberTypesRef - /// \defgroup nt_cgal CGAL Number Types /// \ingroup PkgNumberTypesRef