CGAL is a powerful C++ library which can be applied in various areas needing geometric computation, ranging from medical imaging to mesh generation. This article will tell you how to set it up in Ubuntu. Before this, I strongly recommend you to read through the official guide of it.

1. Install Boost
Download the latest version Boost in its official website. http://www.boost.org/
Unpack it and goes to its directory, say ~/boost_1_55_0
And type this in the terminal:

sudo ./bjam install

2. Install cmake
(you also need to install GNU C++)
Download the package in http://www.cmake.org/
unpack it and goes to its directory:

./bootstrap; make; make install

3. Install CGAL
Download the package and unpack it, then go to its directory, say ~/CGAL-4.3 .

tar Jxvf CGAL-4.3.tar.xz
cd CGAL-4.3/
cmake -DCGAL_DIR=~/CGAL-4.3 .

(don’t forget the “.” in the cmake line)

4. Run demo/example
Then go into a demo folder, say CGAL-4.3/demo/Geomview

cd ~/CGAL-4.3/demo/Geomview
cmake -DCGAL_DIR=$HOME/CGAL-4.3 .

Some excutable files will be created. Then run gv_terrain


And you will see:

5. Reference:

If I made any mistakes or you met any another problems during the process please don’t hestitate to contact me via lethiic@gmail.com or just leave a message here. šŸ™‚