CGAL 6.0.1 - Manual
|
In order to build a program using CGAL, you need a C++ compiler supporting C++17 or later. CGAL 6.0.1 is supported (continuously tested) for the following compilers/operating systems:
Operating System | Compiler |
---|---|
Linux | GNU g++ 11.4.0 or laterhttps://gcc.gnu.org/ |
Clang https://clang.llvm.org/ compiler version 15.0.7 | |
MS Windows | GNU g++ 11.4.0 or laterhttps://gcc.gnu.org/ |
MS Visual C++ 15.9, 16.10, 17.0 (Visual Studio 2017, 2019, and 2022)https://visualstudio.microsoft.com/ | |
macOS | GNU g++ 11.4.0 or laterhttps://gcc.gnu.org/ |
Apple Clang compiler versions 10.0.1, 12.0.5, and 15.0.0 |
Older versions of the above listed compilers might work, but no guarantee is provided.
Version 3.22 or later
In order to configure and build the CGAL examples, demos, or libraries, you need CMake, a cross-platform "makefile generator".
This manual explains only the features of CMake which are needed in order to use CGAL. Please refer to the CMake documentation for further details.
The focus of CGAL is on geometry, and we rely on other highly specialized libraries and software for non-geometric issues, for instance for numeric solvers or visualization. We first list software that is essential to most of CGAL, and must therefore be found during the configuration of CGAL. The page Summary of CGAL's Configuration Variables lists CMake and environment variables which can be used to specify the location of third-party software during configuration.
CGAL heavily uses the STL, and in particular adopted many of its design ideas. You can find online documentation for the STL at various web sites, for instance, https://en.cppreference.com
, or https://msdn.microsoft.com
.
The STL comes with the compiler, and as such no installation is required.
Version 1.72 or later
The Boost libraries are a set of portable C++ source libraries. Most of Boost libraries are header-only, but a few of them need to be compiled or installed as binaries.
CGAL only requires the headers of the Boost libraries, but some demos and examples depend on the binary library Boost.Program_options
.
In case the Boost libraries are not installed on your system already, you can obtain them from https://www.boost.org/
. For Visual C++ you can download precompiled libraries from https://sourceforge.net/projects/boost/files/boost-binaries/
.
As there is no canonical directory for where to find Boost on Windows, we recommend that you define the environment variable BOOST_ROOT
and set it to where you have installed Boost, e.g., C:Boost\boost_1_70_0
.
GNU Multiple Precision Arithmetic (GMP) and GNU Multiple Precision Floating-Point Reliably (MPFR) Libraries are libraries for multi precision integers and rational numbers, and for multi precision floating point numbers.
These libraries can be obtained from https://gmplib.org/
and https://www.mpfr.org/
. Since Visual C++ is not properly supported by the GMP and MPFR projects, we provide precompiled versions of GMP and MPFR, which can be downloaded from the assets of a release. Version supported are GMP Version 5.0.1 or later, MPFR Version 3.0.0 or later.
The Boost library also provides a module for multi precision integers and rational numbers: Boost multiprecision. Versions supported are Boost Version 1.72 or later.
The components CGAL, and CGAL_Qt6
require either GMP and MPFR, or Boost multiprecision for multi precision numbers. CGAL_Core
requires Boost multiprecision.
CGAL combines floating point arithmetic with exact arithmetic in order to be efficient and reliable. CGAL has a built-in number type for that, but previous alternatives are faster solutions, and we recommend using one of them.
The CMake variable CGAL_CMAKE_EXACT_NT_BACKEND
can be used to select the library that will be used internally for multi precision number types.
Optional 3rd party software can be used by CGAL for various reasons: certain optional libraries might be required to build examples and demos shipped with CGAL or to build your own project using CGAL; another reason is to speed up basic tasks where specialized libraries can be faster than the default version shipped with CGAL. The page Summary of CGAL's Configuration Variables lists CMake and environment variables which can be used to specify the location of third-party software during configuration.
Version 6.4 or later
Qt is a cross-platform application and UI framework.
The component CGAL_Qt6
is essential to run the CGAL demos and basic viewers. It requires Qt6 installed on your system. In case Qt is not yet installed on your system, you can download it from https://www.qt-project.org/
.
The exhaustive list of Qt6 components used in demos is: Core
, Gui
, Help
, OpenGL
, OpenGLWidgets
, Qml
, Svg
, Widgets
, WebSockets
, Network
, and qcollectiongenerator
(with sqlite
driver plugin).
Version 3.3.7 or later
Eigen is a C++
template library for linear algebra. Eigen supports all matrix sizes, various matrix decomposition methods and sparse linear solvers.
In CGAL, Eigen is used in many packages such as Poisson Surface Reconstruction or Estimation of Local Differential Properties of Point-Sampled Surfaces, providing sparse linear solvers and singular value decompositions. A package dependency over Eigen is marked on the Package Overview page. In order to use Eigen in CGAL programs, the executables should be linked with the CMake imported target CGAL::Eigen3_support
provided in CGAL_Eigen3_support.cmake
.
The Eigen web site is https://eigen.tuxfamily.org
.
OpenGR is a set C++ libraries for 3D Global Registration released under the terms of the APACHE V2 license.
CGAL provides wrappers for the Super4PCS algorithm of OpenGR in the Point Set Processing Reference packages. In order to use OpenGR in CGAL programs, the executables should be linked with the CMake imported target CGAL::OpenGR_support
provided in CGAL_OpenGR_support.cmake
.
The OpenGR web site is https://github.com/STORM-IRIT/OpenGR
.
libpointmatcher is a modular library implementing the Iterative Closest Point (ICP) algorithm for aligning point clouds, released under a permissive BSD license.
CGAL provides wrappers for the ICP algorithm of libpointmatcher in the Point Set Processing Reference packages. In order to use libpointmatcher in CGAL programs, the executables should be linked with the CMake imported target CGAL::pointmatcher_support
provided in CGAL_pointmatcher_support.cmake
.
The libpointmatcher web site is https://github.com/ethz-asl/libpointmatcher
.
https://github.com/ethz-asl/libpointmatcher/blob/master/doc/Compilation.md
:NABO_INCLUDE_DIR
becomes libnabo_INCLUDE_DIRS
and NABO_LIBRARY
becomes libnabo_LIBRARIES
in the "Build libpointmatcher" section.Version 6.2 or later
LEDA is a library of efficient data structures and algorithms. Like Core, LEDA offers a real number data type.
In CGAL this library is optional, and its number types can be used as an alternative to GMP, MPFR, and Core.
Free and commercial editions of LEDA are available from https://www.algorithmic-solutions.com
.
Version 1.4 or later
MPFI provides arbitrary precision interval arithmetic with intervals represented using MPFR reliable floating-point numbers. It is based on the libraries GMP and MPFR. In the setting of CGAL, this library is optional: it is used by some models of the Algebraic Kernel.
MPFI can be downloaded from https://gitlab.inria.fr/mpfi/mpfi
.
RS (Real Solutions) is devoted to the study of the real roots of polynomial systems with a finite number of complex roots (including univariate polynomials). In CGAL, RS is used by one model of the Algebraic Kernel.
RS is freely distributable for non-commercial use. You can download it from http://vegas.loria.fr/rs/
. Actually, the RS package also includes RS3, the successor of RS, which is used in conjunction with it.
The libraries RS and RS3 need MPFI, which can be downloaded from https://gitlab.inria.fr/mpfi/mpfi
.
Version 5.1 or later
NTL provides data structures and algorithms for signed, arbitrary length integers, and for vectors, matrices, and polynomials over the integers and over finite fields. The optional library NTL is used by CGAL to speed up operations of the Polynomial package, such as GCDs. It is recommended to install NTL with support from GMP.
NTL can be downloaded from https://libntl.org
.
The ESBTL (Easy Structural Biology Template Library) is a library that allows the handling of PDB data.
In CGAL, the ESBTL is used in an example of the 3D Skin Surface Meshing package.
It can be downloaded from https://esbtl.sourceforge.net/
.
TBB (Threading Building Blocks) is a library developed by Intel Corporation for writing software programs that take advantage of multi-core processors.
In CGAL, TBB is used by the packages that offer parallel code. In order to use TBB in CGAL programs, the executables should be linked with the CMake imported target CGAL::TBB_support
provided in CGAL_TBB_support.cmake
.
The TBB web site is https://github.com/oneapi-src/oneTBB
.
LASlib is a C++
library for handling LIDAR data sets stored in the LAS format (or the compressed LAZ format).
In CGAL, LASlib is used to provide input and output functions in the Point Set Processing package. In order to use LASlib in CGAL programs, the executables should be linked with the CMake imported target CGAL::LASLIB_support
provided in CGAL_LASLIB_support.cmake
.
LASlib information can be obtained from https://lastools.github.io/ and https://rapidlasso.de/product-overview/. LASlib is usually distributed along with LAStools. Current versions of LASlib provide CMake support. BUILD_SHARED_LIBS needs to be set to true on windows to create a dynamic linked library.
OpenCV (Open Computer Vision) is a library designed for computer vision, computer graphics and machine learning.
In CGAL, OpenCV is used by the Classification package. In order to use OpenCV in CGAL programs, the executables should be linked with the CMake imported target CGAL::OpenCV_support
provided in CGAL_OpenCV_support.cmake
.
The OpenCV web site is https://opencv.org/
.
Version 5.1 or later
METIS is a library developed by the Karypis Lab and designed to partition graphs and produce fill-reducing matrix orderings.
CGAL offers wrappers around some of the methods of the METIS library to allow the partitioning of graphs that are models of the concepts of the Boost Graph Library, and, by extension, of surface meshes (see Section Graph Partitioning of the package CGAL and the Boost Graph Library).
More information is available on the METIS library at http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
.
zlib is a data compression library, and is essential for the component libCGAL_ImageIO.
In CGAL, this library is used in the examples of the 3D Surface Mesh Generation package.
If it is not already on your system, for instance, on Windows, you can download it from https://www.zlib.net/
.
Ceres is an open source C++ library for modeling and solving large, complicated optimization problems.
In CGAL, Ceres is used by the Polygon Mesh Processing Reference package for mesh smoothing, which requires solving complex non-linear least squares problems.
Visit the official website of the library at ceres-solver.org
for more information.
glog
is a recommended dependency. glog
has libunwind
as a recommended dependency. On some platforms, linking with libunwind
was responsible for an increase of the runtime of the final application. If you experience such an issue, we recommend to compile Ceres without glog
support.GLPK (GNU Linear Programming Kit) is a library for solving linear programming (LP), mixed integer programming (MIP), and other related problems.
In CGAL, GLPK provides an optional linear integer program solver in the Polygonal Surface Reconstruction package. In order to use GLPK in CGAL programs, the executables should be linked with the CMake imported target CGAL::GLPK_support
provided in CGAL_GLPK_support.cmake
.
The GLPK web site is https://www.gnu.org/software/glpk/
.
SCIP (Solving Constraint Integer Programs) is currently one of the fastest open source solvers for mixed integer programming (MIP) and mixed integer nonlinear programming (MINLP).
In CGAL, SCIP provides an optional linear integer program solver in the Polygonal Surface Reconstruction package. In order to use SCIP in CGAL programs, the executables should be linked with the CMake imported target CGAL::SCIP_support
provided in CGAL_SCIP_support.cmake
.
The SCIP web site is https://www.scipopt.org/
.
OSQP (Operator Splitting Quadratic Program) is currently one of the fastest open source solvers for convex Quadratic Programs (QP).
In CGAL, OSQP provides an optional solver for the QP problems often arising in various computational geometry algorithms. In order to use OSQP in CGAL programs, the executables should be linked with the CMake imported target CGAL::OSQP_support
provided in CGAL_OSQP_support.cmake
.
The OSQP web site is https://osqp.org
.