Notes on Installing LLVM 3.4 From Source Code

For some reason, I need LLVM for my development. In order to get latest version, I decided to compile from source code.

Download Packages

First step is to download packages that I need from llvm website.

wget http://llvm.org/releases/3.4/clang-3.4.src.tar.gz
wget http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz
wget http://llvm.org/releases/3.4/compiler-rt-3.4.src.tar.gz
wget http://llvm.org/releases/3.4/clang-tools-extra-3.4.src.tar.gz

Organizing

Unpack all of them and organize the src structure:

mv clang-3.4 llvm-3.4/tools/clang
mv clang-tools-extra-3.4 llvm-3.4/tools/clang/extra
mv compiler-rt-3.4 llvm-3.4/projects/compiler-rt

Compile

Create a build folder at the same level of llvm folder(mkdir build), and configure (../llvm-3.4/configure --enable-optimized).

Then,

make -j8

-j8 option maximizes compile performance on my machine.

After a while,

sudo make install

Finally, check the installation,

clang -v

I got the following:

clang version 3.4 (tags/RELEASE_34/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Cheers!

Reference 1.http://clang.llvm.org/get_started.html

Comments

Pages

Categories

Tags