SPIRV-Tools-1.3.275.0

Introduction to SPIRV-Tools

The SPIRV-Tools package contains libraries and utilities for processing SPIR-V modules.

This package is known to build and work properly using an LFS 12.1 platform.

Package Information

SPIRV-Tools Dependencies

Required

CMake-3.28.3 and SPIRV-Headers-1.3.275.0

Installation of SPIRV-Tools

[Note]

Note

This tarball SPIRV-Tools-1.3.275.0.tar.gz will extract to the directory SPIRV-Tools-vulkan-sdk-1.3.275.0.

Install SPIRV-Tools by running the following commands:

mkdir build &&
cd    build &&

cmake -DCMAKE_INSTALL_PREFIX=/usr     \
      -DCMAKE_BUILD_TYPE=Release      \
      -DSPIRV_WERROR=OFF              \
      -DBUILD_SHARED_LIBS=ON          \
      -DSPIRV_TOOLS_BUILD_STATIC=OFF  \
      -DSPIRV-Headers_SOURCE_DIR=/usr \
      -G Ninja .. &&
ninja

To test the results, issue: ninja test.

Now, as the root user:

ninja install

Command Explanations

-DSPIRV_WERROR=OFF: This switch stops the build system from treating warnings as errors.

-DBUILD_SHARED_LIBS=ON: This switch forces the build system to install shared libraries instead of static libraries.

-DSPIRV_TOOLS_BUILD_STATIC=OFF: This switch disables building static versions of the libraries.

-DSPIRV-Headers_SOURCE_DIR: This switch tells the build system that SPIRV-Headers-1.3.275.0 is installed in /usr. This is needed since the build system tries to use an internal copy by default.

Contents

Installed Programs: spirv-as, spirv-cfg, spirv-dis, spirv-lesspipe.sh, spirv-link, spirv-lint, spirv-objdump, spirv-opt, spirv-reduce, and spirv-val
Installed Libraries: libSPIRV-Tools-diff.so, libSPIRV-Tools-link.so, libSPIRV-Tools-lint.so, libSPIRV-Tools-opt.so, libSPIRV-Tools-reduce.so, libSPIRV-Tools-shared.so, and libSPIRV-Tools.so
Installed Directories: /usr/include/spirv-tools and /usr/lib/cmake/SPIRV-Tools

Short Descriptions

spirv-as

creates a SPIR-V binary module from SPIR-V assembly text

spirv-cfg

shows the control flow graph in "dot" format

spirv-dis

disassembles a SPIR-V binary module

spirv-lesspipe.sh

automatically disassembles a .SPV file for 'less'

spirv-link

links SPIR-V binary files together

spirv-lint

checks a SPIR-V binary module for errors

spirv-objdump

dumps information from a SPIR-V binary

spirv-opt

performs optimizations on SPIR-V binary files

spirv-reduce

reduces a SPIR-V binary file

spirv-val

validates a SPIR-V binary file

libSPIRV-Tools.so

contains functions for processing SPIR-V modules