Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

64.3. libclc-23.1.2

Library requirements of the OpenCL C programming language

23.1.2-1 · Apache-2.0 WITH LLVM-exception · 3.1 SBU · 51.7 MiB, 12 files · 40_lang, 179 of 186 · ports/core/toolchain/libclc

Homepage: https://libclc.llvm.org/

Depends on: llvm, clang, cmake, ninja.

Required by (1): mesa-opencl.

Sources: libclc-23.1.2.tar.xz (170.9 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/40_lang/phase.env && kpkg install libclc'

build.sh:

for triple in amdgcn-amd-amdhsa-llvm nvptx64-nvidia-cuda \
		spirv32-unknown-unknown spirv64-unknown-unknown; do
	cmake -S libclc -B build-$triple -G Ninja \
		-D CMAKE_INSTALL_PREFIX=/usr \
		-D CMAKE_BUILD_TYPE=Release \
		-D CMAKE_C_FLAGS_RELEASE="$CFLAGS -DNDEBUG" \
		-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS -DNDEBUG" \
		-D CMAKE_CLC_COMPILER=/usr/bin/clang \
		-D LLVM_DIR=/usr/lib/cmake/llvm \
		-D LLVM_DEFAULT_TARGET_TRIPLE=$triple \
		-D LIBCLC_USE_SPIRV_BACKEND=ON \
		-D LLVM_INCLUDE_TESTS=OFF

	cmake --build build-$triple
	DESTDIR=$PKG cmake --install build-$triple
done

ln -s spirv32-unknown-unknown/libclc.spv "$PKG/usr/share/clc/spirv-mesa3d-.spv"
ln -s spirv64-unknown-unknown/libclc.spv "$PKG/usr/share/clc/spirv64-mesa3d-.spv"
install -d "$PKG/usr/share/pkgconfig"
cat > "$PKG/usr/share/pkgconfig/libclc.pc" <<PC
prefix=/usr
datarootdir=\${prefix}/share
datadir=\${datarootdir}
pkgdatadir=\${datadir}/clc
libexecdir=\${pkgdatadir}

Name: libclc
Description: Library requirements of the OpenCL C programming language
Version: $version
PC
chmod 644 "$PKG/usr/share/pkgconfig/libclc.pc"

Directories: /usr/share/clc, /usr/share/licenses/libclc.