11 Aug, 2009, Chris Bailey wrote in the 1st comment:
Votes: 0
So I was under the impression that you could set the concurrency level of compilation with a simple switch in make. Like so:
make -j4

It seems to work better than a standard "make" command but it is still only using 2 cores of a single cpu. I want it to use both
cores of both Cpu's =(
11 Aug, 2009, David Haley wrote in the 2nd comment:
Votes: 0
This depends on the operating system, I would imagine, and whether or not it will allocate sub-processes of one process across several physical processors (as opposed to allocating sub-processes over the cores of a single processor).

What if you try make -j8?
11 Aug, 2009, Chris Bailey wrote in the 3rd comment:
Votes: 0
Oddly enough, that did the trick David! :P

Look at me, I'm using all cpu's!
11 Aug, 2009, David Haley wrote in the 4th comment:
Votes: 0
I use -j4 on a single dual-core CPU setup. I suspect that you didn't see the second CPU being used because the load was not enough to actually use it; the computer was probably spending time blocked in I/O for some of the makes while compiling some of the others. Bumping it up to -j8 would force it to be compiling more things at a time. Even there, note that CPU1 is only being used sporadically.

If I remember correctly, the recommendation is to set -jx, where x = 2*num_cores.
11 Aug, 2009, Kline wrote in the 5th comment:
Votes: 0
http://www.gnu.org/software/make/manual/...

I use -j4 right now. Where are you reading 2 * cores? I'm always looking for fun new things to put in my Makefile :)
12 Aug, 2009, David Haley wrote in the 6th comment:
Votes: 0
I can't remember to be honest. This site just says "a few more jobs than cores"; maybe since I have two cores I mentally filed that away as 4 jobs hence x cores -> 2x jobs. The idea is to specify enough jobs in parallel so that while some are blocking on disk I/O, others can compile. Maybe 8 jobs is too much for 4 cores, and 6 or 7 could be more appropriate? Well, anyhow, the difference is likely to be quite small.
12 Aug, 2009, Banner wrote in the 7th comment:
Votes: 0
Wow, I reduced my compile time from 20-30 seconds to 3.

Edit to fix typo.
12 Aug, 2009, Kline wrote in the 8th comment:
Votes: 0
On my laptop that I'm on right now I get the following results:
cpuinfo said:
vendor_id : AuthenticAMD
cpu family : 15
model : 36
model name : AMD Turion™ 64 Mobile Technology ML-40
stepping : 2
cpu MHz : 800.000
cache size : 1024 KB


-j4 said:
real 1m46.967s
user 1m38.030s
sys 0m5.580s


-j8 said:
real 1m48.943s
user 1m38.226s
sys 0m5.624s
12 Aug, 2009, Kline wrote in the 9th comment:
Votes: 0
Just for more data, I got bored.

-j2 said:
real 1m53.196s
user 1m35.762s
sys 0m5.852s

-j1 said:
real 1m49.587s
user 1m33.210s
sys 0m5.736s


So I guess my CPU just fails :(
12 Aug, 2009, tphegley wrote in the 10th comment:
Votes: 0
How do you get the times to show?
12 Aug, 2009, Kline wrote in the 11th comment:
Votes: 0
time make


And wait patiently :)
12 Aug, 2009, tphegley wrote in the 12th comment:
Votes: 0
Nice,

real    0m15.499s
user 0m9.946s
sys 0m0.813s


real    0m3.922s
user 0m10.313s
sys 0m1.061s


Good enough for me.
12 Aug, 2009, David Haley wrote in the 13th comment:
Votes: 0
Which is which tphegley?
12 Aug, 2009, Igabod wrote in the 14th comment:
Votes: 0
remember the good ole days when there wasn't more than one core and you didn't have neat little tricks like this? I wonder why everybody keeps calling those the "good ole days".
14 Aug, 2009, Kjwah wrote in the 15th comment:
Votes: 0
Igabod said:
remember the good ole days when there wasn't more than one core and you didn't have neat little tricks like this? I wonder why everybody keeps calling those the "good ole days".


lol
14 Aug, 2009, tphegley wrote in the 16th comment:
Votes: 0
David Haley said:
Which is which tphegley?


First one was regular, second was -j4 I believe.
14 Aug, 2009, Hyper_Eye wrote in the 17th comment:
Votes: 0
Gentoo recommends -j = cpu/core count + 1.
0.0/17