8 stdenv.mkDerivation rec {
12 outputs = [ "out" "dev" ];
14 src = fetchFromGitHub {
18 hash = "sha256-7MjUdPB1GsPt7ZkYj7DCisq20X8psljsVCjDpCSTYT4=";
26 # Fix musl build from https://github.com/oneapi-src/oneTBB/pull/899
28 url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/899.patch";
29 hash = "sha256-kU6RRX+sde0NrQMKlNtW3jXav6J4QiVIUmD50asmBPU=";
32 # Fix/suppress warnings on gcc12.1 from https://github.com/oneapi-src/oneTBB/pull/866
34 url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/866.patch";
35 hash = "sha256-e44Yv84Hfl5xoxWWTnLJLSGeNA1RBbah4/L43gPLS+c=";
39 # Fix build with modern gcc
40 # In member function 'void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]',
41 NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-Wno-error=stringop-overflow" ] ++
42 # error: variable 'val' set but not used
43 lib.optionals stdenv.cc.isClang [ "-Wno-error=unused-but-set-variable" ] ++
44 # Workaround for gcc-12 ICE when using -O3
45 # https://gcc.gnu.org/PR108854
46 lib.optionals (stdenv.cc.isGNU && stdenv.isx86_32) [ "-O2" ];
48 # Disable failing test on musl
49 # 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’?
50 postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
51 substituteInPlace test/CMakeLists.txt \
52 --replace 'conformance_resumable_tasks' ""
56 description = "Intel Thread Building Blocks C++ Library";
57 homepage = "http://threadingbuildingblocks.org/";
58 license = licenses.asl20;
60 Intel Threading Building Blocks offers a rich and complete approach to
61 expressing parallelism in a C++ program. It is a library that helps you
62 take advantage of multi-core processor performance without having to be a
63 threading expert. Intel TBB is not just a threads-replacement library. It
64 represents a higher-level, task-based parallelism that abstracts platform
65 details and threading mechanisms for scalability and performance.
67 platforms = platforms.unix;
68 maintainers = with maintainers; [ thoughtpolice tmarkus ];