Multiple processors

Asked by Bryn Nobbs

Hi, just a quick question, is it possible to pass the -jX argument to make without having to go through every file and add it to the make command? If there is currently no way to do it, could i suggest doing it with an option that could be passed to lfscript. eg ./lfscript -Bux "nano wget" -o "-j4". Then the scripts will need a something like "make $MAKE_OPTIONS ". Just a thought.

Question information

Language:
English Edit question
Status:
Solved
For:
LFScript Edit question
Assignee:
No assignee Edit question
Solved by:
Marcel van den Boer
Solved:
Last query:
Last reply:
Revision history for this message
Best Marcel van den Boer (synthehol) said :
#1

I have not thought about this before (because I don't own a multi core machine), so what I'm proposing here is is untested.

Linux From Scratch suggests exporting the MAKEFLAGS variable (http://www.linuxfromscratch.org/lfs/view/development/chapter04/aboutsbus.html).

The proper place to put this (export MAKEFLAGS='-j ...') would be in the "scripts/extend.conf" file, and you could do that yourself, right now. Right below "#!/bin/bash" should be fine. However, this file is sourced only after the temporary toolchain has been built, so currently it's not going to be effective until after that.

Here's what I will do:
(1) I'll modify LFScript to source "extend.conf" from the start, so that exports like these will be effective right away.
(2) I'm planning to build a small wiki for LFScript (my current documentation system sucks), and I'll be sure to create a page which explains these things in some more detail.

Revision history for this message
Bryn Nobbs (bryn-nobbs) said :
#2

Thanks for the quick reply. I will let you know if it makes any difference just as soon as my pc finishes compiling glibc (i dont want to interrupt it, it takes forever).

If you need any help with the documentation, give me a shout. I read alot of documentation and find it to be very programmer oriented. With lfscript being as technical as it is i think it would be good to have some nice easy to read documentation.

Revision history for this message
Bryn Nobbs (bryn-nobbs) said :
#3

Well that seemed to do the trick, just tested it whilst compiling file and it topped both processors out whilst it compiled. Thanks for the quick reply, and the documentation offer still stands.

I find it strange no one else has commented on this before as multi core pc's have been the norm for a good while now.

Anyway, Thanks!

Revision history for this message
Bryn Nobbs (bryn-nobbs) said :
#4

Thanks Marcel van den Boer, that solved my question.

Revision history for this message
Marcel van den Boer (synthehol) said :
#5

Thanks, your help would be great. I'll contact you in a few days (after I have installed the wiki properly) with some details on how you can help out.

Revision history for this message
Marcel van den Boer (synthehol) said :
#6

You might like to know, that the next revision (21) of LFScript exports MAKEFLAGS by default, to use all available CPU cores. So, no more need to set it in extend.conf (unless you want to use less cores).