Closed tgurr closed 2 years ago
The following appears to at least work around the issue (for me):
CMake Options:
-DSPIRVLLVMTranslator_INCLUDE_DIR:PATH=/usr/$(exhost --target)/lib/llvm/13/include
-DSPIRVLLVMTranslator_Library:PATH=/usr/$(exhost --target)/lib/llvm/13/lib/libLLVMSPIRVLib.a
Code changes:
sed \
-e "s:LLVMSPIRVLib.h:LLVMSPIRVLib/LLVMSPIRVLib.h:g"
-i "${CMAKE_SOURCE}"/IGC/VectorCompiler/lib/Driver/SPIRVWrapper.cpp
Further testing showed that passing the following CMake options
-DSPIRVLLVMTranslator_INCLUDE_DIR:PATH=/usr/$(exhost --target)/lib/llvm/13/include/LLVMSPIRVLib
-DSPIRVLLVMTranslator_Library:PATH=/usr/$(exhost --target)/lib/llvm/13/lib/libLLVMSPIRVLib.a
also seem to be enough.
While it's unfortunate it doesn't work out of the box with plain pkg-config (even when trying to pass the additional search location /usr/x86_64-pc-linux-gnu/lib/llvm/13/lib/pkgconfig
as stated above I'm closing the issue as with the correct CMake options it's possible to build without any further changes. The thing which was not obvious and caused the most problems is that SPIRVLLVMTranslator_Library
expects the library itself and not a search path like usually seen, that look me a lot of time to figure out as the error messages weren't quite obvious.
When relying on CMake/pkg-config SPIRV-LLVM-Translator isn't found at all:
When trying to manually pass relevant CMake options like:
igc fails to build with:
CMakeCache.txt from build directory:
Additional information: