Files
haikuports/dev-cpp/tbb/tbb-2022.3.0.recipe
2025-11-08 12:45:10 +01:00

121 lines
3.8 KiB
Bash

SUMMARY="High level abstract threading library"
DESCRIPTION="Threading Building Blocks (TBB) is a C++ template library \
developed by Intel for parallel programming on multi-core processors. Using \
TBB, a computation is broken down into tasks that can run in parallel. The \
library manages and schedules threads to execute these tasks."
HOMEPAGE="https://www.threadingbuildingblocks.org/"
COPYRIGHT="2005-2025 Intel Corporation"
LICENSE="Apache v2"
REVISION="1"
SOURCE_URI="https://github.com/oneapi-src/oneTBB/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="01598a46c1162c27253a0de0236f520fd8ee8166e9ebb84a4243574f88e6e50a"
SOURCE_DIR="oneTBB-$portVersion"
PATCHES="tbb-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libtbbVersion="12.17"
libtbbVersionCompat="$libtbbVersion compat >= ${libtbbVersion%%.*}"
libtbbbindVersion="3.17"
libtbbbindVersionCompat="$libtbbbindVersion compat >= ${libtbbbindVersion%%.*}"
libtbbmallocVersion="2.17"
libtbbmallocVersion="2.17"
libtbbmallocVersionCompat="$libtbbmallocVersion compat >= ${libtbbmallocVersion%%.*}"
libtbbmalloc_proxyVersion="2.17"
libtbbmalloc_proxyVersionCompat="$libtbbmalloc_proxyVersion compat >= ${libtbbmalloc_proxyVersion%%.*}"
PROVIDES="
tbb$secondaryArchSuffix = $portVersion
lib:libtbb$secondaryArchSuffix = $libtbbVersionCompat
lib:libtbbbind_2_5$secondaryArchSuffix = $libtbbbindVersionCompat
lib:libtbbmalloc$secondaryArchSuffix = $libtbbmallocVersionCompat
lib:libtbbmalloc_proxy$secondaryArchSuffix = $libtbbmalloc_proxyVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libhwloc$secondaryArchSuffix
"
PROVIDES_devel="
tbb${secondaryArchSuffix}_devel = $portVersion
devel:libtbb$secondaryArchSuffix = $libtbbVersionCompat
devel:libtbbbind_2_5$secondaryArchSuffix = $libtbbbindVersionCompat
devel:libtbbmalloc$secondaryArchSuffix = $libtbbmallocVersionCompat
devel:libtbbmalloc_proxy$secondaryArchSuffix = $libtbbmalloc_proxyVersionCompat
"
REQUIRES_devel="
tbb$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libhwloc$secondaryArchSuffix >= 15.7 # we want hwloc2_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
defineDebugInfoPackage tbb$secondaryArchSuffix \
$libDir/libtbb.so.$libtbbVersion \
$libDir/libtbbbind_2_5.so.$libtbbbindVersion \
$libDir/libtbbmalloc_proxy.so.$libtbbmalloc_proxyVersion \
$libDir/libtbbmalloc.so.$libtbbmallocVersion
BUILD()
{
cmake -B build -S . \
$cmakeDirArgs \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D TBB_STRICT=OFF \
-D TBB_TEST=OFF # Gives me "virtual memory exhausted: Out of memory" with 4 GB of RAM.
make -C build $jobArgs
}
INSTALL()
{
make -C build install
prepareInstalledDevelLibs libtbb \
libtbbbind_2_5 \
libtbbmalloc \
libtbbmalloc_proxy
fixPkgconfig
# devel package
packageEntries devel \
$developDir \
$libDir/cmake
}
# Don't forget to enable -D TBB_TEST=ON before trying to run "hp tbb --test".
#
# Reference results (2022.3.0, beta5):
#
# 96% tests passed, 6 tests failed out of 140
# Total Test time (real) = 100.26 sec
#
# The following tests FAILED:
# 25 - test_task_arena (Failed)
# 71 - test_arena_constraints (SEGFAULT)
# 72 - test_tbbbind (Signal 21)
# 126 - conformance_arena_constraints (Failed)
# 129 - test_malloc_init_shutdown (Subprocess aborted)
# 132 - test_malloc_compliance (Failed)
TEST()
{
export LIBRARY_PATH="$sourceDir/build/gnu_13.3_cxx11_64_relwithdebinfo${LIBRARY_PATH:+:$LIBRARY_PATH}"
# Running the tests in parallel often leads to resource exhaustion. (Fedora)
ctest --test-dir build --output-on-failure --force-new-ctest-process \
-E "(test_tbbbind)"
# excluding test_tbbbind to avoid the Debugger dialog popping up.
}