How to run parallel make with debuild?
Solution 1
It has to be enabled in debian/rules. If the package uses dh, there is a line like this in debian/rules:
dh $@
Change that to
dh $@ --parallel
Then your commands will work, at least DEB_BUILD_OPTIONS="parallel=4"
Solution 2
With debhelper 10, you no longer need to supply the --parallel
option in debian/rules
; it now runs parallel builds by default. See the release notes
The answer, is therefore, just to set the contents of debian/compat
to 10
and to update the debhelper
version to >=10
in debian/control
.
Solution 3
I recommend using the DEB_BUILD_OPTIONS
environment variable, as described in section 4.9.1 of the Debian Policy Manual.
DEB_BUILD_OPTIONS='parallel=4' debuild -i -us -uc -b
Related videos on Youtube
Keith
Updated on September 18, 2022Comments
-
Keith almost 2 years
I am trying to make a package of a piece of software that I've (co-) written. I'm using
debuild -i -us -uc -b
And in principle that works fine. In order to shorten compilation time I'd like to debuild to run make in parallel (like I normally do by running
make -j4
, for example). I've found a few locations on the web that suggest the following:debuild -eDEB_BUILD_OPTIONS="parallel=4" -us -uc -b debuild -j4 -us -uc -b
Another site suggested to add some code to the
debian/rules
file that basically setsMAKEFLAGS += -j4
However, none of these seems to work. Have I missed something? or should I change something in the autoconf/automake settings of the source?
-
Vasily Ryabov over 2 yearsBTW, this env variable doesn't work for
dpkg-buildpackage
command. It has its own option-j=4
which works. But equal sign=
is important.