Skip to content

Commit b8d043f

Browse files
authored
Installation: Don't insist on providing GMP (#8893)
## Summary of Changes Removed error when GMP is not found. ## Release Management * Affected package(s): Installation * Issues: fix #8852
2 parents 9d1f4c9 + 821514e commit b8d043f

File tree

5 files changed

+37
-7
lines changed

5 files changed

+37
-7
lines changed

Installation/cmake/modules/CGAL_SetupGMP.cmake

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ set(CGAL_SetupGMP_included TRUE)
2121
# That is required to find the FindGMP and FindMPFR modules.
2222
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CGAL_MODULES_DIR})
2323

24-
find_package(GMP REQUIRED)
25-
find_package(MPFR REQUIRED)
26-
find_package(GMPXX QUIET)
24+
find_package(GMP QUIET)
25+
find_package(MPFR QUIET)
26+
27+
if (GMP_FOUND)
28+
find_package(GMPXX QUIET)
29+
endif()
30+
31+
if(NOT GMP_FOUND OR NOT MPFR_FOUND)
32+
message(STATUS "GMP not found.")
33+
set(CGAL_DISABLE_GMP ON)
34+
return()
35+
endif()
2736

2837
if(NOT GMPXX_FOUND)
2938
option(CGAL_WITH_GMPXX "Use CGAL with GMPXX: use C++ classes of GNU MP instead of CGAL wrappers" OFF)

Number_types/doc/Number_types/NumberTypeSupport.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ requirements.
115115

116116
To use these classes, \gmp and \mpfr must be installed.
117117

118+
119+
\section Number_typesBoost Number Types Provided by Boost
120+
121+
\anchor boostnt
122+
123+
Boost provides arbitrary precision integer and rational number types.
124+
The number types `boost::multiprecision::gmp_int` and `boost::multiprecision::gmp_rational`
125+
have \gmp as backend, while the number types `boost::multiprecision::cpp_int`
126+
and `boost::multiprecision::cpp_rational` have a native backend.
127+
The file <TT>CGAL/boost_mp.h</TT> provides the functions to make
128+
these classes models of number type concepts.
129+
130+
118131
\section Number_typesLEDA Number Types Provided by LEDA
119132

120133
\anchor ledant

Number_types/doc/Number_types/PackageDescription.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
/// \defgroup nt_core CORE
1010
/// \ingroup PkgNumberTypesRef
1111

12+
/// \defgroup nt_boost Boost
13+
/// \ingroup PkgNumberTypesRef
14+
1215
/// \defgroup nt_leda LEDA
1316
/// \ingroup PkgNumberTypesRef
1417

@@ -71,6 +74,13 @@
7174
- `leda_bigfloat`
7275
- `leda_real`
7376

77+
\cgalCRPSubsection{Boost}
78+
79+
- `boost::multiprecision::cpp_int`
80+
- `boost::multiprecision::cpp_rational`
81+
- `boost::multiprecision::gmp_int`
82+
- `boost::multiprecision::gmp_rational`
83+
7484
\cgalCRPSubsection{GMP}
7585

7686
- `mpz_class`

Number_types/include/CGAL/Exact_integer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ namespace CGAL {
2727
`Exact_integer` is an exact integer number type.
2828
2929
It is a typedef of another number type. Its exact definition depends on
30-
the availability the third-party libraries \gmp, \core, and \leda. \cgal must
31-
be configured with at least one of those libraries.
30+
the availability the third-party libraries \gmp and \leda.
3231
3332
\cgalModels{EuclideanRing,RealEmbeddable}
3433

Number_types/include/CGAL/Exact_rational.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ namespace CGAL {
2727
`Exact_rational` is an exact rational number type, constructible from `double`.
2828
2929
It is a typedef of another number type. Its exact definition depends on
30-
the availability the third-party libraries \gmp, \core, and \leda. \cgal must
31-
be configured with at least one of those libraries.
30+
the availability the third-party libraries \gmp and \leda.
3231
3332
\cgalModels{Field,RealEmbeddable,Fraction,FromDoubleConstructible}
3433

0 commit comments

Comments
 (0)