OpenSUSE 13: Build LLVM/Clang from svn repository

For using latest LLVM/Clang, this article will describe building LLVM/Clang from svn repository.

1 Install cmake 3.6

Latest LLVM/Clangs needs cmake 3.4 or later. Install cmake 3.6 with this.

2 Download LLVM/Clang from svn repository

Acording to Clang page, download source code except libcxx.

$ svn co llvm
$ cd llvm/tools
$ svn co clang
$ cd clang/tools
$ svn co extra
$ cd ../../../projects
$ svn co compiler-rt
$ cd ../..

3 Build LLVM/Clang

Create build directory, build LLVM/Clang as a release binary and install binary to /usr/local.

$ mkdir
$ cd
$ cmake -G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX=/usr/local ../llvm
$ make
$ sudo make install