[cfe-dev] Slowness of clang build

Larry Evans cppljevans at suddenlink.net
Sat Dec 29 13:21:05 PST 2012


On 12/29/12 10:47, Edward Diener wrote:
> I am periodically retrieving the latest sources from the llvm/clang
> repository, as specified in the Getting Started page.
> 
> When I do a build of clang, through the 'make' command from the build
> directory, the build runs very slow. Evidently the default is a
> Debug+Assert build. Compiling a single source file averages 5-10 seconds
> and overall the build takes hours considering how many modules must be
> built. It is all successful in the end and when I am finished I have the
> latest clang, which is great.
> 
> I have plenty of memory, plenty of disk space, a fairly fast CPU, and am
> doing the build on Fedora 17 with hardly any other applications running.
> 
> Why is compiling clang so slow ? Is there any way to speed up the build
> ? If I do a release build ( how ? )is it significantly quicker ?

Edward, I just finished a build from the start(i.e. everything had to be
compiled).  It was done with my system's gcc compiler, AFAICT:

~/download/llvm/pre-releases/3.2/rc3/download/build_debug $ g++ -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.4.3-4ubuntu5.1'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--enable-shared --enable-multiarch --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4
--program-suffix=-4.4 --enable-nls --enable-clocale=gnu
--enable-libstdcxx-debug --enable-plugin --enable-objc-gc
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)

And the complete build, with configuration set with:

#!/bin/bash
this_dir=`pwd`
$this_dir/../llvm.src/configure \
  --prefix=$this_dir/../install_debug \
  --enable-optimized=NO \
  --enable-assertions=YES \
  --enable-debug-runtime=YES \
  --enable-debug-symbols=YES \
  #

completed in about 1 hr.  I've got 2Gig memory and 2 cpu's
and plenty of disk space.

-regards,

Larry





More information about the cfe-dev mailing list