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

make multi cpu #3

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

make multi cpu #3

wants to merge 8 commits into from

Conversation

ric96
Copy link

@ric96 ric96 commented May 4, 2017

since the Makefile further invokes make, automatically set the -j option depending upon the number of cores.

@craigbarnes
Copy link

@ric96
Copy link
Author

ric96 commented May 5, 2017

Hmmm wasn't aware of the nproc command, should work with
‘‘‘
$(MAKE) -j$(shell nproc)
‘‘‘

@MichielDerhaeg
Copy link
Owner

If I'm correct, make propagates the -j option to the subsequent make calls. So if you want parallelism, doing make -j8 image should work. I also disagree with forcing the number of jobs in the makefile when you can specify them.

Thanks for mentioning the dependency. The dependencies are kindof all over the place. Maybe i should add a different file that summarizes them.

@ric96
Copy link
Author

ric96 commented May 5, 2017

I've tried both ways with time make -j2 bzImage, and by adding it to the script, not including download time
The results coming in at 2min and 1min respectively
But, for the full build at 2.5min and 3min
The reason being, The ‘-j’ option is a special case (see Parallel Execution). If you set it to some numeric value ‘N’ and your operating system supports it (most any UNIX system will; others typically won’t), the parent make and all the sub-makes will communicate to ensure that there are only ‘N’ jobs running at the same time between them all. Note that any job that is marked recursive (see Instead of Executing Recipes) doesn’t count against the total jobs (otherwise we could get ‘N’ sub-makes running and have no slots left over for any real work!)
-source https://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html
So what I intended to do was to keep everything sequencial, busybox build after bzImage has finished, but each individual build using all of the available cores, buildroot follows this approach. but I didn't knew about the recursive options.

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.

None yet

4 participants