Skip to content
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

Controlling build parallelism level #28

Open
wants to merge 1 commit into
base: release/v1.0.18
Choose a base branch
from

Conversation

pysco68
Copy link
Contributor

@pysco68 pysco68 commented Feb 13, 2025

CHANGELOG

  • Improved the way that build parallelism settings are forwarded through the build graph so that the correct outcome is achieved depending on setting CMAKE_BUILD_PARALLEL_LEVEL via environment

Change-Id: I33ae3760b2a0ab00048f07ac2a7c14d3bbc460b7

@pysco68 pysco68 self-assigned this Feb 13, 2025
@pysco68 pysco68 changed the title HermeticFetchContent v1.0.X : Controlling build parallelism level Controlling build parallelism level Feb 13, 2025
@daminetreg daminetreg mentioned this pull request Feb 14, 2025
13 tasks
@daminetreg daminetreg changed the base branch from main to release/v1.0.18 February 14, 2025 09:15
Copy link
Contributor

@daminetreg daminetreg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change, I'm a bit confused by the placeholder, but otherwise looking good.
This will need to be rebased on release/v1.0.18 and target a release branch.

@@ -69,8 +69,7 @@ function(hfc_autotools_register_content_build content_name)
endif()
set (AUTOTOOLS_MAKE_PROGRAM "${MAKE_PROGRAM}")

ProcessorCount(NUM_JOBS)
set (build_command "${MAKE_PROGRAM} -j ${NUM_JOBS}")
set (build_command "${MAKE_PROGRAM} -j @NUM_JOB_PLACEHOLDER@") # the @@ placeholder will be replaced in the generated external project
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a placeholder that will expand to a bash variable 🤔 , why use a placeholder at all ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't want the bash variable code to be duplicated accross autotools and cmake build and yet still be able to evaluate the cmake logic at the right time in any of the combinatorials of build time and configure time dependencies.

- the value of the environment variable ``CMAKE_BUILD_PARALLEL_LEVEL``
- the value supplied to ``cmake --build`` via the ``-j <jobs>`` / ``--parallel <jobs>`` argument

Generally not that dependencies that are made available at **build time** will have their own, separate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not -> note

- during the build
- dependencies **made available at build time** will use 2 CPU cores
- the top level build graph (your project) will use 10 CPU cores

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is very long for a simple option, I wonder if we really like to be that much detailed as we plan to change this in future versions.

@pysco68 pysco68 force-pushed the feature/concurrency-control branch from 4795d39 to 58811b2 Compare February 14, 2025 10:22
@pysco68 pysco68 force-pushed the feature/concurrency-control branch 2 times, most recently from 3d792f7 to 81fcd0c Compare February 14, 2025 15:17
CHANGELOG

- Improved the way that build parallelism settings are forwarded through the build graph so that the correct outcome is achieved depending on setting CMAKE_BUILD_PARALLEL_LEVEL via environment

Change-Id: I33ae3760b2a0ab00048f07ac2a7c14d3bbc460b7
@pysco68 pysco68 force-pushed the feature/concurrency-control branch from 81fcd0c to 6129a3e Compare February 14, 2025 17:18
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.

2 participants