Compiling Dolfin: Huge memory requirements for 3D mesh generators

Asked by Nico Schlömer

When compiling Dolfin from scratch (e.g., with the help of Dorsal), GCC compiles away and remains at a memory requirement of about 500MB for the most part. GCC 4.7.2 however needs an insane amount of memory when compiling either of the two files

CSGCGALMeshGenerator3D.cpp
PolyhedralMeshGenerator.cpp

-- 3GB and 2.4GB, respectively.
This turns compiling Dolfin on some machines (e.g., those with only 4GB of main memory) into a swapfest.
Anyone experiencing similar problems, or ideas for a workaround?

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Nico Schlömer
Solved:
Last query:
Last reply:
Revision history for this message
Johan Hake (johan-hake) said :
#1

I experience the same. It is the heavily templated CGAL, which causes
the memory havoc. Not sure what could help. Maybe setting lower or no
optimization for these files?

Johan

On 01/12/2013 06:25 PM, Nico Schlömer wrote:
> New question #219025 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/219025
>
> When compiling Dolfin from scratch (e.g., with the help of Dorsal), GCC compiles away and remains at a memory requirement of about 500MB for the most part. GCC 4.7.2 however needs an insane amount of memory when compiling either of the two files
>
> CSGCGALMeshGenerator3D.cpp
> PolyhedralMeshGenerator.cpp
>
> -- 3GB and 2.4GB, respectively.
> This turns compiling Dolfin on some machines (e.g., those with only 4GB of main memory) into a swapfest.
> Anyone experiencing similar problems, or ideas for a workaround?
>
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>

Revision history for this message
Nico Schlömer (nschloe) said :
#2

I tried setting HAS_CGAL to false and this indeed "resolves" the problem.

Revision history for this message
Diego Campana (dmcampana) said :
#3

I have a similar problem.

In my computer the CGAL compilation is hardly passed, but the compilation freeze my computer when gcc 4.6.3 requires more than 3GB of memory compiling the SWIG interface!

This is the last output of the compilation

[ 96%] Swig source
Scanning dependencies of target _mesh
make[2]: se sale del directorio «/home/diego/Work/FEniCS/src/dolfin-1.2.0/dorsal_build_dir
make[2]: se ingresa al directorio «/home/diego/Work/FEniCS/src/dolfin-1.2.0/dorsal_build_dir
[ 96%] Building CXX object dolfin/swig/modules/mesh/CMakeFiles/_mesh.dir/modulePYTHON_wrap.cxx.o

Do you know some option of flag (of FEniCS and or gcc) that could solve this problem?

Thanks