Distributed compile with bitbake

和自甴很熟 提交于 2020-01-01 03:18:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!