我要评分
获取效率
正确性
完整性
易理解

Downloading Clang

  1. Download LLVM 18.1.6.
    1
    https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.6/llvm-project-18.1.6.src.tar.xz --no-check-certificate wget
    
  2. Decompress the LLVM source package.
    1
    tar -xvf llvm-project-18.1.6.src.tar.xz
    
  3. Compile and install LLVM 18.1.6.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    cd llvm-project-18.1.6.src
    cd llvm
    mkdir build && cd build 
    cmake -DCMAKE_BUILD_TYPE=Release ..
    make -j `nproc` && make -j `nproc` install
    cd ../../clang
    mkdir build && cd build
    cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../../llvm -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;clang-tools-extra;openmp;lldb;lld"
    make -j `nproc` && make -j `nproc` install
    
  4. Check the Clang version.
    1
    clang --version