CGAL
Instructions for CGAL 3.4 (for Graphite-2.0-a3)
1) Prerequisites
see instructions for Graphite-2-a2
2) Install CGAL
see instructions for Graphite-2-a2
3) Build the cgal2graphite plugin
If you don't have the svn sources:
- download
cgal2graphiteon Graphite's Inria Gforge page - uncompress
cgal2graphitein <graphite_dir>/../plugins/OGF/.
On Windows:
- run CMake
Directory: <Graphite_dir>\..\plugins\OGF\cgal2graphite
Build directory: <Graphite_dir>\..\plugins\OGF\cgal2graphite\build\Windows
- Push 'configure' ... wait (OK is still grayed out)
- Push 'configure' a second time (now OK is no longer grayed out)
- Push 'OK'
- open the solution <Graphite_dir>\..\plugins\OGF\cgal2graphite\build\Windows\CGAL2GRAPHITE.sln in VC++
- build it for each configuration you have build for Graphite (Release , Debug...)
On GNU/Linux:
- run ./configure.sh
- cd build\Linux-<configuration>
- make
4) Run Graphite
see instructions for Graphite-2-a2
Instructions for CGAL 3.4 (for Graphite-2-a2)
CGAL 3.4 is out, and available from Inria GForge (same forge as Graphite). You can find the CGAL installation manual here, on their website, but for convenience the main steps are reported here. Please refer to the official documentation of CGAL for more information.
We are currently testing it and adapting Graphite to it.
1) Prerequisites
CMake >= 2.4
CGAL 3.4 uses CMake to manage its build configuration. If you don't already have it, install it now.
On Windows: Get it on CMake website.
On Fedora Core: yum install cmake
Boost >= 1.33, GMP >= 4.1.4, MPFR >= 2.2.1 (+ developer versions)
On windows: GMP and MPFR precompiled versions are bundled with CGAL.
For Boost :
- Option 1: with BoostPro (32 bit only but much faster)
- Download BoostPro 1.3x.0 Installer on BoostPro website.
- Run the installer. When prompted, select the version of Visual Studio you use and all the 'variant' of the library you need. If unsure about the variant, you could probably select all of them.
- When you are asked to check the components to be installed, verify that Boost Thread is (partially) selected (minimal selections: Boost head files + Boost Thread).
- Select the install folder. WARNING: try to avoid path with parenthesis in it ! (it could cause errors in some CMake scripts...).
- Press 'Install' and go get a coffee while the installer downloads and installs chosen components. Installation can take quite some time (15 minutes or more if all variants are selected and/or your connection is slow).
- Option 2: Install Boost from sources. (32 and 64 bit)
- Download boost sources and bjam from , and extract boost to a folder and put
bjam.exeinto your system path, for instance, c:\windows. - Compile boost-thread library only.
- Run MSVC Compiler Command Prompt (choosing 32bit or 64bit compiler) and execute the following command:
- Download boost sources and bjam from , and extract boost to a folder and put
for 32 bits:
bjam --toolset=msvc --build-type=complete --with-thread stage
for 64 bit:
bjam --toolset=msvc address-model=64 --build-type=complete --stagedir=stage64 --with-thread stage
- You can find the generated libraries in stage/stage64 directory. copy them into /lib.
You may have to manually set the environment variable BOOSTROOT to the path where you installed Boost.
- In Control Panel > System > Advanced > Environment Variables , check if the variable already exists. If not, create it and set its value to the path to the Boost directory. The "boost", "lib" directories should be in the directory you specify as the
BOOSTROOTvalue.
On Fedora Core:
yum install boost boost-devel gmp gmp-devel mpfr mpfr-devel
2) Install CGAL
On Windows:
Installation of CGAL on windows occurs in three main steps : install the sources, configure them for your system and build them.
a) Install CGAL sources
- Download latest version of the Windows installer from Inria GForge.
- Run the installer, and like for boost, select the correct compiler and variant (I bet you have to match CGAL variants with Boost variants...) WARNING: if you use Visual C++ Express, you must select the 32bit version !
- Select the install folder. WARNING: avoid path with parenthesis in it ! (it causes errors in some CMake scripts...)
- when asked about the environmental variables, make sure both that
CGAL_DIRis set andCGAL-3.4/auxiliary/gmp/libis added to the PATH. - finish the installation.
b) Configure CGAL sources
- Option 1(GUI)
- Run CMake on the CGAL directory(the topmost with a CMakeLists.txt file) , WITH THE SAME DIRECTORY for the source and binaries.
- You may have to press "Configure" twice or more times until the "OK" or "generate" button becomes available.
- Option 2(Windows Console)
- Run MSVC Compiler Command Prompt (choosing 32bit or 64bit compiler)
- Run "cmake-gui ." on the CGAL directory(the topmost with a CMakeLists.txt file) , WITH THE SAME DIRECTORY for the source and binaries.
- You may have to press "Configure" twice or more times until the "OK" or "generate" button becomes available.
This step will generate files specifically crafted for your system.
c) Compile CGAL
- open the solution (CGAL.sln) in Visual Studio
- set the type of configuration you want using the Configuration Manager
- build the solution
- repeat the last two steps for each configuration you plan on using (at least Release and Debug are recommended)
On GNU/Linux:
- Download latest version of the sources from Inria GForge.
- Uncompress the sources where you want them to live and cd to this directory. You can use in /opt/CGAL-3.4 for exemple.
cmake .(notice the dot)make- Optionally, install the library in standard folders with
make install
3) Create CMakeOptions.txt
- Create a file CMakeOptions.txt from CMakeOptions.txt.sample (duplicate and rename) in the GraphiteTwo directory.
- in CMakeOptions.txt, uncomment the line
SET(USES_CGAL TRUE)(remove the#).
If you use GNU/Linux and you did not install CGAL in standard folders, you may need to modify the variable CGAL_DIR to match the path where CGAL lives.
4) Re-configure Graphite
On Windows:
rerun CMake
On GNU/Linux:
rerun ./configure.sh
5) Build Graphite
See Windows and Linux tutorials.
6) Run Graphite
In File > preferences > Modules:
- add
cgal2graphite - save configuration file
- quit graphite and rerun it

Then all Graphite functions that use a Delaunay triangulation (2D and 3D) can use CGAL (displayed example: WhetGrid's insert_vertices command). The plugin registers two instantiations of CGAL, one using doubles (CGAL), and one using exact predicates (CGAL_ExactPredicates), that is slower, but robust.
Instructions for CGAL 3.3.1 (for Graphite 2-a1)
1) Download CGAL sources
From http://www.cgal.org/download/index.html Under Windows, install CGAL at the same location where Graphite is (i.e. in My Documents\Work\CGAL-3.1) Under Linux, install CGAL in /opt/CGAL-3.1
2) Create CMakeOptions.txt
Rename CMakeOptions.txt.sample as CMakeOptions.txt, and edit it according
to your configuration.
if when loading the module cgal2graphite into graphite, errors appear because of undefined symbols, this might be because of a wrong linkage with the CGAL library. Make sure your CMakeOptions.txt contains the right name for your CGAL library, and that the headers can be found by the compiler. The linkage and includes for CGAL are defined in the CMakeLists.txt file in the src/packages/OGF/cgal2graphite directory. The includes are done for a manually built CGAL. If your CGAL was installed from a package, make sure the headers are in the right directory (for debian users, there should be a directory /usr/include/CGAL, and /usr/include is automatically known by the compiler)
3) Configure
Under Linux: rerun ./configure.sh
Under Windows: rerun CMake
4) Build Graphite
See Windows and Linux tutorials.
5) Run Graphite
In Preferences/Modules:
- add cgal2graphite
- save configuration file
- quit graphite and rerun it

Then all Graphite functions that use a Delaunay triangulation (2D and 3D) can use CGAL (displayed example: WhetGrid's insert_vertices command). The plugin registers two instanciations of CGAL, one using doubles (CGAL), and one using exact predicates (CGAL_ExactPredicates), that is slower, but robust.