From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20692 invoked by alias); 6 Sep 2011 11:14:24 -0000 Received: (qmail 20683 invoked by uid 22791); 6 Sep 2011 11:14:23 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_TX,TW_VX,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from smtp1.u-psud.fr (HELO smtp1.u-psud.fr) (129.175.33.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Sep 2011 11:14:06 +0000 Received: from smtp1.u-psud.fr (localhost [127.0.0.1]) by localhost (MTA) with SMTP id 9644A252443 for ; Tue, 6 Sep 2011 13:14:04 +0200 (CEST) Received: from matups.math.u-psud.fr (mathups.math.u-psud.fr [129.175.52.4]) by smtp1.u-psud.fr (MTA) with ESMTP id 424A7254919 for ; Tue, 6 Sep 2011 13:14:04 +0200 (CEST) Received: from barah.math.u-psud.fr (barah.math.u-psud.fr [129.175.52.24]) by matups.math.u-psud.fr (Postfix) with ESMTP id 4604D7234 for ; Tue, 6 Sep 2011 13:14:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by barah.math.u-psud.fr (Postfix) with ESMTP id 421A0474063 for ; Tue, 6 Sep 2011 13:14:04 +0200 (CEST) Received: from barah.math.u-psud.fr ([127.0.0.1]) by localhost (barah.math.u-psud.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z57EloLnDgYi for ; Tue, 6 Sep 2011 13:14:02 +0200 (CEST) Received: from [IPv6:::1] (topodyn-ng.math.u-psud.fr [129.175.50.33]) by barah.math.u-psud.fr (Postfix) with ESMTP id 32319474060 for ; Tue, 6 Sep 2011 13:14:02 +0200 (CEST) Message-ID: <4E66007A.9000203@free.fr> Date: Tue, 06 Sep 2011 11:14:00 -0000 From: Duncan Sands User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110828 Thunderbird/7.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Re: [Ada] Speed up build of gnatools References: <20110906105705.GA28675@adacore.com> In-Reply-To: <20110906105705.GA28675@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00374.txt.bz2 Hi Arnaud, > Now that gnatmake supports -j0, it's possible to speed up the build of > gnattools during GNAT build by using gnatmake -j0 instead of gnatmake. > > This is useful since gnattools is the only target which isn't parallelized > in the Makefile before this change. this means using as many processes as there are CPUs, right? It seems pretty dubious to me to use more processes than the user maybe asked for. For example I have to restrict the number of CPUs used when building GCC to less than I have since otherwise my machine overheats and turns itself off. Is there some way to get at the -j level the user passed to the top-level make and use that? Ciao, Duncan. > > Tested on x86_64-linux-gnu, committed on trunk. > > 2011-09-06 Arnaud Charlet > > * gcc-interface/Makefile.in (common-tools, gnatmake-re, > gnatlink-re): Speed up by using -j0. > > -- > Index: gcc-interface/Makefile.in > =================================================================== > --- gcc-interface/Makefile.in (revision 178566) > +++ gcc-interface/Makefile.in (working copy) > @@ -2336,7 +2336,7 @@ > endif > > common-tools: > - $(GNATMAKE) -c -b $(ADA_INCLUDES) \ > + $(GNATMAKE) -j0 -c -b $(ADA_INCLUDES) \ > --GNATBIND="$(GNATBIND)" --GCC="$(CC) $(ALL_ADAFLAGS)" \ > gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \ > gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS) > @@ -2375,16 +2375,18 @@ > $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB) > > gnatmake-re: link.o targext.o > - $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)" > - $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)" > + $(GNATMAKE) -j0 $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)" > + $(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)" > $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake > $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \ > --GCC="$(GCC_LINK)" $(TOOLS_LIBS) > > # Note the use of the "mv" command in order to allow gnatlink to be linked with > # with the former version of gnatlink itself which cannot override itself. > -gnatlink-re: link.o targext.o > - $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)" > +# gnatlink-re cannot be run at the same time as gnatmake-re, hence the > +# dependency > +gnatlink-re: link.o targext.o gnatmake-re > + $(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)" > $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink > $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \ > --GCC="$(GCC_LINK)" $(TOOLS_LIBS)