Note that some of the LLVM projects can only be built with clang. I won't get into bootstrapping issues, but if the build fails, you can winnow down the list of projects from all
to a subset of the following: clang
, clang-tools-extra
, compiler-rt
, cross-project-tests
, libc
, libclc
, libcxx
, libcxxabi
, libunwind
, lld
, lldb
, openmp
, parallel-libs
, polly
, pstl
.
These are the steps I use taken from here:
mkdir llvmcd llvmgit clone https://github.com/llvm/llvm-project.git .git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator.gitgit clone https://github.com/intel/opencl-clang.gitgit clone https://github.com/KhronosGroup/SPIRV-Headers.git ./llvm/projects/SPIRV-Headersgit clone https://github.com/intel/vc-intrinsics.git ./llvm/projects/vc-intrinsicsmkdir buildcd buildcmake -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=”X86″ -DLLVM_ENABLE_PROJECTS=”clang” -DLLVM_EXTERNAL_PROJECTS=”llvm-spirv;opencl-clang” -DLLVM_EXTERNAL_LLVM_SPIRV_SOURCE_DIR=”../SPIRV-LLVM-Translator” -DLLVM_EXTERNAL_OPENCL_CLANG_SOURCE_DIR=”../opencl-clang” ../llvmmake opencl-clang