Hello Anionio,
Am 12.06.21 um 03:34 schrieb Antonio Russo:
I'm trying to build a Debian bullseye kernel (with KASAN enabled, but that's
irrelevant).
I'm following [1], and the critical command
$ fakeroot make -f debian/rules.gen binary-arch_i386_none_real
does not suggest using -j8 (or -jnumber_of_cores).
1. Is it safe to add -j8 ?
That depends on many factors, most importantly how many CPU cores your
build host has and how many of them you want to use:
- if this is a single-user system and you're the only user and you don't
want to do much in parallel: yes
- using all CPU cores on a multi-user system might get you complaints
from the other users.
- watching videos while waiting for the compile to finish might be
problematic.
2. Will this indeed give me the speed up I want and expect on my multi-core
processor?
Probably yes, but see above. It also depends on how much RAM you have
and how fast your disk/SSD is.
3. If both of the above are true, why isn't something like that suggested on
[1]?
Debian does not know your specifics and thus does not use parallel build
by default. You must give permissions first:
> export DEB_BUILD_OPTIONS="parallel=$(nproc)"
See
<https://www.debian.org/doc/debian-policy/ch-source.html#main-building-script-debian-rules>.
For example the VMs and hosts of Debians build system are dedicated to
building packages. They are controlled by the Debian admins and parallel
building is enabled there by default - if applicable.
If you have to build many packages it might be more effective to build
multiple source packages in parallel, as there are still packages which
can only use one CPU. Mixing both strategies is also an option, but
heavily depends on your usage scenario.
Philipp