Skip to content

Save memory. Do not link to LLVM libraries in parallel #18991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ellert
Copy link
Contributor

@ellert ellert commented Jun 7, 2025

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

# When these two link at the same time, they can exhaust the RAM on many machines, since they both link against llvm.
add_dependencies(Cling rootcling_stage1)

@ellert ellert requested a review from bellenot as a code owner June 7, 2025 18:09
@dpiparo
Copy link
Member

dpiparo commented Jun 9, 2025

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?

@hahnjo
Copy link
Member

hahnjo commented Jun 10, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants