1,下载源码
git clone --recursive https://github.com/ROCm/llvm-project.git
2, 配置cmake
cpp
cmake -G "Unix Makefiles" ../llvm \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;compiler-rt" \
-DLLVM_BUILD_EXAMPLES=ON -DLLVM_TARGETS_TO_BUILD="AMDGPU;NVPTX;host" \
-DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_RUNTIMES=all -DLLVM_BUILD_LLVM_DYLIB=ON \
-DCMAKE_INSTALL_PREFIX=../../local_d
3, 编译
make -j34 &
make install