#### Beyond Linux® From Scratch (System V Edition) - Version 12.3

### Chapter 11. General Utilities

- Prev

  dos2unix-7.5.2

- Next

  Graphviz-12.2.1

- Up
- Home

# glslc from shaderc-2024.4

## Introduction to glslc

The glslc program is Google's command line compiler for OpenGL Shading Language/High Level Shading Language (GLSL/HLSL) to Standard Portable Intermediate Representation (SPIR-V).

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

### Package Information

- Download (HTTP): https://github.com/google/shaderc/archive/v2024.4/shaderc-2024.4.tar.gz

- Download MD5 sum: 31c4120c5bba0f79ad3bb6491be69d5a

- Download size: 224 KB

- Estimated disk space required: 4.0 MB

- Estimated build time: less than 0.1 SBU

### Glslc Dependencies

#### Required

CMake-3.31.5, Glslang-15.1.0, and SPIRV-Tools-1.4.304.1

## Installation of glslc

First, allow building with system Glslang-15.1.0 and SPIRV-Tools-1.4.304.1:

    sed '/build-version/d'   -i glslc/CMakeLists.txt            &&
    sed '/third_party/d'     -i CMakeLists.txt                  &&
    sed 's|SPIRV|glslang/&|' -i libshaderc_util/src/compiler.cc &&

    echo '"2024.4"' > glslc/src/build-version.inc

Now install glslc by running the following commands:

    mkdir build &&
    cd    build &&

    cmake -D CMAKE_INSTALL_PREFIX=/usr \
          -D CMAKE_BUILD_TYPE=Release  \
          -D SHADERC_SKIP_TESTS=ON     \
          -G Ninja ..
    ninja

Now, as the `root` user:

    install -vm755 glslc/glslc /usr/bin

## Contents

Installed Programs: glslc
Installed Libraries: None
Installed Directories: None

### Short Descriptions

glslc | compiles OpenGL Shading Language/High Level Shading Language (GLSL/HLSL) shaders to SPIR-V

- Prev

  dos2unix-7.5.2

- Next

  Graphviz-12.2.1

- Up
- Home