Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] reduce compile time

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] reduce compile time


Chronological Thread 
  • From: Ramin H <>
  • To:
  • Subject: Re: [cgal-discuss] reduce compile time
  • Date: Tue, 8 Dec 2009 18:47:23 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=AjkBKpd7v8pm8Px5AtX+qqgIYA8BDudgas0YHgGq5ouqsGv19vaoof+3SNYkXrDzQV FouNcIlYlwCfbqzr+VlDOf6WCgn4yjzGQ3WOH9FMwvKPLlVIY0pkn5ceNm4nxZW86O/I CliV+bKHDXU8YwO3kKrluGyH8FdWi7sfh2Y7U=

Thank you for the tips :)

On Tue, Dec 8, 2009 at 6:02 PM, Sylvain Pion
<>
wrote:
> 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/
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
>



Archive powered by MHonArc 2.6.16.

Top of Page