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:
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:
3. Install CGAL
Download the package and unpack it, then go to its directory, say ~/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
Some excutable files will be created. Then run gv_terrain
And you will see:
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. š
Hi lethiic
when i run ./gv_terrain i am getting following error
sid@sid-PC:~/Downloads/CGAL-4.4-beta1/demo/Geomview$ ./gv_terrain
Starting Geomview…execl geomview failed
error number 2 (check `man execlp’)
terminate called after throwing an instance of ‘CGAL::Assertion_exception’
what(): CGAL ERROR: assertion violation!
File: /home/sid/Downloads/CGAL-4.4-beta1/src/CGAL/Geomview_stream.cpp
Line: 119
Please help me to solve this issue as soon as possibel.
I have needed to run these examples.
Advance in thanks
Siva Rama Krishna
Hi Siva Rama Krishna
I think your problem is the same with this one: http://cgal-discuss.949826.n4.nabble.com/Problem-running-Triangulation-3-demo-on-mac-os-x-10-6-5-g-4-2-1-td3312895.html
For more details of geomview you can see http://www.geomview.org/
Considering that Geomview is an old tool, if the solution above does not solve the problem, I suggest you to try CGAL-4.3 instead. Since the beta version of CGAL-4.4 is not stable and may exsist some problems.
If you need any further help, please let me know.
lethic
Hi lethic
Thanks for provding step by step procedure. I followed as you mentioned but at the end when I run ./gv_terrain, it says no such file or directory.
super@Jallu:~/Downloads/CGAL-4.4/demo/Geomview$ ./gv_terrain
bash: ./gv_terrain: No such file or directory
Was my installation went wrong some where?. But I did not get any errors while installing. I am confused. Please help me, I would be grateful to you.
Thank you
Hi Ramesh,
Thank you for your reply.
I am wondering if you have done the following steps:
cd ~/CGAL-4.3/demo/Geomview
cmake -DCGAL_DIR=$HOME/CGAL-4.3 .
make
Don’t forget the “.” in the end of the second line and make sure there are no errors after the process. And if you have done this steps, input “ls” and see if there is “gv_terrain” which is in green color. If you still cannot see gv_terrain, please let me know and I will check if there is any other possible problem.
lethic
Hi Lethic,
Now I am able to see the gv_terrain, which is in green color. But the problem is when I run gv_terrain, I am getting the following errors.
super@Jallu:~/CGAL-4.4/demo/Geomview$ ./gv_terrain
Starting Geomview…execl geomview failed
error number 2 (check `man execlp’)
terminate called after throwing an instance of ‘CGAL::Assertion_exception’
what(): CGAL ERROR: assertion violation!
File: /home/super/Downloads/CGAL-4.4/src/CGAL/Geomview_stream.cpp
Line: 119
super@Jallu:~/CGAL-4.4/demo/Geomview$
What might went wrong?
Thank you.
Hi Lethic,
Now I am able to see the gv_terrain, which is in green color. But the problem is when I run gv_terrain, I am getting the following errors.
super@Jallu:~/CGAL-4.4/demo/Geomview$ ./gv_terrain
Starting Geomview…execl geomview failed
error number 2 (check `man execlp’)
terminate called after throwing an instance of ‘CGAL::Assertion_exception’
what(): CGAL ERROR: assertion violation!
File: /home/super/Downloads/CGAL-4.4/src/CGAL/Geomview_stream.cpp
Line: 119
super@Jallu:~/CGAL-4.4/demo/Geomview$
What might went wrong?
Thank you.
Do I need any 3d-viewer?
I installed geomview,
Now I could run it.
Awesome.. I owe you a lot. Thank you so much.