SPIRV-Tools-1.4.350.0

#### Beyond Linux® From Scratch (System V Edition) - Version r13.0-791

### Chapter 9. General Libraries

- Prev

  SPIRV-Headers-1.4.350.0

- Next

  SPIRV-LLVM-Translator-22.1.2

- Up
- Home

# SPIRV-Tools-1.4.350.0

## Introduction to SPIRV-Tools

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

### 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

- Download (HTTP): https://github.com/KhronosGroup/SPIRV-Tools/archive/vulkan-sdk-1.4.350.0/SPIRV-Tools-vulkan-sdk-1.4.350.0.tar.gz

- Download MD5 sum: 98eb2b3150abc9b6555ffba9818d41b3

- Download size: 3.3 MB

- Estimated disk space required: 66 MB

- Estimated build time: 0.6 SBU (with tests; both using parallelism=8)

### SPIRV-Tools Dependencies

#### Required

CMake-4.3.3 and SPIRV-Headers-1.4.350.0

## Installation of SPIRV-Tools

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.4.350.0 is installed in /usr. This is needed since the build system tries to use a copy at `external/spirv-headers` in the source directory by default and the copy is not shipped (i.e. you need to manually extract SPIRV-Headers-1.4.350.0 there if you want to build with the copy).

## 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

- Prev

  SPIRV-Headers-1.4.350.0

- Next

  SPIRV-LLVM-Translator-22.1.2

- Up
- Home