parallel builds using DEB_BUILD_OPTIONS - Debian

This is a discussion on parallel builds using DEB_BUILD_OPTIONS - Debian ; Hi, The Policy Manual [1] gives the following recipe for supporting parallel make: ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKEFLAGS += -j$(NUMJOBS) endif Unfortunately, for packages that use recursive makefiles (the most common practice) this results in the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: parallel builds using DEB_BUILD_OPTIONS

  1. parallel builds using DEB_BUILD_OPTIONS

    Hi,

    The Policy Manual [1] gives the following recipe for supporting
    parallel make:

    ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
    MAKEFLAGS += -j$(NUMJOBS)
    endif


    Unfortunately, for packages that use recursive makefiles (the most
    common practice) this results in the following warning

    make[1]: warning: -jN forced in submake: disabling jobserver mode.

    which apparently is sub-optimal [2]. The issue in that MAKEFLAGS
    is applied to each recursive make. The recommended practice is to
    supply -jN *only* to the initial invocation of make.

    It strikes me, therefore, that the policy manual should be updated,
    removing MAKEFLAGS and instead showing an explicit "make -J$(NUMJOBS) ...".

    However, my problem is with cdbs: how can I supply -jN to only the
    initial make?

    Thanks,
    -Steve


    [1] http://www.debian.org/doc/debian-pol...nrules-options
    [2] http://make.paulandlesley.org/jobserver.html

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iD8DBQFI9d9l0i2bPSHbMcURAt2eAKCgNKVv0jn6JHDx4aMlGM wG4dDw/wCgiM+r
    6HGF+GKJcjSd4HYn4EeHnjs=
    =wnGD
    -----END PGP SIGNATURE-----


  2. Re: parallel builds using DEB_BUILD_OPTIONS

    On Wed, Oct 15, 2008 at 07:17:41AM -0500, Steve M. Robbins wrote:
    > It strikes me, therefore, that the policy manual should be updated,
    > removing MAKEFLAGS and instead showing an explicit "make -J$(NUMJOBS) ...".


    Or better "$(MAKE) -j$(NUMJOBS)".

    > However, my problem is with cdbs: how can I supply -jN to only the
    > initial make?


    Maybe it's a ugly hack, but what about:

    DEB_MAKE_BUILD_TARGET = -j$(NUMJOBS) ACTUAL_BUILD_TARGET

    It should work at least in case you are using only the makefile.mk
    class, I haven't checked if it can be made to work with autotools.mk.

    Cheers.

    --
    Stefano Zacchiroli -*- PhD in Computer Science \ PostDoc @ Univ. Paris 7
    zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
    Dietro un grande uomo c' sempre /oo\ All one has to do is hit the right
    uno zaino -- A.Bergonzoni \__/ keys at the right time -- J.S.Bach

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.9 (GNU/Linux)

    iD8DBQFI9egm1cqbBPLEI7wRAtF+AKCZ+ewkf9L9PAQJLaexPb NLHeX6ugCeMqRi
    hZjXeZw+QrvrqDOB1/SD5rs=
    =tNK6
    -----END PGP SIGNATURE-----


+ Reply to Thread