179.1. onetbb-2023.1.0
oneAPI Threading Building Blocks: task-parallel C++ runtime
2023.1.0-1 · Apache-2.0 · 0.6 SBU · 2.0 MiB, 164 files · 42_graphics, 15 of 189 · ports/core/devlibs/onetbb
Homepage: https://github.com/uxlfoundation/oneTBB
oneTBB (oneAPI Threading Building Blocks) is a C++ runtime for task parallelism: parallel loops and reductions, flow graphs, concurrent containers, and a scalable memory allocator. Blender, OpenCV, OpenImageIO, OpenVDB, Embree, PrusaSlicer and the other ports that name it in depends run their parallel work on it.
Depends on: cmake, ninja, pkgconf, hwloc.
Required by (13): blender, curaengine, embree, manifold, oidn, opencv, openimageio, openscad, opensubdiv, openvdb, pdf4qt, prusaslicer, stellarium.
Sources: onetbb-2023.1.0.tar.gz (7.4 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 onetbb'
build.sh:
mkdir build && cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=ON \
-DTBB_TEST=OFF \
-DTBB_EXAMPLES=OFF \
-DTBB_STRICT=OFF \
-DTBB4PY_BUILD=OFF \
-DTBBMALLOC_BUILD=ON \
-DTBBMALLOC_PROXY_BUILD=OFF \
-DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=OFF
ninja
DESTDIR=$PKG ninja install
test -e "$PKG"/usr/lib/libtbbbind_2_5.so
-DTBB_TEST=OFF,-DTBB_EXAMPLES=OFF,-DTBB4PY_BUILD=OFF— Build no tests, no examples and notbb4pyPython module.-DTBB_STRICT=OFF— Do not treat compiler warnings as errors, which upstream does by default; with it on, a warning that a newer compiler adds would stop the build.-DTBBMALLOC_BUILD=ON,-DTBBMALLOC_PROXY_BUILD=OFF— Buildlibtbbmalloc, the scalable allocator programs call explicitly, but notlibtbbmalloc_proxy, which replacesmallocandfreein every process that loads it. The proxy looks up glibc’s internal entry points__libc_freeand__libc_reallocwithdlsym, and musl’slibc.soexports neither.-DTBB_DISABLE_HWLOC_AUTOMATIC_SEARCH=OFF— Let CMake find hwloc through pkg-config, and buildtbbbindagainst it, the library that pins task arenas to NUMA nodes and core types. Upstream’s default turns the search off whenever CMake considers the build a cross build; the switch states the native default.
Libraries: libtbb.so, libtbbbind_2_5.so, libtbbmalloc.so.
Directories: /usr/include/oneapi, /usr/include/tbb, /usr/lib/cmake/TBB, /usr/share/doc/TBB, /usr/share/licenses/onetbb.
The last line of build.sh requires libtbbbind_2_5.so. oneTBB names tbbbind after the hwloc it found through pkg-config, tbbbind_2_5 for hwloc 2.5 or later and tbbbind_2_0 below, and builds none when pkg-config finds no hwloc. A configure that missed hwloc therefore stops the build instead of installing a oneTBB without NUMA placement, and an hwloc older than 2.5 stops it too.