22

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 sets

MAKEFLAGS += -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?

muru
  • 207,228
ph0t0nix
  • 1,397

4 Answers4

20

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"

gggf
  • 216
11

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
Spooky
  • 109
Manuel
  • 211
10

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.

rbrito
  • 379
0

To sum-up all the above, that worked for me:

export DEB_BUILD_OPTIONS='parallel=16'
fakeroot debian/rules binary
midenok
  • 848
  • 1
  • 10
  • 15