... | ... | @@ -26,3 +26,13 @@ After compilation, the module can be installed in the default Python module dire |
|
|
``` bash
|
|
|
$ make install
|
|
|
```
|
|
|
## Memory requirements for compilation
|
|
|
|
|
|
Graph-tool requires relatively large amounts of RAM (~ 3 GB) during compilation, because it uses [template metaprogramming](http://en.wikipedia.org/wiki/Template_metaprogramming) extensively. Most compilers are still not not very well optimized for this, which means that even though the program is relatively small, it will still use up lots of RAM during compilation, specially if optimizations are used (and you do want to use them). Below you can see the memory usage during compilation using GCC 5.2.0 and clang 3.7.0, on a 64-bit GNU/Linux system with an Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz.
|
|
|
|
|
|
![compilation](/uploads/f1adc8f96193dc74b79f278c7455ea39/compilation.svg)
|
|
|
|
|
|
GCC finishes under 80 minutes, and uses at most slightly below 3 GB. On the other hand, clang takes around 100 minutes, and has a memory use peak around 4 GB.
|
|
|
|
|
|
## Parallel algorithms
|
|
|
graph-tool can run several of its algorithms in [parallel](http://en.wikipedia.org/wiki/Parallel_programming). It makes use of [OpenMP](http://en.wikipedia.org/wiki/Openmp) to do this, which provides a straightforward way of converting serial code into parallel code. OpenMP is an extension to the Fortran, C and C++ languages, which uses compiler directives to achieve automated code parallelization. Since it uses [compiler directives](http://en.wikipedia.org/wiki/Compiler_directive) (`#pragma `in C/C++), it maintains backwards compatibility with compilers that do not support OpenMP, and the code is then compiled cleanly as regular serial code. Thus, support for parallel code in graph-tool is quite optional. If you wish to enable it, just pass the option `--enable-openmp` to the configure script. |