[Lazarus] make option -j
David W Noon
david.w.noon at ntlworld.com
Fri Nov 13 19:43:21 CET 2009
On Fri, 13 Nov 2009 17:38:20 +0100, Alexander Kaupp wrote about
[Lazarus] make option -j:
> I dont know if everyone knows this:
>
> I have a dualcore CPU now and was wondering how to use both cores for
> compiling for example lazarus.
>
> make -j2 all
>
> uses both cpus and works great with lazarus :)
>
> for a quad-core use option: -j4
>
> hope someone finds this useful
This is not wholly dependent on having an SMP hardware configuration.
Even on a uniprocessor system, make can be accelerated by specifying
-j2 or -j3 or even higher. This is because it is not the make program
exploiting multiple processes but the Linux (or other) kernel having
multiple processes to despatch (or "schedule", as UNIX boffins misname
this). It doesn't need multiple CPUs, just time-slicing and enough RAM.
Of course, the more processor cores you have on your system, the higher
the number that can sensibly follow -j. The rule-of-thumb I use for
make is:
1. Let n denote the number of CPUs installed on the system.
2. Try 3*n+2 for the number to follow -j.
3. If that number seems too high, typically by causing paging, then try
2*n+1 instead.
So, for a monadic system, I try -j5 first, then -j3 if the machine
pages.
For a dyadic system, I try -j8 first, then -j5 if the machine pages.
For a tetradic system, I try -j14 first, then -j9 if the machine pages.
... And so on.
But that is not a hard and fast rule, just a rule-of-thumb.
Note:
=====
Monadic = 1 CPU
Dyadic = 2 CPUs
Tetradic = 4 CPUs
These terms came into use in the 1960s when mainframes first acquired
SMP (or "polyadic") configurations.
My dream is to have a hexadekadic box under my desk!! You should now be
able to work out what that means, from the above. ... ;-)
--
Regards,
Dave [RLU #314465]
=======================================================================
david.w.noon at ntlworld.com (David W Noon)
=======================================================================
More information about the Lazarus
mailing list