Install Clang in CentOS

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.