root icon indicating copy to clipboard operation
root copied to clipboard

Save memory. Do not link to LLVM libraries in parallel

Open ellert opened this issue 6 months ago • 2 comments

This Pull request:

Linking to the built-in static LLVM libraries uses a lot of memory. Linking more than one such target in parallel can exhaust the memory. This PR adds dependencies to prevent this.

Compare

https://github.com/root-project/root/blob/a32e7d0eb6ff583c3420e32b4198d20cd7e8ebd4/core/metacling/src/CMakeLists.txt#L126-L127

ellert avatar Jun 07 '25 18:06 ellert

Thanks for these changes. How much memory is consumed in the worst case? Is some potential for parallelism lost at the risk of some potential reduction of build time?

dpiparo avatar Jun 09 '25 10:06 dpiparo

These dependency hacks are not really great for targeted rebuilds; for example the current hack already results in ninja Cling (which I do quite often) rebuilding also rootcling_stage1. If it's possible to use ninja, we could look into JOB_POOLS in the way that LLVM provides LLVM_PARALLEL_LINK_JOBS.

hahnjo avatar Jun 10 '25 07:06 hahnjo