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

221.1. libggml-0.25.3

ggml, the tensor library under llama.cpp and whisper.cpp: CPU variants, OpenBLAS and Vulkan backends as loadable modules

0.25.3-1 · MIT · 8.2 SBU · 62.2 MiB, 44 files · 42_graphics, 43 of 189 · ports/core/ai/libggml

Homepage: https://github.com/ggml-org/ggml

Why it is in KDOS. The comment above it in script/phases/42_graphics/packages.d/ai.txt:

The tensor library whisper.cpp runs on, shared with llama.cpp.

Depends on: cmake, ninja, openblas, vulkan-headers, vulkan-loader, spirv-headers, shaderc, glslang.

Required by (2): llama.cpp, whisper.cpp.

Sources: libggml-0.25.3.tar.gz (3.9 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install libggml'

build.sh:

cmake -S . -B build -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DBUILD_SHARED_LIBS=ON \
	-DGGML_BUILD_TESTS=OFF \
	-DGGML_BUILD_EXAMPLES=OFF \
	-DGGML_ALL_WARNINGS=OFF \
	-DGGML_NATIVE=OFF -DGGML_CCACHE=OFF -DGGML_LTO=OFF \
	-DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON \
	-DGGML_BACKEND_DIR=/usr/lib/ggml \
	-DGGML_LLAMAFILE=ON \
	-DGGML_OPENMP=ON \
	-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS \
	-DGGML_VULKAN=ON -DGGML_CUDA=OFF -DGGML_HIP=OFF -DGGML_MUSA=OFF \
	-DGGML_SYCL=OFF -DGGML_OPENCL=OFF -DGGML_WEBGPU=OFF -DGGML_RPC=OFF
grep -q '^GGML_OPENMP_ENABLED:INTERNAL=ON$' build/CMakeCache.txt ||
	{ echo "libggml: OpenMP not found at configure" >&2; exit 1; }
cmake --build build
DESTDIR=$PKG cmake --install build
for mod in libggml-blas.so libggml-cpu-x64.so libggml-cpu-haswell.so \
	libggml-vulkan.so; do
	[ -f "$PKG/usr/lib/ggml/$mod" ] ||
		{ echo "libggml: $mod was not built" >&2; exit 1; }
done
[ -f "$PKG/usr/lib/cmake/ggml/ggml-config.cmake" ] ||
	{ echo "libggml: no CMake package for find_package(ggml)" >&2; exit 1; }

Libraries: libggml-base.so, libggml.so.

Directories: /usr/lib/cmake/ggml, /usr/lib/ggml, /usr/share/licenses/libggml.