The docs for LLVM don’t seem to be that great when it comes to compiling this stuff from scratch, so here’s what I did, as one big script chunk. You can probably copy and paste this, but I make no promises that it will work, only that it Works on My Machine with OS Ubuntu 9.10.cd; mkdir llvm; cd llvm
unset LD_LIBRARY_PATH
unset LIBRARY_PATH
unset C_INCLUDE_PATH
wget http://llvm.org/releases/2.6/llvm-gcc-4.2-2.6.source.tar.gz
wget http://llvm.org/releases/2.6/llvm-2.6.tar.gz
tar zxf llvm-2.6.tar.gz
tar zxf llvm-gcc-4.2-2.6.source.tar.gz
cd llvm-2.6
./configure --prefix=$HOME/local/llvm --disable-optimized # debug version
make -j3 # alter to suite your system, usually 1 + number of cores
make installcd ..
mkdir llvm-gcc4.2-2.6.bulid
cd llvm-gcc4.2-2.6.bulid
../llvm-gcc4.2-2.6.source/configure --prefix=$HOME/local/llvm-gcc --enable-languages=c,c++ --program-prefix=llvm-
--enable-llvm=$HOME/local/llvm
make -j3 all
make install
cd ~/local/llvm-gcc/bin
./llvm-gcc -v
Please note: the llvm-gcc build path cannot be the source path, otherwise, it may fail to compile
And that should output something like:Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ./configure --prefix=/home/xxx/local/llvm-gcc --enable-languages=c,c++ --program-prefix=llvm- --enable-llvm=
/home/xxx/local/llvm
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5636) (LLVM build)
LLVM is up and running though, so happy LLVM’ing!

Post a Comment