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

[cmake] Add option to limit cores used to build specific targets #254

Merged
merged 3 commits into from
Apr 27, 2017

Conversation

bcarrez
Copy link
Contributor

@bcarrez bcarrez commented Apr 25, 2017

This PR adds the cmake option "NINJA_BUILD_POOL_FLEXIBLE" which limits the number of CPU cores used to build the Flexible target (default value: 1). Can be easily replicated to other projects as needed.
This is only effective when using Ninja.
This will make possible to optimize the number of build threads without hitting the RAM limit on CI, but also on workstations.


This PR:

  • builds with SUCCESS for all platforms on the CI.
  • does not generate new warnings nor unit test failures.
  • does not break existing scenes.
  • does not break API compatibility.
  • has been reviewed and agreed to be transitional.
  • is more than 1 week old (or has fast-merge label).
  • reports important changes in Changelog.

Reviewers will merge only if all these checks are true.

…uild a specific target (proof-of-concept with Flexible plugin). (Only works with Ninja build manager)
@bcarrez bcarrez added the enhancement About a possible enhancement label Apr 25, 2017
# Conflicts:
#	applications/plugins/Flexible/CMakeLists.txt
@damienmarchal
Copy link
Contributor

+1 for this excellent feature :)

@matthieu-nesme
Copy link
Member

Would it be possible to set the nb of threads automatically to the max (like default ninja w/o the j option)?
(or to deactivate the pool...)

@bcarrez bcarrez added the pr: status wip Development in the pull-request is still in progress label Apr 26, 2017
@bcarrez
Copy link
Contributor Author

bcarrez commented Apr 27, 2017

I just added the option SOFA_NINJA_BUILD_POOLS to activate the pools feature for ninja (default:OFF). This way, by default, the feature will be inactive for the average user but it can be easily used by the CI or any "advanced user".

@bcarrez bcarrez removed the pr: status wip Development in the pull-request is still in progress label Apr 27, 2017
@damienmarchal
Copy link
Contributor

damienmarchal commented Apr 27, 2017

I recommand a fast-merge on this one. With this we will be able to add -j3 on windows builds...and on "heap" error we will reduce "locally" the number of jobs.

@matthieu-nesme
Copy link
Member

tip-top. Mergeable right now!

@matthieu-nesme matthieu-nesme added the pr: fast merge Minor change that can be merged without waiting for the 7 review days label Apr 27, 2017
@damienmarchal damienmarchal merged commit 7e0c217 into sofa-framework:master Apr 27, 2017
@damienmarchal damienmarchal deleted the ninja_pools branch April 28, 2017 20:17
@guparan guparan added this to the v17.06 milestone Jun 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement About a possible enhancement pr: fast merge Minor change that can be merged without waiting for the 7 review days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants