当前位置:   article > 正文

关于Clang

关于Clang

项目主页:http://clang.llvm.org/

安装

1.yum/apt-get

yum install clang
or
apt-get install clang

 

2.编译安装

所需工具:GCC Python Subversion

安装步骤:
1.检出源码: LLVM  Clang  extra-Clang-tools(可选)  Compiler-RT
2.编译安装:configure && make && make install

根据官方文档提供的安装方法,提供一个shell脚本:
1.创建一个目录,用于编译安装
2.拷贝clang_install.sh至该目录
3.进入该目录,运行clang_install.sh

#!/bin/sh
 
# clean directories
rm -rf llvm build
 
# checkout LLVM
echo "--------------------------------------------------"
echo "checkout LLVM"
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
 
# checkout Clang
echo "--------------------------------------------------"
echo "checkout Clang"
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ../..
 
# checkout extra Clang tools (optional)
echo "--------------------------------------------------"
echo "checkout extra Clang tools"
cd llvm/tools/clang/tools
svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
cd ../..
cd ../.. # checkout Compiler-RT echo "--------------------------------------------------" echo "checkout Compiler-RT" cd llvm/projects svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt cd ../.. # build LLVM and Clang echo "--------------------------------------------------" echo "build LLVM and Clang" mkdir build cd build ../llvm/configure --enable-optimized make -j 10 make install exit 0

 

转载于:https://www.cnblogs.com/caosiyang/archive/2013/01/25/2876165.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/239963
推荐阅读
相关标签
  

闽ICP备14008679号