[libvirt] [PATCH] enable parallel builds

Jim Meyering jim at meyering.net
Thu Aug 28 09:13:03 UTC 2008


Jim Meyering <jim at meyering.net> wrote:
> James Morris <jmorris at namei.org> wrote:
>> I'm not sure if this is the best way to do this, but it seems to work.
>>
>> Enable parallel compilation of the repository when running the autobuild
>> script and/or via rpmbuild.
...
>> diff --git a/autobuild.sh b/autobuild.sh
...
> Good idea.
> I'll be happy to commit it with something like the following
> in place of the above:
>
>   # If the MAKEFLAGS envvar does not yet include a -j option,
>   # add -jN where N depends on the number of processors.
>   case $MAKEFLAGS in
>     *-j*) ;;
>     *) n=$(getconf _NPROCESSORS_ONLN 2> /dev/null)
>       test "$n" -gt 0 || n=1
>       n=`expr $n + 1`
>       MAKEFLAGS="$MAKEFLAGS -j$n"
>       export MAKEFLAGS
>       ;;
>   esac
>
> Then you don't have to change the make invocation below,
> and it won't interfere if someone has already set MAKEFLAGS.
> Also, not using an absolute path to getconf lets that program
> work even also when it's installed in a different location.
>
> Finally, I prefer to use N_CPUS+1 as the -j option, here.
> (personally, I use 2*$N_CPUS+1, but that's probably too aggressive)
>
> Ok?

I'm interpreting non-response as agreement,
so have just committed my proposed change:

    http://article.gmane.org/gmane.comp.emulators.libvirt/8215




More information about the libvir-list mailing list