Subject: CGAL users discussion list
List archive
- From: Sylvain Pion <>
- To:
- Subject: Re: [cgal-discuss] reduce compile time
- Date: Wed, 09 Dec 2009 00:02:19 +0100
Laurent Rineau (GeometryFactory) a écrit :
On Tuesday 08 December 2009 17:39:48 Ramin H wrote:
Hi everyone,
I have GCC 4.4.1, CGAL 3.5, Ubuntu 9.10 running in a VMware virtual
machine, AMD Turion64-X2 processor and 1GB of RAM assigned to this
virtual machine.
Compiling classes that contain CGAL code take an incredible amount of
time. For example, compiling
CGAL-3.5/examples/Mesh_3/mesh_polyhedral_domain.cpp takes about 10
minutes to complete on my machine.
This means, each time I change anything in this file, I have to wait
10 minutes for the code in this file to get compiled. Now, if I have 2
or 3 classes with CGAL code, if I change anything in those files, I
have to wait even longer for the whole code to compile.
Is this normal? Is there any trick to reduce compile time?
With your compiler, that example needs more memory to compile. Probably the compiler uses swap. You can try to remove -g from the compilation flags, to reduce the memory need, or increase the memory of the virtual machine so that the compilation does not use swap.
Here is the FAQ entry that I am compiling for this question.
I hope it helps...
# How to reduce compilation time of programs using CGAL ?
CGAL is heavily using C++ templates, and this has an impact on compilation
speed. Here are some hints that can help speed up compilation of programs
using CGAL.
* Remove compiler debugging options like -g if you can. Indeed, generating
debug information can be very costly for template instantiations, both in
terms of running time and memory usage by the compiler tool chain.
* Remove compiler optimization options like -O2, when you do not need
them, such as early in the development cycle of your programs.
* Regroup translation units : if your program is composed of lots of small
translation units to be compiled and linked, try to reduce their numbers by
merging them. This traditional style for C programs is very slow for programs
heavily using C++ templates. Regrouping them reduces the time spent by the
compiler to parse the header files, and avoids redundant template
instantiations.
* Precompile header files : some compilers, such as GCC, provide a feature named precompiled headers. It can be mostly useful if you can regroup in a single header file most of the header files that you use, together with most template instantiations. Refer to your compiler documentation to use this.
--
Sylvain Pion
INRIA Sophia-Antipolis
Geometrica Project-Team
CGAL, http://cgal.org/
- [cgal-discuss] reduce compile time, Ramin H, 12/08/2009
- Re: [cgal-discuss] reduce compile time, Laurent Rineau (GeometryFactory), 12/08/2009
- Re: [cgal-discuss] reduce compile time, Sylvain Pion, 12/09/2009
- Re: [cgal-discuss] reduce compile time, Ramin H, 12/09/2009
- Re: [cgal-discuss] reduce compile time, Sylvain Pion, 12/09/2009
- Re: [cgal-discuss] reduce compile time, Laurent Rineau (GeometryFactory), 12/08/2009
Archive powered by MHonArc 2.6.16.