构建时如何添加更多线程?

Gre*_*Tea 6 memory openembedded yocto

做的时候

bitbake core-image-xxxx

构建任务将自动选择 8 个线程(因为我的 CPU 有 8 个核心)来构建映像。

我的系统有 72GB RAM,我可以强制bitbake运行更多线程吗?

或者有什么方法可以要求bitbake使用更多内存吗?

Flo*_*ndl 14

要增加线程使用量:将以下内容添加到 build/conf 目录内的 local.conf 中。将 x 和 y 替换为您想要的配置

PARALLEL_MAKE = "-j x"

BB_NUMBER_THREADS = "y"
Run Code Online (Sandbox Code Playgroud)

PARALLEL_MAKE定义在 do_compile 期间使用 make -j 命令时应使用多少个线程。

BB_NUMBER_THREADS定义 bitbake 的线程数。

我不知道如何增加内存使用量,如果你想提高构建速度,你可以使用 ramdisk。 https://www.linuxbabe.com/command-line/create-ramdisk-linux

https://docs.yoctoproject.org/dev-manual/speeding-up-build.html