tbb_2022: 2022.1.0 -> 2022.2.0, clean up, fix macOS; tbb_2021: drop (#442554)
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
opencascade-occt_7_6_1,
|
||||
openvdb,
|
||||
qhull,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
wxGTK32,
|
||||
xorg,
|
||||
libbgcode,
|
||||
@@ -54,7 +54,7 @@ let
|
||||
hash = "sha256-WNdAYu66ggpSYJ8Kt57yEA4mSTv+Rvzj9Rm1q765HpY=";
|
||||
};
|
||||
});
|
||||
openvdb_tbb_2021_8 = openvdb.override { tbb = tbb_2021; };
|
||||
openvdb_tbb_2022 = openvdb.override { tbb = tbb_2022; };
|
||||
wxGTK-override' = if wxGTK-override == null then wxGTK32 else wxGTK-override;
|
||||
opencascade-override' =
|
||||
if opencascade-override == null then opencascade-occt_7_6_1 else opencascade-override;
|
||||
@@ -122,9 +122,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
nanosvg-fltk
|
||||
nlopt
|
||||
opencascade-override'
|
||||
openvdb_tbb_2021_8
|
||||
openvdb_tbb_2022
|
||||
qhull
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
wxGTK-override'
|
||||
xorg.libX11
|
||||
libbgcode
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
boost,
|
||||
fuse3,
|
||||
lib45d,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
liburing,
|
||||
installShellFiles,
|
||||
}:
|
||||
@@ -46,7 +46,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
boost
|
||||
fuse3
|
||||
lib45d
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
liburing
|
||||
];
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
opencv,
|
||||
pcre,
|
||||
systemd,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
webkitgtk_4_1,
|
||||
wxGTK31,
|
||||
xorg,
|
||||
@@ -101,7 +101,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
opencascade-occt_7_6
|
||||
openvdb
|
||||
pcre
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
webkitgtk_4_1
|
||||
wxGTK'
|
||||
xorg.libX11
|
||||
|
||||
@@ -257,7 +257,7 @@ stdenv'.mkDerivation (finalAttrs: {
|
||||
libsndfile
|
||||
libtiff
|
||||
libwebp
|
||||
(manifold.override { tbb_2021 = tbb; })
|
||||
manifold
|
||||
opencolorio
|
||||
openexr
|
||||
openimageio
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
libgit2,
|
||||
curl,
|
||||
fmt,
|
||||
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
|
||||
buildInputs = [
|
||||
libgit2
|
||||
fmt
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
nlohmann_json
|
||||
curl
|
||||
];
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
cmake,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
|
||||
useTBB ? true,
|
||||
}:
|
||||
@@ -45,8 +45,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
propagatedBuildInputs = lib.optionals useTBB [
|
||||
# 2022.0 crashes on macOS at the moment
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
gtest,
|
||||
icu,
|
||||
spdlog,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
yaml-cpp,
|
||||
}:
|
||||
|
||||
@@ -70,7 +70,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
gtest
|
||||
icu
|
||||
(spdlog.override { fmt = fmt_11; })
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
|
||||
finalAttrs.passthru.yaml-cpp # has merge-key support
|
||||
finalAttrs.passthru.libloadorder
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
clipper2,
|
||||
gtest,
|
||||
glm,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
python3Packages,
|
||||
}:
|
||||
|
||||
@@ -26,7 +26,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
buildInputs = [
|
||||
gtest
|
||||
glm
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ clipper2 ];
|
||||
@@ -48,7 +48,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tbb = tbb_2021;
|
||||
tbb = tbb_2022;
|
||||
tests = {
|
||||
python = python3Packages.manifold3d;
|
||||
};
|
||||
|
||||
@@ -127,7 +127,6 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
changelog = "https://github.com/rui314/mold/releases/tag/v${finalAttrs.version}";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.unix;
|
||||
broken = stdenv.hostPlatform.isDarwin;
|
||||
mainProgram = "mold";
|
||||
maintainers = with lib.maintainers; [ azahi ];
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
pkg-config,
|
||||
python3,
|
||||
sphinx,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
buildPackages,
|
||||
nix-update-script,
|
||||
}:
|
||||
@@ -75,7 +75,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
boost
|
||||
capnproto # cmake modules
|
||||
flex # include dir
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
python3
|
||||
];
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
opencv,
|
||||
pcre,
|
||||
systemd,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
webkitgtk_4_1,
|
||||
wxGTK31,
|
||||
xorg,
|
||||
@@ -111,7 +111,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
opencascade-occt_7_6
|
||||
openvdb
|
||||
pcre
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
webkitgtk_4_1
|
||||
wxGTK'
|
||||
xorg.libX11
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
qt6,
|
||||
wrapGAppsHook3,
|
||||
openjpeg,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
blend2d,
|
||||
}:
|
||||
|
||||
@@ -46,7 +46,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
qt6.qtspeech
|
||||
lcms
|
||||
openjpeg
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
blend2d
|
||||
];
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
libiconv,
|
||||
libstaden-read,
|
||||
pkg-config,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
xz,
|
||||
zlib,
|
||||
}:
|
||||
@@ -55,7 +55,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
jemalloc
|
||||
libgff
|
||||
libstaden-read
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
xz
|
||||
zlib
|
||||
]
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
boost,
|
||||
blas,
|
||||
gmp,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
gfortran,
|
||||
}:
|
||||
|
||||
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
|
||||
gmp
|
||||
gfortran
|
||||
boost
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
scipopt-papilo,
|
||||
scipopt-zimpl,
|
||||
ipopt,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
boost,
|
||||
gfortran,
|
||||
criterion,
|
||||
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
|
||||
gmp
|
||||
readline
|
||||
zlib
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
boost
|
||||
gfortran
|
||||
criterion
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
gtest,
|
||||
glm,
|
||||
qt6,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
tracy,
|
||||
replaceVars,
|
||||
python3,
|
||||
@@ -130,7 +130,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
aws-sdk-cpp
|
||||
howard-hinnant-date
|
||||
boost
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
glew
|
||||
geos
|
||||
spdlog
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
cmake,
|
||||
ninja,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "tbb";
|
||||
version = "2021.12.0";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "oneapi-src";
|
||||
repo = "oneTBB";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-yG/Fs+3f9hNKzZ8le+W7+JDZk9hMzPsVAzbq0yTcUTc=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
];
|
||||
|
||||
patches = [
|
||||
# Fix musl build from https://github.com/oneapi-src/oneTBB/pull/899
|
||||
(fetchpatch {
|
||||
url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/899.patch";
|
||||
hash = "sha256-kU6RRX+sde0NrQMKlNtW3jXav6J4QiVIUmD50asmBPU=";
|
||||
})
|
||||
# Fix tests on FreeBSD and Windows
|
||||
(fetchpatch {
|
||||
name = "fix-tbb-freebsd-and-windows-tests.patch";
|
||||
url = "https://patch-diff.githubusercontent.com/raw/uxlfoundation/oneTBB/pull/1696.patch";
|
||||
hash = "sha256-yjX2FkOK8bz29a/XSA7qXgQw9lxzx8VIgEBREW32NN4=";
|
||||
})
|
||||
# Fix 32-bit PowerPC build
|
||||
(fetchpatch {
|
||||
url = "https://github.com/uxlfoundation/oneTBB/pull/987/commits/c828ae47b8f4bea7736d2f9d05460e2b529c9d7d.patch";
|
||||
hash = "sha256-faNiVdHRIkmavufDHQQ8vHppvdahZ7yhJVL3bOwNTFg=";
|
||||
})
|
||||
];
|
||||
|
||||
patchFlags = [
|
||||
"-p1"
|
||||
"--ignore-whitespace"
|
||||
];
|
||||
|
||||
# Fix build with modern gcc
|
||||
# In member function 'void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]',
|
||||
NIX_CFLAGS_COMPILE =
|
||||
lib.optionals stdenv.cc.isGNU [
|
||||
"-Wno-error=array-bounds"
|
||||
"-Wno-error=stringop-overflow"
|
||||
]
|
||||
++
|
||||
# error: variable 'val' set but not used
|
||||
lib.optionals stdenv.cc.isClang [ "-Wno-error=unused-but-set-variable" ]
|
||||
++
|
||||
# Workaround for gcc-12 ICE when using -O3
|
||||
# https://gcc.gnu.org/PR108854
|
||||
lib.optionals (stdenv.cc.isGNU && stdenv.hostPlatform.isx86_32) [ "-O2" ];
|
||||
|
||||
# Fix undefined reference errors with version script under LLVM.
|
||||
NIX_LDFLAGS = lib.optionalString (
|
||||
stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17"
|
||||
) "--undefined-version";
|
||||
|
||||
# Disable failing test on musl
|
||||
# test/conformance/conformance_resumable_tasks.cpp:37:24: error: ‘suspend’ is not a member of ‘tbb::v1::task’; did you mean ‘tbb::detail::r1::suspend’?
|
||||
postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
substituteInPlace test/CMakeLists.txt \
|
||||
--replace-fail 'tbb_add_test(SUBDIR conformance NAME conformance_resumable_tasks DEPENDENCIES TBB::tbb)' ""
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "Intel Thread Building Blocks C++ Library";
|
||||
homepage = "http://threadingbuildingblocks.org/";
|
||||
license = lib.licenses.asl20;
|
||||
longDescription = ''
|
||||
Intel Threading Building Blocks offers a rich and complete approach to
|
||||
expressing parallelism in a C++ program. It is a library that helps you
|
||||
take advantage of multi-core processor performance without having to be a
|
||||
threading expert. Intel TBB is not just a threads-replacement library. It
|
||||
represents a higher-level, task-based parallelism that abstracts platform
|
||||
details and threading mechanisms for scalability and performance.
|
||||
'';
|
||||
platforms = lib.platforms.all;
|
||||
maintainers = with lib.maintainers; [
|
||||
silvanshade
|
||||
thoughtpolice
|
||||
tmarkus
|
||||
];
|
||||
};
|
||||
})
|
||||
@@ -0,0 +1,38 @@
|
||||
From c828ae47b8f4bea7736d2f9d05460e2b529c9d7d Mon Sep 17 00:00:00 2001
|
||||
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
|
||||
Date: Fri, 9 Dec 2022 12:36:11 +0100
|
||||
Subject: [PATCH] Add cmake check for libatomic requirement when building with
|
||||
gcc (#980)
|
||||
|
||||
Signed-off-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
|
||||
---
|
||||
cmake/compilers/GNU.cmake | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake
|
||||
index cd76acfe1e..59f4e6934f 100644
|
||||
--- a/cmake/compilers/GNU.cmake
|
||||
+++ b/cmake/compilers/GNU.cmake
|
||||
@@ -44,6 +44,22 @@ if (NOT MINGW)
|
||||
set(TBB_COMMON_LINK_LIBS dl)
|
||||
endif()
|
||||
|
||||
+# Check whether code with full atomics can be built without libatomic
|
||||
+# see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358
|
||||
+include(CheckCXXSourceCompiles)
|
||||
+check_cxx_source_compiles("#include <atomic>
|
||||
+int main() {
|
||||
+ std::atomic<uint8_t> w1;
|
||||
+ std::atomic<uint16_t> w2;
|
||||
+ std::atomic<uint32_t> w4;
|
||||
+ std::atomic<uint64_t> w8;
|
||||
+ return ++w1 + ++w2 + ++w4 + ++w8;
|
||||
+}" TBB_BUILDS_WITHOUT_LIBATOMIC)
|
||||
+
|
||||
+if(NOT TBB_BUILDS_WITHOUT_LIBATOMIC)
|
||||
+ set(TBB_COMMON_LINK_LIBS ${TBB_COMMON_LINK_LIBS} atomic)
|
||||
+endif()
|
||||
+
|
||||
# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
|
||||
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
|
||||
tbb_remove_compile_flag(-Werror)
|
||||
@@ -0,0 +1,69 @@
|
||||
From 791d42ddacad829d19a4f66b77dc9ca410008db9 Mon Sep 17 00:00:00 2001
|
||||
From: Emily <hello@emily.moe>
|
||||
Date: Sat, 13 Sep 2025 03:16:16 +0100
|
||||
Subject: [PATCH] Use `dladdr` to keep `libtbbmalloc` loaded on POSIX
|
||||
|
||||
This fixes issues that arise when `libtbbmalloc` cannot be loaded by
|
||||
relative path, makes the behaviour consistent with the Windows code
|
||||
path, and eliminates the duplication of `MALLOCLIB_NAME`.
|
||||
---
|
||||
src/tbbmalloc/tbbmalloc.cpp | 34 +++++++++-------------------------
|
||||
1 file changed, 9 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/src/tbbmalloc/tbbmalloc.cpp b/src/tbbmalloc/tbbmalloc.cpp
|
||||
index b72e03a74f..12d62445aa 100644
|
||||
--- a/src/tbbmalloc/tbbmalloc.cpp
|
||||
+++ b/src/tbbmalloc/tbbmalloc.cpp
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
- Copyright (c) 2005-2023 Intel Corporation
|
||||
+ Copyright (c) 2005-2025 Intel Corporation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -32,25 +32,6 @@
|
||||
namespace rml {
|
||||
namespace internal {
|
||||
|
||||
-#if TBB_USE_DEBUG
|
||||
-#define DEBUG_SUFFIX "_debug"
|
||||
-#else
|
||||
-#define DEBUG_SUFFIX
|
||||
-#endif /* TBB_USE_DEBUG */
|
||||
-
|
||||
-// MALLOCLIB_NAME is the name of the oneTBB memory allocator library.
|
||||
-#if _WIN32||_WIN64
|
||||
-#define MALLOCLIB_NAME "tbbmalloc" DEBUG_SUFFIX ".dll"
|
||||
-#elif __APPLE__
|
||||
-#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".2.dylib"
|
||||
-#elif __FreeBSD__ || __NetBSD__ || __OpenBSD__ || __sun || _AIX || __ANDROID__
|
||||
-#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX ".so"
|
||||
-#elif __unix__
|
||||
-#define MALLOCLIB_NAME "libtbbmalloc" DEBUG_SUFFIX __TBB_STRING(.so.2)
|
||||
-#else
|
||||
-#error Unknown OS
|
||||
-#endif
|
||||
-
|
||||
void init_tbbmalloc() {
|
||||
#if __TBB_USE_ITT_NOTIFY
|
||||
MallocInitializeITT();
|
||||
@@ -92,11 +73,14 @@ struct RegisterProcessShutdownNotification {
|
||||
RegisterProcessShutdownNotification() {
|
||||
// prevents unloading, POSIX case
|
||||
|
||||
- // We need better support for the library pinning
|
||||
- // when dlopen can't find TBBmalloc library.
|
||||
- // for example: void *ret = dlopen(MALLOCLIB_NAME, RTLD_NOW);
|
||||
- // MALLOC_ASSERT(ret, "Allocator can't load itself.");
|
||||
- dlopen(MALLOCLIB_NAME, RTLD_NOW);
|
||||
+ Dl_info dlinfo;
|
||||
+ int ret = dladdr((void*)&init_tbbmalloc, &dlinfo);
|
||||
+ MALLOC_ASSERT(ret && dlinfo.dli_fname, "Allocator can't find itself.");
|
||||
+ tbb::detail::suppress_unused_warning(ret);
|
||||
+
|
||||
+ void* lib = dlopen(dlinfo.dli_fname, RTLD_NOW);
|
||||
+ MALLOC_ASSERT(lib, "Allocator can't load itself.");
|
||||
+ tbb::detail::suppress_unused_warning(lib);
|
||||
}
|
||||
|
||||
RegisterProcessShutdownNotification(RegisterProcessShutdownNotification&) = delete;
|
||||
@@ -0,0 +1,24 @@
|
||||
From 493774eb57f9c424fc8907d137665e687861ad94 Mon Sep 17 00:00:00 2001
|
||||
From: Ismael Luceno <ismael@iodev.co.uk>
|
||||
Date: Fri, 9 Sep 2022 16:18:18 +0200
|
||||
Subject: [PATCH] Fix build against musl libc
|
||||
|
||||
Probably MALLOC_UNIXLIKE_OVERLOAD_ENABLED only works with glibc, so use
|
||||
__GLIBC__ in addition to __linux__ to define it.
|
||||
---
|
||||
src/tbbmalloc_proxy/proxy.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/tbbmalloc_proxy/proxy.h b/src/tbbmalloc_proxy/proxy.h
|
||||
index 5f0133f9e0..ba1a07c396 100644
|
||||
--- a/src/tbbmalloc_proxy/proxy.h
|
||||
+++ b/src/tbbmalloc_proxy/proxy.h
|
||||
@@ -17,7 +17,7 @@
|
||||
#ifndef _TBB_malloc_proxy_H_
|
||||
#define _TBB_malloc_proxy_H_
|
||||
|
||||
-#define MALLOC_UNIXLIKE_OVERLOAD_ENABLED __linux__
|
||||
+#define MALLOC_UNIXLIKE_OVERLOAD_ENABLED (__linux__ && __GLIBC__)
|
||||
#define MALLOC_ZONE_OVERLOAD_ENABLED __APPLE__
|
||||
|
||||
// MALLOC_UNIXLIKE_OVERLOAD_ENABLED depends on MALLOC_CHECK_RECURSION stuff
|
||||
@@ -2,14 +2,14 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
cmake,
|
||||
ninja,
|
||||
ctestCheckHook,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "tbb";
|
||||
version = "2022.1.0";
|
||||
version = "2022.2.0";
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
@@ -20,53 +20,40 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
owner = "oneapi-src";
|
||||
repo = "oneTBB";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-DqJkNlC94cPJSXnhyFcEqWYGCQPunMfIfb05UcFGynw=";
|
||||
hash = "sha256-ASQPAGm5e4q7imvTVWlmj5ON4fGEao1L5m2C5wF7EhI=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# <https://github.com/uxlfoundation/oneTBB/pull/899>
|
||||
./fix-musl-build.patch
|
||||
|
||||
# <https://github.com/uxlfoundation/oneTBB/pull/987>
|
||||
./fix-32-bit-powerpc-build.patch
|
||||
|
||||
# Fix an assumption that `libtbbmalloc` can pass a relative path to
|
||||
# `dlopen(3)` to find itself. This caused mysterious crashes on
|
||||
# macOS, where we do not use run paths by default.
|
||||
#
|
||||
# <https://github.com/uxlfoundation/oneTBB/pull/1849>
|
||||
./fix-libtbbmalloc-dlopen.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
ctestCheckHook
|
||||
];
|
||||
|
||||
patches = [
|
||||
# Fix musl build from https://github.com/oneapi-src/oneTBB/pull/899
|
||||
(fetchpatch {
|
||||
url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/899.patch";
|
||||
hash = "sha256-kU6RRX+sde0NrQMKlNtW3jXav6J4QiVIUmD50asmBPU=";
|
||||
})
|
||||
# Fix tests on FreeBSD and Windows
|
||||
(fetchpatch {
|
||||
name = "fix-tbb-freebsd-and-windows-tests.patch";
|
||||
url = "https://patch-diff.githubusercontent.com/raw/uxlfoundation/oneTBB/pull/1696.patch";
|
||||
hash = "sha256-yjX2FkOK8bz29a/XSA7qXgQw9lxzx8VIgEBREW32NN4=";
|
||||
})
|
||||
# Fix 32-bit PowerPC build
|
||||
(fetchpatch {
|
||||
url = "https://github.com/uxlfoundation/oneTBB/pull/987/commits/c828ae47b8f4bea7736d2f9d05460e2b529c9d7d.patch";
|
||||
hash = "sha256-faNiVdHRIkmavufDHQQ8vHppvdahZ7yhJVL3bOwNTFg=";
|
||||
})
|
||||
doCheck = true;
|
||||
|
||||
dontUseNinjaCheck = true;
|
||||
|
||||
# The memory leak test fails on static Linux, despite passing on
|
||||
# dynamic Musl.
|
||||
disabledTests = lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isStatic) [
|
||||
"test_arena_constraints"
|
||||
];
|
||||
|
||||
# Fix build with modern gcc
|
||||
# In member function 'void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]',
|
||||
NIX_CFLAGS_COMPILE =
|
||||
lib.optionals stdenv.cc.isGNU [
|
||||
"-Wno-error=array-bounds"
|
||||
"-Wno-error=stringop-overflow"
|
||||
]
|
||||
++
|
||||
# error: variable 'val' set but not used
|
||||
lib.optionals stdenv.cc.isClang [ "-Wno-error=unused-but-set-variable" ]
|
||||
++
|
||||
# Workaround for gcc-12 ICE when using -O3
|
||||
# https://gcc.gnu.org/PR108854
|
||||
lib.optionals (stdenv.cc.isGNU && stdenv.hostPlatform.isx86_32) [ "-O2" ];
|
||||
|
||||
# Fix undefined reference errors with version script under LLVM.
|
||||
NIX_LDFLAGS = lib.optionalString (
|
||||
stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17"
|
||||
) "--undefined-version";
|
||||
|
||||
# Disable failing test on musl
|
||||
# test/conformance/conformance_resumable_tasks.cpp:37:24: error: ‘suspend’ is not a member of ‘tbb::v1::task’; did you mean ‘tbb::detail::r1::suspend’?
|
||||
postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
@@ -74,7 +61,16 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
--replace-fail 'tbb_add_test(SUBDIR conformance NAME conformance_resumable_tasks DEPENDENCIES TBB::tbb)' ""
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
env = {
|
||||
# Fix build with modern gcc
|
||||
# In member function 'void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]',
|
||||
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=stringop-overflow";
|
||||
|
||||
# Fix undefined reference errors with version script under LLVM.
|
||||
NIX_LDFLAGS = lib.optionalString (
|
||||
stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17"
|
||||
) "--undefined-version";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Intel Thread Building Blocks C++ Library";
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
fmt,
|
||||
hyperscan,
|
||||
opencv,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
@@ -38,7 +38,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
fmt
|
||||
hyperscan
|
||||
opencv
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
openssl,
|
||||
zeromq,
|
||||
cppzmq,
|
||||
tbb_2021,
|
||||
tbb_2022,
|
||||
spdlog,
|
||||
libsodium,
|
||||
fmt,
|
||||
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
|
||||
openssl
|
||||
zeromq
|
||||
cppzmq
|
||||
tbb_2021
|
||||
tbb_2022
|
||||
spdlog
|
||||
libsodium
|
||||
fmt
|
||||
|
||||
@@ -35,7 +35,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
];
|
||||
buildInputs = [
|
||||
ispc
|
||||
# tbb_2021 is not backward compatible
|
||||
# tbb_2022 is not backward compatible
|
||||
tbb_2020
|
||||
glfw
|
||||
openimageio
|
||||
|
||||
@@ -2335,6 +2335,7 @@ mapAliases {
|
||||
taplo-lsp = taplo; # Added 2022-07-30
|
||||
targetcli = targetcli-fb; # Added 2025-03-14
|
||||
taro = taproot-assets; # Added 2023-07-04
|
||||
tbb_2021 = throw "tbb_2021 has been removed because it is unmaintained upstream and had no remaining users; use tbb_2022"; # Added 2025-09-13
|
||||
tcl-fcgi = tclPackages.tcl-fcgi; # Added 2024-10-02
|
||||
tclcurl = tclPackages.tclcurl; # Added 2024-10-02
|
||||
tcllib = tclPackages.tcllib; # Added 2024-10-02
|
||||
|
||||
@@ -283,7 +283,7 @@ with pkgs;
|
||||
cve = with python3Packages; toPythonApplication cvelib;
|
||||
|
||||
basalt-monado = callPackage ../by-name/ba/basalt-monado/package.nix {
|
||||
tbb = tbb_2021;
|
||||
tbb = tbb_2022;
|
||||
cereal = cereal_1_3_2;
|
||||
opencv = opencv.override { enableGtk3 = true; };
|
||||
};
|
||||
@@ -6871,7 +6871,7 @@ with pkgs;
|
||||
|
||||
ikos = callPackage ../development/tools/analysis/ikos {
|
||||
inherit (llvmPackages_14) stdenv clang llvm;
|
||||
tbb = tbb_2021;
|
||||
tbb = tbb_2022;
|
||||
};
|
||||
|
||||
include-what-you-use = callPackage ../development/tools/analysis/include-what-you-use {
|
||||
@@ -7341,7 +7341,7 @@ with pkgs;
|
||||
|
||||
cctag = callPackage ../development/libraries/cctag {
|
||||
stdenv = clangStdenv;
|
||||
tbb = tbb_2021;
|
||||
tbb = tbb_2022;
|
||||
};
|
||||
|
||||
ceedling = callPackage ../development/tools/ceedling { };
|
||||
|
||||
Reference in New Issue
Block a user