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:

1. **PARALLEL_MAKE** — this is passed to `make` so setting it to “-j X” is handy (where value of X depends on number of CPU cores)
2. **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.

**NOTE:** this post was written in 2008 and may not fit newer versions of OpenEmbedded/Yocto based build systems.

Speeding up BitBake builds

3 thoughts on “Speeding up BitBake builds

  • 4th March 2012 at 03:11
    Permalink

    Where should I put these configurations to be applied globally? I tried bitbake.conf in bitbake folder but it seems that it is not working.

    • 5th March 2012 at 10:56
      Permalink

      You can try OE/conf/site.conf but I do not remember how well will it work.

      • 6th March 2012 at 01:05
        Permalink

        Thanks.

Comments are closed.