Blender Git Loki

Git Commits -> Revision 0d43d0b

Revision 0d43d0b by Bastien Montagne (master)
May 8, 2019, 09:54 (GMT)
CMake: Add support of Ninja's pools to ease building on limited amount of RAM.

Many modern computers support a lot of threads (parrallel building
jobs), but are somewhat restricted in memory, when some building jobs
can require several GB each.

Ninja builder has pools, which extend the usual `-j X` make
parallelizing option, by allowing to specify different numbers of
parallel jobs for different targets.

This commit defines three pools, one for linking, one for usual compile,
and one for compiling some 'heavy' cpp libs, when a single file can
require GB of RAM in full debug builds.

Simply enabling WITH_NINJA_POOL_JOBS will try to set default sensible
values for those three pools based on your machine specifications, you
can then tweak further the values of NINJA_MAX_NUM_PARALLEL_ settings,
if you like.

On my system (8 cores, 16GB RAM), it allows to build a full debug with
all ASAN options build with roughly 7GB of RAM used at most, pretty much
as quickly as without that option (which would require up to 11GB of
available RAM at some points).

Review task: D4780.

Commit Details:

Full Hash: 0d43d0bcab9aa91fd22971fdb98de94aad0a9e77
Parent Commit: 27b9a0c
Lines Changed: +103, -0

2 Modified Paths:

/build_files/cmake/macros.cmake (+20, -0) (Diff)
/CMakeLists.txt (+83, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021