The SPIRV-LLVM-Translator package contains a library and utility for converting between LLVM IR and SPIR-V code. This package currently only supports the OpenCL/Compute version of SPIR-V.
This package is known to build and work properly using an LFS 12.4 platform.
Download (HTTP): https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/v21.1.2/SPIRV-LLVM-Translator-21.1.2.tar.gz
Download SHA256 Sum: 8c91542b579a3b27b7aeae1db12004eb412c9ed9bdff0a29ee862c3551cadfe3
Download MD5 sum: 78273803c122d95b172dcffd324ce2d0
Archive size: 1.8 MB
Download size: 14,720.9 KB
Estimated disk space required: 37,430.2 KB
Estimated build time: 1.42 SBU
Prepare SPIRV-LLVM-Translator by running the following commands:
cmake -B build -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=ON \
-D CMAKE_SKIP_INSTALL_RPATH=ON \
-D LLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr \
-G NinjaNow Build the package, issue:
ninja -C build
This package does not come with a test suite.
Now Install, as the root user:
ninja -C build install
-D BUILD_SHARED_LIBS=ON: This parameter forces
building shared versions of the libraries.
-D LLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=/usr:
This parameter allows the build system to use the version of
SPIRV-Headers that should have been installed as a dependency of
SPIRV-Tools, instead of redownloading an unnecessary copy of the
headers.