SPIRV-Tools-1.3.296.0

Introduction to SPIRV-Tools

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

[Note]

Note

Development versions of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable versions of the books.

Package Information

SPIRV-Tools Dependencies

Required

CMake-3.31.0 and SPIRV-Headers-1.3.296.0

Installation of SPIRV-Tools

[Note]

Note

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

Install SPIRV-Tools by running the following commands:

mkdir build &&
cd    build &&

cmake -D CMAKE_INSTALL_PREFIX=/usr     \
      -D CMAKE_BUILD_TYPE=Release      \
      -D SPIRV_WERROR=OFF              \
      -D BUILD_SHARED_LIBS=ON          \
      -D SPIRV_TOOLS_BUILD_STATIC=OFF  \
      -D SPIRV-Headers_SOURCE_DIR=/usr \
      -G Ninja .. &&
ninja

To test the results, issue: ninja test.

Now, as the root user:

ninja install

Command Explanations

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

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

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

-D SPIRV-Headers_SOURCE_DIR: This switch tells the build system that SPIRV-Headers-1.3.296.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