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

Fix -jN argument #14971

Merged
merged 4 commits into from
Jun 2, 2020
Merged

Fix -jN argument #14971

merged 4 commits into from
Jun 2, 2020

Conversation

julianoes
Copy link
Contributor

It turns out the -jN argument was never actually used in the Makefile but always set to 4 for Makefile build. Ninja seemed to run with whatever is the system default.

With this change both Makefile and Ninja builds will now adhere to the j argument if it is set.

This should allow to build the Gazebo plugins will less core in order not to run out of RAM.
Related to:
#14747
#14430
#14943

julianoes added 2 commits May 25, 2020 17:25
The previous check for the -j argument was not actually working.
Therefore, the build always used 4 cores, unless when building with
ninja when presumably the ninja default was used.
Without this ninja supposedely builds with the default of the system
which is 10 for my 4 core, 8 thread CPU. With this argument, you can now
actually set it.

This has the benefit that the Gazebo plugins can be built with less
cores in order to avoid running out of RAM.
@julianoes julianoes requested a review from dagar May 25, 2020 15:38
@dagar
Copy link
Member

dagar commented May 25, 2020

Ninja does this automatically by default, can you limit it to Makefiles only? Personally I'd also prefer Make didn't do anything by default, but I avoid using it so should probably stay out of it.

@julianoes
Copy link
Contributor Author

Ninja does this automatically by default, can you limit it to Makefiles only?

I agree that we want to use the ninja default when no -j is supplied. However, when it is supplied it should be taken into account, otherwise it is impossible (as far as I know) to reduce the number of parallel builds in order to avoid running out of RAM when building the Gazebo plugins.

It makes sense to trust ninja on selecting the number of cores. This is
also sensible in order not to change existing setups.
@julianoes
Copy link
Contributor Author

@dagar good to merge now?

@dagar
Copy link
Member

dagar commented May 27, 2020

@dagar good to merge now?

Looks like CI is still failing. 😏

@dagar
Copy link
Member

dagar commented May 27, 2020

Actually, this one is real. http://ci.px4.io:8080/blue/organizations/jenkins/PX4%2FFirmware/detail/PR-14971/2/pipeline

Screenshot from 2020-05-27 09-58-51

Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

Nice!

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.

3 participants