Installing CGAL on Ubuntu 8.04

I just had a hard time installing CGAL from source on a Ubuntu 8.04. First of all, I had to download CGAL (3.6) source.

wget https://gforge.inria.fr/frs/download.php/27222/CGAL-3.6.1.tar.gz

Untar, it

tar -xzf CGAL-3.6.1.tar.gz

And then configure the installation with cmake

cd CGAL-3.6/
cmake .

Altough I had the required version of boost installed (1.34.1), some examples didn’t compile. So I downloaded boost source (1.43.0):

wget http://downloads.sourceforge.net/project/boost/boost/1.43.0/boost_1_43_0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fboost%2Ffiles%2Fboost%2F1.43.0%2F&ts=1281619050&mirror=ufpr

tar -xzf boost_1_43_0.tar.gz
cd boost_1_43_0

And then configured it

./bootstrap.sh

And then built it with

sudo ./bjam install

Some errors arised and researching a little, I found that these two libraries were missing:

sudo apt-get install python-dev libbz2-dev

Then, when compiling cmake, it was not finding the correct version of boost. It was looking in /usr/include and /usr/lib, but the right version was in /usr/local/include and /usr/local/lib. To inform cmake of that, we should add the following parameter when configuring:

cmake -DBOOST_ROOT=/usr/local .

Then I was installing with

make

And got the following error

$/usr/bin/ld: /usr/local/lib/libz.a(gzio.o): relocation R_X86_64_32 against `a local symbol’ can not be used when making a shared object; recompile with -fPIC
$/usr/local/lib/libz.a: could not read symbols: Bad value

The problem was with the library zlib. The solution I find was here. It basically says to install zlib from source, but compiling with the flags -O3 and -fPIC.

wget http://zlib.net/zlib-1.2.5.tar.gz
tar -xzf zlib-1.2.5.tar.gz
CFLAGS="-O3 -fPIC" ./configure
make
sudo make install

going to cgal directory again and typing make, did the job.

Advertisements

2 thoughts on “Installing CGAL on Ubuntu 8.04”

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s