Compile to compile and install llvm-clang and unzip tollvm-clang
Download llvm source code
wget http://llvm.org/releases/3.6.0/llvm-3.6.0.src.tar.xzmv llvm-3.6.0.src llvm
Download clang source code
cd llvm/toolswget http://llvm.org/releases/3.6.0/cfe-3.6.0.src.tar.xztar xf cfe-3.6.0.src.tar.xzmv cfe-3.6.0.src clang
Download the source code of compiler-rt
cd ../projectswget http://llvm.org/releases/3.6.0/compiler-rt-3.6.0.src.tar.xztar xf compiler-rt-3.6.0.src.tar.xzmv compiler-rt-3.6.0.src compiler-rt
Configure compilation options
cd .../configure --enable-optimized CC=gcc CXX=g++
Compile llvm
make -j2
After successful compilation, the following message is displayed:
llvm[0]: ***** Completed Release+Asserts Build
Install the compiled llvm
make install
Will be installed in/usr/local/bin
7) Check clang version
Clang-version
Clang version 3.6.0 (tags/RELEASE_360/final)
If the old version is still used, point/usr/bin/clang to clang 3.6.0:
ln -s /usr/local/bin/clang /usr/bin/clang