glfs/general/genlib/spirv-tools.xml
2024-01-19 22:39:35 +01:00

322 lines
9.4 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY spirv-tools-download-http "https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/vulkan-sdk-&spirv-tools-version;/SPIRV-Tools-&spirv-tools-version;.tar.gz">
<!ENTITY spirv-tools-download-ftp " ">
<!ENTITY spirv-tools-md5sum "f187bb132058995a5992a5a15c269bb1">
<!ENTITY spirv-tools-size "3.0 MB">
<!ENTITY spirv-tools-buildsize "70 MB">
<!ENTITY spirv-tools-time "1.0 SBU (with parallelism=8)">
]>
<sect1 id="spirv-tools" xreflabel="SPIRV-Tools-&spirv-tools-version;">
<?dbhtml filename="spirv-tools.html"?>
<title>SPIRV-Tools-&spirv-tools-version;</title>
<indexterm zone="spirv-tools">
<primary sortas="a-spirv-tools">SPIRV-Tools</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to SPIRV-Tools</title>
<para>
The <application>SPIRV-Tools</application> package contains libraries
and utilities for processing SPIR-V modules.
</para>
&lfs120_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Download (HTTP): <ulink url="&spirv-tools-download-http;"/>
</para>
</listitem>
<listitem>
<para>
Download (FTP): <ulink url="&spirv-tools-download-ftp;"/>
</para>
</listitem>
<listitem>
<para>
Download MD5 sum: &spirv-tools-md5sum;
</para>
</listitem>
<listitem>
<para>
Download size: &spirv-tools-size;
</para>
</listitem>
<listitem>
<para>
Estimated disk space required: &spirv-tools-buildsize;
</para>
</listitem>
<listitem>
<para>
Estimated build time: &spirv-tools-time;
</para>
</listitem>
</itemizedlist>
<bridgehead renderas="sect3">SPIRV-Tools Dependencies</bridgehead>
<bridgehead renderas="sect4">Required</bridgehead>
<para role="required">
<xref linkend="cmake"/> and
<xref linkend="spirv-headers"/>
</para>
</sect2>
<sect2 role="installation">
<title>Installation of SPIRV-Tools</title>
<note>
<para>
This tarball
<filename>SPIRV-Tools-&spirv-tools-version;.tar.gz</filename> will
extract to the directory
<filename class="directory">SPIRV-Tools-vulkan-sdk-&spirv-tools-version;</filename>.
</para>
</note>
<para>
Install <application>SPIRV-Tools</application> by running the following
commands:
</para>
<screen><userinput>mkdir build &amp;&amp;
cd build &amp;&amp;
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 .. &amp;&amp;
ninja</userinput></screen>
<para>
To test the results, issue: <command>ninja test</command>.
</para>
<para>
Now, as the &root; user:
</para>
<screen role="root"><userinput>ninja install</userinput></screen>
</sect2>
<sect2 role="commands">
<title>Command Explanations</title>
<para>
<parameter>-DSPIRV_WERROR=OFF</parameter>: This switch stops the build
system from treating warnings as errors.
</para>
<para>
<parameter>-DBUILD_SHARED_LIBS=ON</parameter>: This switch forces the
build system to install shared libraries instead of static libraries.
</para>
<para>
<parameter>-DSPIRV_TOOLS_BUILD_STATIC=OFF</parameter>: This switch
disables building static versions of the libraries.
</para>
<para>
<parameter>-DSPIRV-Headers_SOURCE_DIR</parameter>: This switch tells the
build system that <xref linkend="spirv-headers" role="nodep"/> is
installed in /usr. This is needed since the build system tries to use an
internal copy by default.
</para>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Libraries</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>
spirv-as,
spirv-cfg,
spirv-dis,
spirv-lesspipe.sh,
spirv-link,
spirv-lint,
spirv-objdump,
spirv-opt,
spirv-reduce, and
spirv-val
</seg>
<seg>
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
</seg>
<seg>
/usr/include/spirv-tools and
/usr/lib/cmake/SPIRV-Tools
</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="spirv-as">
<term><command>spirv-as</command></term>
<listitem>
<para>
creates a SPIR-V binary module from SPIR-V assembly text
</para>
<indexterm zone="spirv-tools spirv-as">
<primary sortas="b-spirv-as">spirv-as</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="spirv-cfg">
<term><command>spirv-cfg</command></term>
<listitem>
<para>
shows the control flow graph in "dot" format
</para>
<indexterm zone="spirv-tools spirv-cfg">
<primary sortas="b-spirv-cfg">spirv-cfg</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="spirv-dis">
<term><command>spirv-dis</command></term>
<listitem>
<para>
disassembles a SPIR-V binary module
</para>
<indexterm zone="spirv-tools spirv-dis">
<primary sortas="b-spirv-dis">spirv-dis</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="spirv-lesspipe.sh">
<term><command>spirv-lesspipe.sh</command></term>
<listitem>
<para>
automatically disassembles a .SPV file for 'less'
</para>
<indexterm zone="spirv-tools spirv-lesspipe.sh">
<primary sortas="b-spirv-lesspipe.sh">spirv-lesspipe.sh</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="spirv-link">
<term><command>spirv-link</command></term>
<listitem>
<para>
links SPIR-V binary files together
</para>
<indexterm zone="spirv-tools spirv-link">
<primary sortas="b-spirv-link">spirv-link</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="spirv-lint">
<term><command>spirv-lint</command></term>
<listitem>
<para>
checks a SPIR-V binary module for errors
</para>
<indexterm zone="spirv-tools spirv-lint">
<primary sortas="b-spirv-lint">spirv-lint</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="spirv-objdump">
<term><command>spirv-objdump</command></term>
<listitem>
<para>
dumps information from a SPIR-V binary
</para>
<indexterm zone="spirv-tools spirv-objdump">
<primary sortas="b-spirv-objdump">spirv-objdump</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="spirv-opt">
<term><command>spirv-opt</command></term>
<listitem>
<para>
performs optimizations on SPIR-V binary files
</para>
<indexterm zone="spirv-tools spirv-opt">
<primary sortas="b-spirv-opt">spirv-opt</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="spirv-reduce">
<term><command>spirv-reduce</command></term>
<listitem>
<para>
reduces a SPIR-V binary file
</para>
<indexterm zone="spirv-tools spirv-reduce">
<primary sortas="b-spirv-reduce">spirv-reduce</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="spirv-val">
<term><command>spirv-val</command></term>
<listitem>
<para>
validates a SPIR-V binary file
</para>
<indexterm zone="spirv-tools spirv-val">
<primary sortas="b-spirv-val">spirv-val</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="libSPIRV-Tools">
<term><filename class="libraryfile">libSPIRV-Tools.so</filename></term>
<listitem>
<para>
contains functions for processing SPIR-V modules
</para>
<indexterm zone="spirv-tools libSPIRV-Tools">
<primary sortas="c-libSPIRV-Tools">libSPIRV-Tools.so</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>