CGAL 5.1.3  Manual

In order to build a program using CGAL, you need a C++ compiler supporting C++14 or later. CGAL 5.1.3 is supported (continuously tested) for the following compilers/operating systems:
Operating System  Compiler 

Linux  Gnu g++ 6.3 or laterhttp://gcc.gnu.org/ 
Clang http://clang.llvm.org/ compiler version 8.0.0  
MS Windows  Gnu g++ 6.3 or laterhttp://gcc.gnu.org/ 
MS Visual C++ 14.0, 15.9, 16.0 (Visual Studio 2015, 2017, and 2019)https://visualstudio.microsoft.com/  
MacOS X  Gnu g++ 6.3 or laterhttp://gcc.gnu.org/ 
Apple Clang compiler versions 7.0.2 and 10.0.1 
Older versions of the above listed compilers might work, but no guarantee is provided.
Version 3.1 or later
In order to configure and build the CGAL examples, demos, or libraries, you need CMake, a crossplatform "makefile generator".
This manual explains only the features of CMake which are needed in order to build 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 nongeometric 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 thirdparty 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.66 or later
The Boost libraries are a set of portable C++ source libraries. Most of Boost libraries are headeronly, 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/boostbinaries/
.
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_69_0
.
GMP Version 4.2 or later, MPFR Version 2.2.1 or later
The components libCGAL
, libCGAL_Core
, and libCGAL_Qt5
require Gmp and Mpfr which are libraries for multi precision integers and rational numbers, and for multi precision floating point numbers.
CGAL combines floating point arithmetic with exact arithmetic in order to be efficient and reliable. CGAL has a builtin number type for that, but Gmp and Mpfr provide a faster solution, and we recommend to use them.
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 with the installer CGAL5.1.3
Setup.exe
.
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 thirdparty software during configuration.
Version 5.9.0 or later
Qt is a crossplatform application and UI framework.
The component libCGAL_Qt5 is essential to run the CGAL demos and basic viewers. It requires Qt5 installed on your system. In case Qt is not yet installed on your system, you can download it from https://www.qtproject.org/
.
The exhaustive list of Qt5 components used in demos is: Core
, Gui
, Help
, OpenGL
, Script
, ScriptTools
, Svg
, Widgets
, qcollectiongenerator
(with sqlite
driver plugin), and Xml
.
Version 3.1 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 PointSampled 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 http://eigen.tuxfamily.org
.
OpenGR is a set C++ libraries for 3D Global Registration released under the terms of the APACHE V2 licence.
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/STORMIRIT/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/ethzasl/libpointmatcher
.
https://github.com/ethzasl/libpointmatcher/blob/master/doc/CompilationWindows.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.algorithmicsolutions.com
.
Version 1.4 or later
Mpfi provides arbitrary precision interval arithmetic with intervals represented using Mpfr reliable floatingpoint 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://mpfi.gforge.inria.fr/
.
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 noncommercial 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://mpfi.gforge.inria.fr/
.
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://www.shoup.net/ntl/
.
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 http://esbtl.sourceforge.net/
.
Tbb (Threading Building Blocks) is a library developed by Intel Corporation for writing software programs that take advantage of multicore 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://www.threadingbuildingblocks.org
.
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
.
The LASlib web site is https://rapidlasso.com/lastools/
. LASlib is usually distributed along with LAStools: for simplicity, CGAL provides a fork with a CMake based install procedure.
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/
.
TensorFlow is a library designed for machine learning and deep learning.
In CGAL, the C++ API of TensorFlow is used by the Classification package for neural network. The C++ API can be compiled using CMake: it is distributed as part of the official package and is located in tensorflow/contrib/cmake
. Be sure to enable and compile the following targets:
tensorflow_BUILD_ALL_KERNELS
tensorflow_BUILD_PYTHON_BINDINGS
tensorflow_BUILD_SHARED_LIB
.In order to use TensorFlow in CGAL programs, the executables should be linked with the CMake imported target CGAL::TensorFlow_support
provided in CGAL_TensorFlow_support.cmake
.
The TensorFlow web site is https://www.tensorflow.org/
.
Version 5.1 or later
METIS is a library developed by the Karypis Lab and designed to partition graphs and produce fillreducing 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 nonlinear least squares problems.
Visit the official website of the library at ceressolver.org
for more information.
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 http://scip.zib.de/
.