On 06/15/2014 09:10 AM, William Harrington wrote:
On Jun 14, 2014, at 9:52 PM, Dan McGhee wrote:
During my last LFS build, 7.4, I discovered that "-j" was set to 8
somehow. Is this an environment variable. I don't remember what I did
to find this.
This concept and "-j" have now become important to me and I'd like to
learn some more before I start.
Thanks,
Dan
https://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html
MAKEFLAGS variable
https://www.gnu.org/software/make/manual/html_node/Parallel.html#Parallel
Some more reading to understand for parallel builds.
Some are stating MKFLAGS, not sure where that comes from.
MAKEFLAGS variable should be set.
Also, you should consider using number of processors with +1.
Also, some build systems will fail to complete with even number of
jobs. (In the past CD Paranoia would fail to build in such an instance
and the Makefile would need to be patched) All of the packages in LFS
should be fine with an even number, but don't use it with the idea
that because it has always worked in the past, it will work with all
future build systems.
A system with lots of RAM will have a limiting factor of CPU time with
a long build (test this with a gcc build).
One task per CPU plus one pending task for occasional I/O blocks is a
good setting.
With little amount of RAM there is a limiting factor of nat having
very many jobs, which will make them swap out. There's no general
figure. Most machines these days will not have that problem. So this
can probably be disregarded.
It may be beneficial to have more jobs. If each compiler process is
small and touches a lot of data then then disk I/O could be a blocking
factor. In that case, you'll want several jobs per cpu at once so
there is always one job using each CPU while others are waiting for I/O
All of this is variable depending on the build job and available RAM.
There is an optimum setting, which after having too many jobs will
pollute the cache too much.
You will need to experiment. Normally with your quad core machine, -j5
will be fine.
Sincerely,
William Harrington
Great info, William. Thanks.
Dan
--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page