Install Clang in CentOS
I. Preparations for environment before installing Clang in CentOS for Minimal
1. install gcc: yum install gcc
2. install g ++: yum install gcc-c ++
3. Install cmake in source code:
The reason for using the source code installation is that the yum default installation version is too low, and Clang has requirements for the cmake version.
Source code: https://cmake.org/download/
Decompress the package and run it in the cmake directory.
1)./bootstrap
2) gmake
3) make install
4) cmake -- version
4. install perl: yum install perl
Since the pod2html command is required during Clang script installation, perl must be installed.
Ii. Clang installation (3.6.0)
1, source code download,: http://llvm.org/releases/download.html
Download the following four files:
2. decompress the four files after the download is complete.
1)clang-tools-extra-3.6.0.src.tar. Unzip the tool and rename it as extra.
2)cfe-3.6.0.src.tar. Unzip the file and rename it clang.
32.16llvm-3.6.0.src.tar. decompress the package and rename it llvm.
4)compiler-rt-3.6.0.src.tar. decompress the package and name it compiler-rt.
Store the four files in the following directory structure:
Compiler-rt is placed under the projects directory under the llvm directory. And so on
3. Clang Installation
1)
1
./configure--enable-optimized--enable-targets=host-only--prefix=/home/YouPathToInstall/llvm
2) make
3) make install
4) clang -- version
Note: Clang has version requirements for gcc, g ++, cmake, and so on. Try not to install the version too low.
References: http://blog.csdn.net/u012675539/article/details/51489078