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

196.9. embree-4.4.1

Intel's CPU ray-tracing kernels for renderers, from SSE2 to AVX-512, chosen at run time

Version 4.4.1, release 1
Shelf 3d — 3D modelling, animation, voxel and mesh tools and libraries, and scientific visualisation
Phase 42_graphics (Graphics Stack), 25 of 189 in build order
Licence Apache-2.0
Homepage https://www.embree.org/
Build time 18.0 SBU
Installed size 40.0 MiB in 183 files
Recipe ports/core/3d/embree/kpkgbuild

About

Embree is Intel’s library of ray-tracing kernels for the processor: the acceleration structures and the ray intersection tests a renderer builds on. In KDOS Blender builds its Cycles renderer with it (WITH_CYCLES_EMBREE). Kernels for every x86-64 instruction set from SSE2 to AVX-512 are compiled into the one library, and it chooses the widest the running processor has.

Sources

Dependencies

Depends on: cmake, ninja, ispc, onetbb.

Required by (1): blender.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

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

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/3d/embree.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/3d/embree
echo 'dcf338cc61b636c871ccf370e673bfd380c5ecb71ce49ad50f28e1d4ec9995dc  embree-4.4.1.tar.gz' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/embree
SRC=$SRC_ROOT/embree-4.4.1
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf embree-4.4.1.tar.gz -C "$SRC" --strip-components=1

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

cmake -B build -G Ninja \
	-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DEMBREE_STATIC_LIB=OFF \
	-DEMBREE_ZIP_MODE=OFF \
	-DEMBREE_INSTALL_DEPENDENCIES=OFF \
	-DEMBREE_TUTORIALS=OFF \
	-DEMBREE_TASKING_SYSTEM=TBB \
	-DEMBREE_ISPC_SUPPORT=ON \
	-DEMBREE_ISPC_EXECUTABLE=/usr/bin/ispc \
	-DEMBREE_SYCL_SUPPORT=OFF \
	-DEMBREE_ISA_SSE2=ON \
	-DEMBREE_ISA_SSE42=ON \
	-DEMBREE_ISA_AVX=ON \
	-DEMBREE_ISA_AVX2=ON \
	-DEMBREE_ISA_AVX512=ON \
	-DEMBREE_STACK_PROTECTOR=ON \
	-DEMBREE_RAY_MASK=ON \
	-DEMBREE_BACKFACE_CULLING=OFF \
	-DEMBREE_FILTER_FUNCTION=ON \
	-DEMBREE_GEOMETRY_TRIANGLE=ON \
	-DEMBREE_GEOMETRY_QUAD=ON \
	-DEMBREE_GEOMETRY_CURVE=ON \
	-DEMBREE_GEOMETRY_SUBDIVISION=ON \
	-DEMBREE_GEOMETRY_USER=ON \
	-DEMBREE_GEOMETRY_INSTANCE=ON \
	-DEMBREE_GEOMETRY_INSTANCE_ARRAY=ON \
	-DEMBREE_GEOMETRY_GRID=ON \
	-DEMBREE_GEOMETRY_POINT=ON
cmake --build build
DESTDIR=$PKG cmake --install build

test -f "$PKG/usr/lib/libembree4.so"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/embree, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf embree-4.4.1-1.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/embree, and runs the triggers its paths call for.

Contents

Installed libraries: libembree4.so.

Installed directories: /usr/include/embree4, /usr/lib/cmake/embree-4.4.1, /usr/share/doc/embree4, /usr/share/licenses/embree.