From a7f61ea06959277ac2fa544b39f6113e7f111786 Mon Sep 17 00:00:00 2001 From: Lars Bilke <lars.bilke@ufz.de> Date: Tue, 27 Apr 2021 08:54:04 +0200 Subject: [PATCH] [web] Added hint on number of compilations per RAM. --- .../docs/devguide/getting-started/build.md | 15 +++++++++++++-- .../docs/devguide/troubleshooting/build.md | 4 ++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/web/content/docs/devguide/getting-started/build.md b/web/content/docs/devguide/getting-started/build.md index 8d9d6705b54..e5c10f4db5a 100644 --- a/web/content/docs/devguide/getting-started/build.md +++ b/web/content/docs/devguide/getting-started/build.md @@ -38,8 +38,19 @@ To build with the `ninja` tool on the shell go to your previously configured bui cd ../build/release ninja ``` -By default, `ninja` uses maximum parallelism causing it to crash on many machines as the memory consumption exceeds the available memory. -Therefore, we recommend restricting the number of threads to be used, e.g., type `ninja -j 2` for a maximum of two threads. + +<div class="note"> + +<h3><i class="fal fa-exclamation-triangle"></i> Exceeding memory consumption during compilation</h3> + +By default, `ninja` uses maximum parallelism which may lead to a memory consumption exceeding the available memory (especially when compiling the processes). + +Therefore, we recommend restricting the number of parallel compilations to be used to **one per 8 GB RAM**, e.g., if your machine has 16 GB RAM type `ninja -j 2` for a maximum of two parallel compilations. + +Another option is to build just the process you are interested in by configuring with the CMake option `OGS_BUILD_PROCESSES`, e.g.: `cmake -DOGS_BUILD_PROCESSES=HT ....`. In this case you should be able to compile with full parallelization. + +</div> + </div> <div class='mac'> diff --git a/web/content/docs/devguide/troubleshooting/build.md b/web/content/docs/devguide/troubleshooting/build.md index b1e503a025a..0279756d7e8 100644 --- a/web/content/docs/devguide/troubleshooting/build.md +++ b/web/content/docs/devguide/troubleshooting/build.md @@ -36,3 +36,7 @@ If this still fails you can disable building of the failing processes, e.g.: cmake . -DOGS_BUILD_PROCESS_HT=OFF cmake --build . --config Release -j 1 ``` + +## Compiler crash on Linux / macOS + +The same as described above for Windows can happen on other platforms if there is not enough RAM to compile in parallel. See the note on [Exceeding memory consumption during compilation]({{< ref "docs/devguide/getting-started/build.md#build-the-project" >}}). -- GitLab