Compile to compile and install llvm-clang and unzip tollvm-clang

Source: Internet
Author: User

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

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.