pi-build icon indicating copy to clipboard operation
pi-build copied to clipboard

Make -j 4 to use all cores

Open km4ack opened this issue 5 years ago • 2 comments

Hi, Jason!

I would like to make a proposal for pi-build - when calling "make" command, to add "-j 4". That way the compiling will use all cores and the build time shall be reduced a tot.

-- 73 Daff, LZ1DAF

km4ack avatar Oct 31 '20 17:10 km4ack

Recommended in this post.

km4ack avatar Oct 31 '20 23:10 km4ack

Be careful, as make -j introduces parallel building and assumes that the code being built has been properly "modularized". I have been running Gentoo for years (a distro where everything is compiled before being installed) and there are a number of packages that have allergic reactions to the global "make -j " setting I use. Parallel building really helps with the kernel compilation, but is usually not that interesting for small packages, as the linker step cannot be parallelized anyways, and that's usually the step that can take the longest because of the Pi's slow block device speeds.

In other words, I don't recommend making this a "global setting", but can help certain packages.

Jehreg avatar Nov 10 '20 17:11 Jehreg