From owner-freebsd-questions@FreeBSD.ORG Thu Jan 24 21:05:44 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15A1D16A418 for ; Thu, 24 Jan 2008 21:05:44 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp01.sth.basefarm.net (ch-smtp01.sth.basefarm.net [80.76.149.212]) by mx1.freebsd.org (Postfix) with ESMTP id 93A2513C461 for ; Thu, 24 Jan 2008 21:05:43 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-253-25-183.bredband.comhem.se ([83.253.25.183]:50142 helo=falcon.midgard.homeip.net) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1JI9GY-0005j1-3x for freebsd-questions@freebsd.org; Thu, 24 Jan 2008 22:05:42 +0100 Received: (qmail 81358 invoked from network); 24 Jan 2008 22:05:39 +0100 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 24 Jan 2008 22:05:39 +0100 Received: (qmail 50139 invoked by uid 1001); 24 Jan 2008 22:05:39 +0100 Date: Thu, 24 Jan 2008 22:05:39 +0100 From: Erik Trulsson To: Maxim Khitrov Message-ID: <20080124210539.GA50047@owl.midgard.homeip.net> Mail-Followup-To: Maxim Khitrov , "Aryeh M. Friedman" , freebsd-questions@freebsd.org References: <4798F1D0.3090009@gmail.com> <26ddd1750801241232l51792bf3ydc02e17e4be49d6e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <26ddd1750801241232l51792bf3ydc02e17e4be49d6e@mail.gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Originating-IP: 83.253.25.183 X-Scan-Result: No virus found in message 1JI9GY-0005j1-3x. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1JI9GY-0005j1-3x 9d032ecec395909014bac676dab14521 Cc: "Aryeh M. Friedman" , freebsd-questions@freebsd.org Subject: Re: speeding up buildworld/kernel X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2008 21:05:44 -0000 On Thu, Jan 24, 2008 at 03:32:18PM -0500, Maxim Khitrov wrote: > On Jan 24, 2008 3:15 PM, Aryeh M. Friedman wrote: > > I update my sources at least once a day and do buildworld/kernel just > > as often... It seems some stuff that needs not be recompiled is on > > every single run for example gcc and kerbos. I have NO_CLEAN in > > /etc/make.conf is there anything else I can do to speed stuff up... > > for ref here is my /etc/make.conf: > > > > CPUTYPE?=nocona > > KERNCONF=MONSTER > > NO_CLEAN= > > NO_LPR= > > # added by use.perl 2008-01-17 11:48:48 > > PERL_VER=5.8.8 > > PERL_VERSION=5.8.8 > > > > - -- > > Aryeh M. Friedman > > FloSoft Systems, Java Tool Developers > > Developer, not business, friendly > > http://www.flosoft-systems.com > > I might be wrong, but NO_CLEAN seems like a bad idea except in special > circumstances. Install ccache, but make sure you set > CCACHE_HASH_COMPILER environment variable to 1. That will make sure > that the cache stays valid if the compiler executable is overwritten > by an identical copy (as it would be on installworld). When the > compiler changes the cache will be repopulated on the next rebuild. You are indeed wrong. NO_CLEAN will work fine almost all the time - except in special circumstances. The few times it does not work one can always do a 'make clean' by hand first. (Or even faster: 'rm -fr /usr/obj/*') If you set WRKDIRPREFIX to some useful value you can do the same thing for the ports tree. Personally I always compile with -DNO_CLEAN and use 'rm -fr' to clean. I have never had problems originating with this. ccache is not very useful for buildworld, since among the first thing buildworld does is to build the compiler and then use the newly built compiler to compile the rest. I.e. the already installed compiler (which is the one ccache will handle) will not be used for most of the build thus removing almost all the advantage of ccache. It is supposed to be possible to use ccache for buildworld as well, but that would require a bit of hackery. As for speeding up the build even more there a couple of things that can be tried: You can add NO_PROFILE=true to make.conf if you do not need profiling libraries. Set CFLAGS/COPTFLAGS to -O instead of -O2. This should speed up the compiler a bit since it will no have to do as much work. This will make programs slightly less well optimized, but since the vast majority of the system binaries are not really CPU-bound anyway it is unlikely that any performance loss will be noticed. If you have more than one CPU-core in your machine (and an SMP-enabled kernel) you can use the -j flag to tell make to run several jobs in parallell. Just be aware that building with -j does get broken occasionaly and there is no promise that it will always be fixed quickly. If you do run into problems when building with -j, try without -j before sending any bug reports. -- Erik Trulsson ertr1013@student.uu.se