intel / intel-graphics-compiler

Other
606 stars 158 forks source link

cannot create target "LLVMSPIRVLib" #141

Closed dkurt closed 4 years ago

dkurt commented 4 years ago

Building IGC from source:

git clone https://github.com/intel/intel-graphics-compiler igc --depth 1
git clone https://github.com/intel/gmmlib --depth 1
git clone https://github.com/intel/vc-intrinsics --depth 1
git clone -b release/9.x https://github.com/llvm/llvm-project llvm-project --depth 1
git clone -b ocl-open-90 https://github.com/intel/opencl-clang llvm-project/llvm/projects/opencl-clang --depth 1
git clone -b llvm_release_90 https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/llvm-spirv --depth 1
git clone https://github.com/intel/llvm-patches llvm_patches --depth 1
mv llvm-project/clang llvm-project/llvm/tools/

# Compile native gmmlib (need for ocloc)
cd gmmlib && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc) install

# Compile native IGC (need for ocloc)
mkdir -p build_native_igc && cd build_native_igc
cmake \
-DCMAKE_BUILD_TYPE=Release \
../igc && make -j$(nproc) install

error:

CMake Error at /build_native_igc/IGC/llvm/src/cmake/modules/AddLLVM.cmake:497 (add_library):
  add_library cannot create target "LLVMSPIRVLib" because an imported target
  with the same name already exists.
Call Stack (most recent call first):
  /build_native_igc/IGC/llvm/src/cmake/modules/AddLLVM.cmake:708 (llvm_add_library)
  lib/SPIRV/CMakeLists.txt:1 (add_llvm_library)

CMake Error at /build_native_igc/IGC/llvm/src/cmake/modules/AddLLVM.cmake:615 (target_link_libraries):
  Cannot specify link libraries for target "LLVMSPIRVLib" which is not built
  by this project.
Call Stack (most recent call first):
  /build_native_igc/IGC/llvm/src/cmake/modules/AddLLVM.cmake:708 (llvm_add_library)
  lib/SPIRV/CMakeLists.txt:1 (add_llvm_library)

-- Configuring incomplete, errors occurred!
See also "/build_native_igc/IGC/VectorCompiler/SPIRVDLL/src/SPIRVDLL_EX-build/CMakeFiles/CMakeOutput.log".
IGC/VectorCompiler/CMakeFiles/SPIRVDLL_EX.dir/build.make:126: recipe for target 'IGC/VectorCompiler/SPIRVDLL/src/SPIRVDLL_EX-stamp/SPIRVDLL_EX-configure' failed
make[2]: *** [IGC/VectorCompiler/SPIRVDLL/src/SPIRVDLL_EX-stamp/SPIRVDLL_EX-configure] Error 1
CMakeFiles/Makefile2:33400: recipe for target 'IGC/VectorCompiler/CMakeFiles/SPIRVDLL_EX.dir/all' failed
make[1]: *** [IGC/VectorCompiler/CMakeFiles/SPIRVDLL_EX.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
agrachiv commented 4 years ago

LLVM 9 SPIRV build works since commit 0249ca914f920a51c50aa6e2739cf35d95fdc3dd