# # spec file for package tbb # # Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define so_ver 2 %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_with python2 %bcond_without python3 %if ! %{with python2} %define skip_python2 1 %endif %define skip_python36 1 %define skip_python39 1 Name: tbb Version: 2020.3 Release: 2.8 Summary: Threading Building Blocks (TBB) License: Apache-2.0 Group: Development/Libraries/C and C++ URL: https://www.threadingbuildingblocks.org/ Source0: https://github.com/oneapi-src/oneTBB/archive/v%{version}.tar.gz#/tbb-%{version}.tar.gz # PATCH-FIX-OPENSUSE optflags.patch -- Use rpm optflags Patch1: optflags.patch # PATCH-FIX-OPENSUSE reproducible.patch -- Do not compile build hostname+kernel into binary Patch2: reproducible.patch # PATCH-FIX-OPENSUSE disable-irml.patch -- Don't try to link to irml Patch3: disable-irml.patch Patch4: cmake-remove-include-path.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: cmake BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: python-rpm-macros BuildRequires: swig >= 3.0.6 %if 0%{?python38_version_nodots} # if python multiflavor is in place yet, use it to generate subpackages %define python_subpackage_only 1 %python_subpackages %else # unified defaults for the package file list %define pycache_only %{nil} %define python_sitearch %{python3_sitearch} %define python_files() -n python3-%{**} %endif %description Threading Building Blocks (TBB) 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. Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parallelism that abstracts platform details and threading mechanism for performance and scalability. %package -n libtbb%{so_ver} Summary: Threading Building Blocks (TBB) Group: System/Libraries Provides: %{name} = %{version} Obsoletes: %{name} < %{version} %description -n libtbb%{so_ver} Threading Building Blocks (TBB) 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. Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parallelism that abstracts platform details and threading mechanism for performance and scalability. %package -n libtbbmalloc%{so_ver} Summary: Threading Building Blocks (TBB) Group: System/Libraries Provides: %{name} = %{version} Obsoletes: %{name} < %{version} %description -n libtbbmalloc%{so_ver} This subpackage contains the two TBB memory allocator templates that are similar to the STL template class std::allocator. These two templates, scalable_allocator and cache_aligned_allocator, address critical issues in parallel programming: scalability and false sharing. %if 0%{?python_subpackage_only} %package -n python-%{name} Summary: Python %{python_version} support for Threading Building Blocks (TBB) Group: Development/Languages/Python %description -n python-%{name} This package contains python %{python_version} bindings for Threading Building Blocks (TBB). %else %package -n python2-%{name} Summary: Python 2 support for Threading Building Blocks (TBB) Group: Development/Languages/Python %description -n python2-%{name} This package contains python 2 bindings for Threading Building Blocks (TBB). %package -n python3-%{name} Summary: Python 3 support for Threading Building Blocks (TBB) Group: Development/Languages/Python %description -n python3-%{name} This package contains python 3 bindings for Threading Building Blocks (TBB). %endif %package devel Summary: Development Files for Threading Building Blocks (TBB) Group: Development/Libraries/C and C++ Requires: c++_compiler Requires: libtbb%{so_ver} = %{version} Requires: libtbbmalloc%{so_ver} = %{version} %description devel Threading Building Blocks (TBB) 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. Threading Building Blocks is not just a threads-replacement library. It represents a higher-level, task-based parallelism that abstracts platform details and threading mechanism for performance and scalability. This package contains the header files needed for development with tbb. %prep %setup -q -n oneTBB-%{version} %autopatch -p1 sed -i 's/version\s*="0.1"/version = "%{version}"/' python/setup.py sed -i '1{/^#!.*env python/ d}' python/TBB.py python/tbb/*.py %build make OPTFLAGS="%{optflags}" %{?_smp_mflags} tbb_build_prefix=obj mkdir lib; pushd lib ln -s ../build/obj_release/*.so* . popd export TBBROOT=$PWD . build/obj_release/tbbvars.sh %if %{with python2} || %{with python3} pushd python %python_build # only needed for testing? Linking is patched out, not installing. pushd rml make popd popd %endif %install mkdir -p %{buildroot}%{_includedir} mkdir -p %{buildroot}%{_libdir} pushd include find tbb -type f -exec \ install -Dpm 644 {} %{buildroot}%{_includedir}/{} \ \; popd pushd build/obj_release for file in libtbb{,malloc{,_proxy}}; do install -Dpm 0755 ${file}.so.%{so_ver} %{buildroot}%{_libdir} ln -s $file.so.%{so_ver} %{buildroot}%{_libdir}/$file.so done popd mkdir -p %{buildroot}%{_libdir}/cmake/TBB # Build cmake config files cmake -DINSTALL_DIR=%{buildroot}%{_libdir}/cmake/TBB \ -DSYSTEM_NAME=Linux \ -DTBB_VERSION_FILE=%{buildroot}%{_includedir}/tbb/tbb_stddef.h \ -DLIB_REL_PATH="../../" \ -P cmake/tbb_config_installer.cmake export TBBROOT=$PWD . build/obj_release/tbbvars.sh %if %{with python2} || %{with python3} pushd python %python_install %python_expand %fdupes %{buildroot}%{$python_sitearch} popd %endif %if %{with python2} || %{with python3} %check # avoid shuffling the existing build dir mkdir python-test pushd python-test export LD_LIBRARY_PATH="%{buildroot}%{_libdir}:../python/rml" %python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -m tbb test -v popd %endif %post -n libtbb%{so_ver} -p /sbin/ldconfig %postun -n libtbb%{so_ver} -p /sbin/ldconfig %post -n libtbbmalloc%{so_ver} -p /sbin/ldconfig %postun -n libtbbmalloc%{so_ver} -p /sbin/ldconfig %files -n libtbb%{so_ver} %{_libdir}/libtbb.so.%{so_ver}* %if %{with python2} && ! 0%{?python_subpackage_only} %files -n python2-%{name} %{python2_sitearch}/tbb %{python2_sitearch}/TBB.py* %{python2_sitearch}/TBB-%{version}*-info %endif %if %{with python3} || ( %{with python2} && 0%{?python_subpackage_only} ) %files %{python_files %{name}} %{python_sitearch}/tbb %{python_sitearch}/TBB.py* %{python_sitearch}/TBB-%{version}*-info %pycache_only %{python_sitearch}/__pycache__/TBB* %endif %files -n libtbbmalloc%{so_ver} %{_libdir}/libtbbmalloc.so.%{so_ver}* %{_libdir}/libtbbmalloc_proxy.so.%{so_ver}* %files devel %license LICENSE %doc CHANGES doc/Release_Notes.txt %{_includedir}/tbb/ %{_libdir}/cmake/TBB %{_libdir}/libtbb.so %{_libdir}/libtbbmalloc.so %{_libdir}/libtbbmalloc_proxy.so %changelog * Fri Dec 25 2020 Benjamin Greiner - Rework the building of python bindings * Fix egg info version * Remove shebang lines * fix lining issue by setting TBBROOT and tbbvars in install phase * Run python tests with irml library built (but not installed) * Build bindings packages for all existing python3 flavors gh#openSUSE/python-rpm-macros#66 * Mon Aug 3 2020 Ismail Dönmez - Update to version 2020.3 * Changed body type concept of the flow::input_node. Set TBB_DEPRECATED_INPUT_NODE_BODY to 1 to compile with the previous concept of the body type. * Fixed compilation errors in C++20 mode due to ambiguity of comparison operators. Inspired by Barry Revzin (https://github.com/oneapi-src/oneTBB/pull/251). * Fixed an issue in TBBBuild.cmake that causes the build with no arguments to fail (https://github.com/oneapi-src/oneTBB/pull/233) * Mon Mar 30 2020 Ismail Dönmez - Update to version 2020.2 * Cross-allocator copying constructor and copy assignment operator for concurrent_vector are deprecated. * Added input_node to the flow graph API. It acts like a source_node except for being inactive by default; source_node is deprecated. * Allocator template parameter for flow graph nodes is deprecated. Set TBB_DEPRECATED_FLOW_NODE_ALLOCATOR to 1 to avoid compilation errors. * Flow graph preview hetero-features are deprecated. * Fixed the task affinity mechanism to prevent unlimited memory consumption in case the number of threads is explicitly decreased. * Fixed memory leak related NUMA support functionality in task_arena. * Tue Jan 21 2020 Ismail Dönmez - Update to version 2020.1 * Fixed the issue of task_arena constraints not propagated on copy construction. * Fixed TBBGet.cmake script broken by TBB package name changes (https://github.com/intel/tbb/issues/209). * Wed Dec 18 2019 Ismail Dönmez - Update to version 2020.0 * Extended task_arena interface to simplify development of NUMA-aware applications. * Added warning notifications when the deprecated functionality is used. * Thu Oct 10 2019 Ismail Dönmez - Update to version 2019_u9 * Multiple APIs are deprecated. For details, please see Deprecated Features appendix in the TBB reference manual. * Added C++17 deduction guides for flow graph nodes. Preview Features * Added isolated_task_group class that allows multiple threads to add and execute tasks sharing the same isolation. * Extended the flow graph API to simplify connecting nodes. * Added erase() by heterogeneous keys for concurrent ordered containers. * Added a possibility to suspend task execution at a specific point and resume it later. Bugs fixed * Fixed the emplace() method of concurrent unordered containers to destroy a temporary element that was not inserted. * Fixed a bug in the merge() method of concurrent unordered containers. * Fixed behavior of a continue_node that follows buffering nodes. * Added support for move-only types to tbb::parallel_pipeline * Fixed detection of clang version when CUDA toolkit is installed - Refresh patches: * cmake-remove-include-path.patch * disable-irml.patch * optflags.patch * Fri Jun 7 2019 Ismail Dönmez - Add cmake-remove-include-path.patch to remove setting include path since we already install under /usr/include and this fixes idiot OpenCV trying to do -isystem $TBB_INCLUDE_DIR * Thu Jun 6 2019 Ismail Dönmez - Update to version 2019_U8 * Fixed a bug in TBB 2019 Update 7 that could lead to incorrect memory reallocation on Linux (https://github.com/intel/tbb/issues/148). * Fixed enqueuing tbb::task into tbb::task_arena not to fail on threads with no task scheduler initialized (https://github.com/intel/tbb/issues/116). * Tue Jun 4 2019 Ismail Dönmez - Update to version 2019_U7 * Added TBBMALLOC_SET_HUGE_SIZE_THRESHOLD parameter to set the lower bound for allocations that are not released back to OS unless a cleanup is explicitly requested. * Added zip_iterator::base() method to get the tuple of underlying iterators. * Improved async_node to never block a thread that sends a message through its gateway. * Extended decrement port of the tbb::flow::limiter_node to accept messages of integral types. * Removed the number_of_decrement_predecessors parameter from the constructor of flow::limiter_node. To allow its usage, set TBB_DEPRECATED_LIMITER_NODE_CONSTRUCTOR macro to 1. * Added ordered associative containers: concurrent_{map,multimap,set,multiset} (requires C++11). * Tue May 14 2019 Ismail Dönmez - Update to version 2019_U6 * Added support for enqueuing tbb::task into tbb::task_arena (https://github.com/01org/tbb/issues/116). * Improved support for allocator propagation on concurrent_hash_map assigning and swapping. * Improved scalable_allocation_command cleanup operations to release more memory buffered by the calling thread. * Separated allocation of small and large objects into distinct memory regions, which helps to reduce excessive memory caching inside the TBB allocator. - Disable python2 support * Thu Apr 25 2019 Ismail Dönmez - Update to version 2019_U5 * Too many changes to list, please see the included CHANGES file. - Install TBBConfig*.cmake * Fri Aug 24 2018 bwiedemann@suse.com - Extend reproducible.patch to not capture build kernel version (boo#1101107) * Wed Aug 1 2018 bwiedemann@suse.com - Extend reproducible.patch to override build date (boo#1047218) * Mon Jan 8 2018 tchvatal@suse.com - Add conditions to build with py2 and py3 respectively in order to allow us disable one based on codestream * Thu Dec 21 2017 idonmez@suse.com - Add disable-irml.patch to disable linking to libirml - Actually update to tarball to 2018_U2 release * Sat Dec 16 2017 idonmez@suse.com - Update to version 2018_U2 * lambda-friendly overloads for parallel_scan. * support of static and simple partitioners in parallel_deterministic_reduce. * initial support for Flow Graph Analyzer to do parallel_for. * reservation support in overwrite_node and write_once_node. * Fixed a potential deadlock scenario in the flow graph that affected Intel® TBB 2018 Initial Release. * Fixed constructors of concurrent_hash_map to be exception-safe. * Fixed auto-initialization in the main thread to be cleaned up at shutdown. * Fixed a crash when tbbmalloc_proxy is used together with dbghelp. * Fixed static_partitioner to assign tasks properly in case of nested parallelism. * Wed Nov 1 2017 mpluskal@suse.com - Build python2 and python3 bindings - Do not bundle python bindings with shared library * Thu Sep 21 2017 idonmez@suse.com - Update to version 2018 release * Now fully supports this_task_arena::isolate() function. * Parallel STL, an implementation of the C++ standard library algorithms with support for execution policies, has been introduced. * Fixed a bug preventing use of streaming_node and opencl_node with Clang. * Fixed this_task_arena::isolate() function to work correctly with parallel_invoke and parallel_do algorithms. * Fixed a memory leak in composite_node. * Fixed an assertion failure in debug tbbmalloc binaries when TBBMALLOC_CLEAN_ALL_BUFFERS is used. * Tue May 30 2017 bwiedemann@suse.com - Add reproducible.patch to not add build hostname+kernel to binary * Wed May 24 2017 idonmez@suse.com - Update to version 2017_20170412 release * Added a blocking terminate extension to the task_scheduler_init class that allows an object to wait for termination of worker threads. * Wed Apr 19 2017 idonmez@suse.com - Add missing include files boo#1034842 * Sun Mar 5 2017 idonmez@suse.com - Update to 2017_20170226 release * Added support for C++11 move semantics in parallel_do. * Constructors for many classes, including graph nodes, concurrent containers, thread-local containers, etc., are declared explicit and cannot be used for implicit conversions anymore. * Added a workaround for bug 16657 in the GNU C Library (glibc) affecting the debug version of tbb::mutex. * Fixed a crash in pool_identify() called for an object allocated in another thread. * Mon Dec 12 2016 idonmez@suse.com - Update to 2017_20161128 release * Added template class gfx_factory to the flow graph API. It implements the Factory concept for streaming_node to offload computations to Intel processor graphics. * Fixed a possible deadlock caused by missed wakeup signals in task_arena::execute(). * Thu Nov 3 2016 idonmez@suse.com - Update to version 2017_20161004 * Fixed the issue with task_arena::execute() not being processed when the calling thread cannot join the arena. * Sat Sep 17 2016 idonmez@suse.com - Updated to version 2017_20160722 * static_partitioner class is now a fully supported feature. * async_node class is now a fully supported feature. * For 64-bit platforms, quadrupled the worst-case limit on the amount of memory the Intel TBB allocator can handle. * Added TBB_USE_GLIBCXX_VERSION macro to specify the version of GNU libstdc++ when it cannot be properly recognized, e.g. when used with Clang on Linux* OS. Inspired by a contribution from David A. * Added graph/stereo example to demostrate tbb::flow::async_msg. * Removed a few cases of excessive user data copying in the flow graph. * Reworked split_node to eliminate unnecessary overheads. * Added support for C++11 move semantics to the argument of tbb::parallel_do_feeder::add() method. * Added C++11 move constructor and assignment operator to tbb::combinable template class. * Added tbb::this_task_arena::max_concurrency() function and max_concurrency() method of class task_arena returning the maximal number of threads that can work inside an arena. * Deprecated tbb::task_arena::current_thread_index() static method; use tbb::this_task_arena::current_thread_index() function instead. - License changed to Apache-2.0 - Please see included CHANGES file for all changes. * Wed Jun 8 2016 idonmez@suse.com - Update to version 44_20160526 * Added a Python module which is able to replace Python's thread pool class with the implementation based on Intel TBB task scheduler. * Fixed the implementation of 64-bit tbb::atomic for IA-32 architecture to work correctly with GCC 5.2 in C++11/14 mode. * Fixed a possible crash when tasks with affinity (e.g. specified via affinity_partitioner) are used simultaneously with task priority changes. * Wed May 4 2016 jengelh@inai.de - Update group, and description of tbbmalloc. * Wed May 4 2016 idonmez@suse.com - Update to version 44_20160128: * Lots of changes, see the CHANGES file. - Drop tbb-4.0-cas.patch, fixed upstream. * Sun Feb 17 2013 asterios.dramis@gmail.com - Update to version 41_20130116: * See CHANGES file for news. - Removed tbb package which included only doc files (moved them to tbb-devel). - Updated optflags.patch to make it apply correctly and also fix "File is compiled without RPM_OPT_FLAGS" rpm post build check warning. - Added a patch "tbb-4.0-cas.patch" to fix build on PowerPC (taken from Fedora). * Sun Jan 29 2012 jengelh@medozas.de - Remove redundant tags/sections per specfile guideline suggestions - Parallel building using %%_smp_mflags * Sun Aug 14 2011 crrodriguez@opensuse.org - Update to version tbb30_20110704 * Wed Sep 16 2009 meissner@suse.de - Reimport from Andi Kleens directory. * Sat Sep 5 2009 andi@firstfloor.org - update to 22_20090809oss, install machine/* includes * Thu Sep 11 2008 skh@suse.de - update to snapshot 21_20080825 (for details see CHANGES file in package) - remove obsolete patch tbb-build.patch - split off libtbb2 and libtbbmalloc2 subpackages * Wed Aug 13 2008 ro@suse.de - add ExclusiveArch * Mon Apr 28 2008 skh@suse.de - update to source version tbb20_20080408oss_src * Wed Feb 13 2008 dmueller@suse.de - fix buildrequires * Fri Feb 8 2008 skh@suse.de - initial package from version 2.0, source version tbb20_20080122oss_src