网站设计协议,建网站什么赚钱,电影网站这么做关键词,wordpress显示投稿者本教程使用的操作系统是Ubuntu Linux 18.04.2 LTS版本#xff0c;编译器是GCC 6.5.0(不用新版的原因是某些代码不支持更高的版本)#xff0c;要编译的LLVM源代码是8.0.0。1、安装必要的软件。它们是#xff1a;build-essential/gcc-6/g-6/cmake/swig/python-swigpk/libxml2/…本教程使用的操作系统是Ubuntu Linux 18.04.2 LTS版本编译器是GCC 6.5.0(不用新版的原因是某些代码不支持更高的版本)要编译的LLVM源代码是8.0.0。1、安装必要的软件。它们是build-essential/gcc-6/g-6/cmake/swig/python-swigpk/libxml2/libxml2-dev/libncurse5/libncurse-dev/libedit-dev/libpython-dev还可以选择安装doxygen/ocaml/python-sphinx/git/libopenmpi-dev/libelf-dev/libffi-dev/python-pycuda。打开终端输入以下命令sudo apt-get install build-essential gcc-6 g-6 cmake swig python-swiglpk libxml2 libxml2-dev libncurses5 libncurses5-dev libedit-dev libpython-dev另外还要安装z3安装方法看这里。切换gcc/g版本的方法看这里。2、下载LLVM/Clang等全部源代码。(下载地址)3、解压LLVM/Clang等全部源代码(不包括test-suite)。首先解压llvm主程序源代码tar xf llvm-8.0.0.src.tar.xz然后进入llvm主目录cd llvm-8.0.0.src创建几个子目录用于存放LLVM子项目的源代码mkdir -p tools/clangmkdir -p tools/clang/tools/extramkdir -p tools/lldmkdir -p tools/lldbmkdir -p tools/pollymkdir -p projects/compiler-rtmkdir -p projects/libcxxmkdir -p projects/libcxxabimkdir -p projects/libunwindmkdir -p projects/openmp开始解压所有的子项目tar xf ../cfe-8.0.0.src.tar.xz -C tools/clang --strip-components1tar xf ../clang-tools-extra-8.0.0.src.tar.xz -C tools/clang/tools/extra --strip-components1tar xf ../lld-8.0.0.src.tar.xz -C tools/lld --strip-components1tar xf ../lldb-8.0.0.src.tar.xz -C tools/lldb --strip-components1tar xf ../polly-8.0.0.src.tar.xz -C tools/polly --strip-components1tar xf ../compiler-rt-8.0.0.src.tar.xz -C projects/compiler-rt --strip-components1tar xf ../libcxx-8.0.0.src.tar.xz -C projects/libcxx --strip-components1tar xf ../libcxxabi-8.0.0.src.tar.xz -C projects/libcxxabi --strip-components1tar xf ../libunwind-8.0.0.src.tar.xz -C projects/libunwind --strip-components1tar xf ../openmp-8.0.0.src.tar.xz -C projects/openmp --strip-components14、编译LLVM/Clang等全部源代码。切换到终端执行以下命令cd ..mkdir buildcd buildsudo mkdir /xxxsudo cmake -DCMAKE_INSTALL_PREFIX/xxx ../llvm-8.0.0.src(这里的xxx是你想要安装LLVM的目录名字可以随便取如果不加-DCMAKE_INSTALL_PREFIX参数的话默认应该是安装到/usr里)sudo cmake --build .(开始编译。编译过程很长需要几个小时具体时间和CPU性能有关)sudo cmake --build . --target install(安装LLVM/Clang等所有已编译好的软件。安装目录在上面指定了)