diff --git a/devel/onetbb/Makefile b/devel/onetbb/Makefile index 1f6c85407312..b3aa564c554e 100644 --- a/devel/onetbb/Makefile +++ b/devel/onetbb/Makefile @@ -1,52 +1,52 @@ PORTNAME= onetbb DISTVERSIONPREFIX= v DISTVERSION= 2022.3.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MAINTAINER= martymac@FreeBSD.org COMMENT= Library that provides thread building blocks WWW= https://software.intel.com/oneapi/onetbb LICENSE= APACHE20 LIB_DEPENDS= libhwloc.so:devel/hwloc2 USES= cmake:testing compiler:c++11-lang localbase:ldflags pathfix pkgconfig USE_LDCONFIG= yes USE_GITHUB= yes GH_ACCOUNT= uxlfoundation GH_PROJECT= oneTBB CONFLICTS= tbb # Many symbols in the linker version scripts are undefined because link time # optimization (-flto=thin) removes them. Suppress errors with lld >= 17 due to # these undefined symbols. LDFLAGS+= -Wl,--undefined-version # Pkgconfig: tbb.pc (on 64bit arch) vs tbb32.pc PLIST_SUB= DBGSUFX="${DBGSUFX}" \ PCSUFX="${PCSUFX}" PORTDOCS= README.md CMAKE_TESTING_ON= TBB_TEST CMAKE_OFF= TBB_STRICT \ TBB_TEST CMAKE_ARGS= -DCMAKE_INSTALL_DOCDIR:PATH="${DOCSDIR}" OPTIONS_DEFINE= DOCS .include .if defined(WITH_DEBUG) DBGSUFX= _debug .endif .if ${ARCH} == i386 || ${ARCH} == powerpc || ${ARCH:Marmv?} PCSUFX= 32 .endif .include diff --git a/devel/onetbb/files/patch-test_common_utils_concurrency_limit.h-affinity b/devel/onetbb/files/patch-test_common_utils_concurrency_limit.h-affinity new file mode 100644 index 000000000000..3a1e9a401bf4 --- /dev/null +++ b/devel/onetbb/files/patch-test_common_utils_concurrency_limit.h-affinity @@ -0,0 +1,57 @@ +Add affinity support + +Fixes test 63: + +63 - test_hw_concurrency (Subprocess aborted) + +--- test/common/utils_concurrency_limit.h.orig 2026-01-24 10:55:17 UTC ++++ test/common/utils_concurrency_limit.h +@@ -91,16 +91,21 @@ static int get_max_procs() { + ++nproc; + } + maxProcs = nproc; +-#elif __linux__ +- cpu_set_t mask; ++#elif __linux__ || __FreeBSD__ + int result = 0; ++#if __linux__ ++ cpu_set_t mask; + sched_getaffinity(0, sizeof(cpu_set_t), &mask); ++#else /* __FreeBSD__ */ ++ cpuset_t mask; ++ sched_getaffinity(0, sizeof(cpuset_t), &mask); ++#endif + int nproc = sysconf(_SC_NPROCESSORS_ONLN); + for (int i = 0; i < nproc; ++i) { + if (CPU_ISSET(i, &mask)) ++result; + } + maxProcs = result; +-#else // FreeBSD ++#else + maxProcs = sysconf(_SC_NPROCESSORS_ONLN); + #endif + } +@@ -328,9 +333,14 @@ std::vector get_cpuset_indices() { + + std::vector get_cpuset_indices() { + std::vector result; ++#if __linux__ || __FreeBSD__ + #if __linux__ + cpu_set_t mask; + sched_getaffinity(0, sizeof(cpu_set_t), &mask); ++#else /* __FreeBSD__ */ ++ cpuset_t mask; ++ sched_getaffinity(0, sizeof(cpuset_t), &mask); ++#endif + int nproc = sysconf(_SC_NPROCESSORS_ONLN); + for (int i = 0; i < nproc; ++i) { + if (CPU_ISSET(i, &mask)) { +@@ -339,7 +349,7 @@ std::vector get_cpuset_indices() { + } + ASSERT(!result.empty(), nullptr); + #else +- // TODO: add affinity support for Windows and FreeBSD ++ // TODO: add affinity support for Windows + #endif + return result; + }