1

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:

./bootstrap.sh
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 .
make

(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 .
make

Some excutable files will be created. Then run gv_terrain

./gv_terrain

And you will see:
2

5. Reference:
http://www.cgal.org/Manual/3.4/doc_html/installation_manual/Chapter_installation_manual.html#Subsection_2.5
http://blog.sciencenet.cn/blog-284809-358873.html
http://kuniganotas.wordpress.com/2010/08/31/installing-cgal-on-ubuntu-8-04/
http://gsamaras.wordpress.com/code/linux-and-cgal/

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. šŸ™‚