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) diff --git a/Number_types/doc/Number_types/NumberTypeSupport.txt b/Number_types/doc/Number_types/NumberTypeSupport.txt index d22aee9d648..e395630a434 100644 --- a/Number_types/doc/Number_types/NumberTypeSupport.txt +++ b/Number_types/doc/Number_types/NumberTypeSupport.txt @@ -115,6 +115,19 @@ requirements. To use these classes, \gmp and \mpfr must be installed. + +\section Number_typesBoost Number Types Provided by Boost + +\anchor boostnt + +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 \anchor ledant diff --git a/Number_types/doc/Number_types/PackageDescription.txt b/Number_types/doc/Number_types/PackageDescription.txt index 84bfd6debbd..36676bd07ab 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 @@ -71,6 +74,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` 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}