OpenEmbedded builds usually take lot of time as not everyone has build machines with multiple CPUs (or multi-core CPUs). But how to make them faster and make better use of multiple CPU cores?
Solution is in two BitBake variables:
- PARALLEL_MAKE — this is passed to
makeso setting it to “-j X” is handy (where value of X depends on number of CPU cores)
- BB_NUMBER_THREADS — amount of BitBake threads used to run tasks such as do_fetch, do_configure, do_compile etc. Do not set too big value or machine will melt and you will loose control over it ;)
Which values are sane? On Core2Quad I use “-j 4” and 16 BitBake threads. On dual core Athlon64 I use less threads (only 4) but this machine is also my desktop so I like to be able to work :) Sometimes I have two builds locally running with those settings and it is still usable.
How to check which one are good for you? Run htop on one console and builds on another. If CPU cores are busy and it does not hit swap too often then it is OK.