问题
Do you got any idea how to build an oe project with distributed bitbake compile? I've thinked about distcc.
export PATH=~/distcc/bin:$PATH
make -jn CC=linux-gcc
make will call linux-gcc from my path which points to distcc.
distcc will schedule the tasks to all known hosts.
-jn will create n6 instances of make.
It works fine.
But now I want to use distcc with bitbake.
I know how to use -jn with bitbake.
Just use export PARALLEL_MAKE=-jn
But how to use export PATH=~/distcc/bin:$PATH
with bitbake.
The distcc/bin
MUST stand in front of the $PATH
.
But bitbake will place the $PATH_prepend
(placed in org.openembedded.dev/conf/bitbake.conf) in front of the $PATH
.
Or someone got another tool for better way of distributed building with bitbake?
回答1:
Try Icecream: https://github.com/icecc/icecream/blob/master/README.md
Like distcc, Icecream takes compile jobs from a build and distributes it among remote machines allowing a parallel build. But unlike distcc, Icecream uses a central server that dynamically schedules the compile jobs to the fastest free server.
Both OpenEmbedded and Yocto Project support Icecream. See https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/classes/icecc.bbclass
Install Icecream, then add the following to your site.conf or local.conf
INHERIT += "icecc"
# This value overrides PARALLEL_MAKE when ICECC is enabled
# This would enable icecc for local and cross
ICECC_PARALLEL_MAKE = "-j 24"
回答2:
A slightly more BitBake-ish way of invoking builds with parallelism is to edit local.conf and un-comment BB_NUMBER_THREADS and PARALLEL_MAKE and set their values to twice the number of cores that you have. Now, whenever you invoke BitBake, it will use these values.
来源:https://stackoverflow.com/questions/14472175/distributed-compile-with-bitbake