SPIRV-LLVM-Translator-22.1.5

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

### Chapter 9. General Libraries

- Prev

  SPIRV-Tools-1.4.357.0

- Next

  Talloc-2.5.0

- Up
- Home

# SPIRV-LLVM-Translator-22.1.5

## Introduction to SPIRV-LLVM-Translator

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.

### Note

This version of BLFS may not build or run some packages properly if LFS or dependencies have been updated since the most recent stable version of the System V books.

### Package Information

- Download (HTTP): https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/v22.1.5/SPIRV-LLVM-Translator-22.1.5.tar.gz

- Download MD5 sum: 8bdf03a2f7d90da52e358ac78b3e9959

- Download size: 1.9 MB

- Estimated disk space required: 48 MB

- Estimated build time: 0.5 SBU (with parallelism=4)

### SPIRV-LLVM-Translator Dependencies

#### Required

libxml2-2.15.3, LLVM-22.1.8, and SPIRV-Tools-1.4.357.0

## Installation of SPIRV-LLVM-Translator

Install SPIRV-LLVM-Translator by running the following commands:

    mkdir build &&
    cd    build &&

    cmake -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 Ninja ..                                    &&
    ninja

This package does not come with a test suite.

Now, as the `root` user:

    ninja install

## Command Explanations

`-D BUILD_SHARED_LIBS=ON`: This parameter forces building shared versions of the libraries.

`-D CMAKE_SKIP_INSTALL_RPATH=ON`: This switch makes cmake remove hardcoded library search paths (rpath) when installing a binary executable file or a shared library. This package does not need rpath once it's installed into the standard location, and rpath may sometimes cause unwanted effects or even security issues.

`-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.

## Contents

Installed Programs: llvm-spirv
Installed Libraries: libLLVMSPIRVLib.so
Installed Directories: /usr/include/LLVMSPIRVLib

### Short Descriptions

llvm-spirv | converts between LLVM IR and SPIR-V code
`libLLVMSPIRVLib.so` | contains functions that convert between LLVM IR and SPIR-V code

- Prev

  SPIRV-Tools-1.4.357.0

- Next

  Talloc-2.5.0

- Up
- Home