Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jul 2012 11:13:21 +0300
From:      Volodymyr Kostyrko <c.kworr@gmail.com>
To:        freebsd-questions@FreeBSD.org
Subject:   Re: how to speed up port make??
Message-ID:  <5010FC21.3020207@gmail.com>
In-Reply-To: <1343228557.99992.androidMobile@web140705.mail.bf1.yahoo.com>
References:  <1343228557.99992.androidMobile@web140705.mail.bf1.yahoo.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Mr U wrote:
> is it possible to speed up port make ??
> i want to install openbox and xorg on a Pentium 4 and 2gb ram,
> compiling xorg takes about 2 hours

1. You can use devel/ccache to cache compiled data. This way when you 
are compiling anything for a second time you'll get a big speed boost. 
Consider compiling kernel+world in 1 hour instead of 8 hours.

1a. If using clang setenv CCACHE_CPP2.

2. Try switching to clang, it has lower memory requirements and 
compilation speed. Be ready to disable it for some ports that have 
nonstandard code.

2a. Don't try to build world with clang if you need 
wine/openoffice/libreoffice. They are known not to work on a world built 
with clang.

3. Use tmpfs for port building. I always use a big swap and point 
WRKSRCDIR to /tmp/ports.

4. Finetune your compilation flags. The safest way to select one is to 
run `(gcc|gcc46|clang) -E -v -march=native - < /dev/null` and select the 
lowest -march value then write it down to /etc/make.conf as CPUTYPE.

5. Use port management tools like portmaster. When building big ports it 
will split building down to individual ports cleaning disk between 
builds. This keeps cache from holding temporary files.

-- 
Sphinx of black quartz judge my vow.



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?5010FC21.3020207>