Linux c ++ vim environment to build the series (2) - Ubuntu18.04.4 compile and install llvm clang

2. source compiler installation llvm clang

参考网址: https://llvhttps://m.org/docs/GettingStarted.html#getting-started-with-llvm

  1. Installation Preparation Environment

    # clang的编译需要gcc等
    sudo apt install gcc
    sudo apt install g++
    sudo apt install make
    sudo apt install cmake 
  2. Download and compile

    git clone https://github.com/llvm/llvm-project.git
    cd llvm-project
    mkdir build
    cd build
    
    cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../llvm -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;compiler-rt;clang-tools-extra;openmp;lldb;lld" 
    
    make -j2
    make install
  3. test

    clang --version
    # 截至20200301最新版是11.0

note:

  1. cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../llvm: This step is not to change
  2. DLLVM_ENABLE_PROJECTS: There select the option you want to install, separated by semicolons, see URL selection, usually choose clang;libcxx;libcxxabi;compiler-rt;clang-tools-extra, I'm afraid of what the latter have to install trouble, they chose one of the lldb (debugging), lld (link optimization)

Guess you like

Origin www.cnblogs.com/whuwzp/p/ubuntu_vim_2.html