SKD compilation on multi-core CPU

Hi,

I've got VM where my OpenWrt SDKs are installed. That VM has 4 CPU cores assigned but during compilation only one is used and the process is really time consuming. Is there a way to speed it up making use of more cores?

Kal800

make -j4

Should use 4 CPU's while building.

1 Like

I remember that for best optimization, it should use -j $(($(nproc)+1)). So for 4 cores it should be -j5.

2 Likes

Thanks for correcting me @badulesia

Easy, I compile on a quad cores, so I always use -j5 :wink:
I don't do this that much, so each time I have to look at the formula to check on the +1.

That's not recommended anymore, just the amount of cores you got is plenty.

1 Like

Noted. It is indeed more logic to use the tag -j4 with a 4 cores computer.

Is this just an observation, or is there somewhere I can research this statement to that effect? The wiki still advocates using nproc+1.

Frankly, I’ve never really understood that logic, but it has always worked without issue the last four years . . . until I started building X86_64.

I have come across an explanation at some point that made a lot of sense as to why you should just specify the exact amount of cores. Might even have been on this forum; but I can't find it anymore.

1 Like

Thanks. Not that I didn’t doubt you, just hadn’t seen anything to that effect myself.

I recently started building for an X86_64 N95 platform, and have had to drop from -j 21 based on that algorithm to -j 10 to complete a build.

Inquiring mind.