From b793d253f93bcb458f508915639beedd84968ab15d4ba4a906a14186c9b535a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 30 Sep 2024 10:46:32 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main tbb revision 90066a688a8833fa99fda8702229d016 --- 917.patch | 78 ------------- ...for-libatomic-requirement-when-build.patch | 17 ++- cmake-remove-include-path.patch | 8 +- retry-pthread_create.patch | 63 ---------- tbb-2021.12.0.tar.gz | 3 + tbb-2021.8.0.tar.gz | 3 - tbb.changes | 60 ++++++++++ tbb.spec | 108 +++++++++++------- use-FORTIFY_SOURCE-from-distribution.patch | 11 ++ 9 files changed, 150 insertions(+), 201 deletions(-) delete mode 100644 917.patch delete mode 100644 retry-pthread_create.patch create mode 100644 tbb-2021.12.0.tar.gz delete mode 100644 tbb-2021.8.0.tar.gz create mode 100644 use-FORTIFY_SOURCE-from-distribution.patch diff --git a/917.patch b/917.patch deleted file mode 100644 index fa2197d..0000000 --- a/917.patch +++ /dev/null @@ -1,78 +0,0 @@ -From d9049c052c99162e26f86cf2a4982d026bf7dc57 Mon Sep 17 00:00:00 2001 -From: Mo Zhou -Date: Fri, 20 May 2022 09:02:53 -0400 -Subject: [PATCH 1/2] Fix build failure for s390x and hppa architectures. - -Signed-off-by: Mo Zhou ---- - src/tbb/tools_api/ittnotify_config.h | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/src/tbb/tools_api/ittnotify_config.h b/src/tbb/tools_api/ittnotify_config.h -index 5e7c0cdf5..411de0852 100644 ---- a/src/tbb/tools_api/ittnotify_config.h -+++ b/src/tbb/tools_api/ittnotify_config.h -@@ -167,6 +167,14 @@ - # define ITT_ARCH_LOONGARCH64 7 - #endif /* ITT_ARCH_LOONGARCH64 */ - -+#ifndef ITT_ARCH_S390X -+# define ITT_ARCH_S390X 8 -+#endif /* ITT_ARCH_S390X */ -+ -+#ifndef ITT_ARCH_HPPA -+# define ITT_ARCH_HPPA 9 -+#endif /* ITT_ARCH_HPPA */ -+ - #ifndef ITT_ARCH - # if defined _M_IX86 || defined __i386__ - # define ITT_ARCH ITT_ARCH_IA32 -@@ -182,6 +190,10 @@ - # define ITT_ARCH ITT_ARCH_PPC64 - # elif defined __loongarch__ - # define ITT_ARCH ITT_ARCH_LOONGARCH64 -+# elif defined __s390__ || defined __s390x__ -+# define ITT_ARCH ITT_ARCH_S390X -+# elif defined __hppa__ -+# define ITT_ARCH ITT_ARCH_HPPA - # endif - #endif - - -From b0e9f8636e49c337836392d811fda403dc7102a0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Dirk=20M=C3=BCller?= -Date: Sat, 24 Sep 2022 14:27:24 +0200 -Subject: [PATCH 2/2] Add riscv64 architecture detection -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Signed-off-by: Dirk Müller ---- - src/tbb/tools_api/ittnotify_config.h | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/tbb/tools_api/ittnotify_config.h b/src/tbb/tools_api/ittnotify_config.h -index 411de0852..11422fd57 100644 ---- a/src/tbb/tools_api/ittnotify_config.h -+++ b/src/tbb/tools_api/ittnotify_config.h -@@ -175,6 +175,10 @@ - # define ITT_ARCH_HPPA 9 - #endif /* ITT_ARCH_HPPA */ - -+#ifndef ITT_ARCH_RISCV64 -+# define ITT_ARCH_RISCV64 10 -+#endif /* ITT_ARCH_RISCV64 */ -+ - #ifndef ITT_ARCH - # if defined _M_IX86 || defined __i386__ - # define ITT_ARCH ITT_ARCH_IA32 -@@ -194,6 +198,8 @@ - # define ITT_ARCH ITT_ARCH_S390X - # elif defined __hppa__ - # define ITT_ARCH ITT_ARCH_HPPA -+# elif defined __riscv && __riscv_xlen == 64 -+# define ITT_ARCH ITT_ARCH_RISCV64 - # endif - #endif - diff --git a/add-cmake-check-for-libatomic-requirement-when-build.patch b/add-cmake-check-for-libatomic-requirement-when-build.patch index 3ae2df4..3535fb4 100644 --- a/add-cmake-check-for-libatomic-requirement-when-build.patch +++ b/add-cmake-check-for-libatomic-requirement-when-build.patch @@ -9,13 +9,13 @@ Signed-off-by: John Paul Adrian Glaubitz cmake/compilers/GNU.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -diff --git a/cmake/compilers/GNU.cmake b/cmake/compilers/GNU.cmake -index cd76acfe..59f4e693 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() +Index: oneTBB-2021.11.0/cmake/compilers/GNU.cmake +=================================================================== +--- oneTBB-2021.11.0.orig/cmake/compilers/GNU.cmake ++++ oneTBB-2021.11.0/cmake/compilers/GNU.cmake +@@ -42,6 +42,22 @@ endif() + + set(TBB_COMMON_LINK_LIBS ${CMAKE_DL_LIBS}) +# Check whether code with full atomics can be built without libatomic +# see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358 @@ -36,6 +36,3 @@ index cd76acfe..59f4e693 100644 # 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) --- -2.30.2 - diff --git a/cmake-remove-include-path.patch b/cmake-remove-include-path.patch index 0dcc93f..1a5f18e 100644 --- a/cmake-remove-include-path.patch +++ b/cmake-remove-include-path.patch @@ -1,8 +1,8 @@ -Index: oneTBB-2021.3.0/cmake/templates/TBBConfig.cmake.in +Index: oneTBB-2021.11.0/cmake/templates/TBBConfig.cmake.in =================================================================== ---- oneTBB-2021.3.0.orig/cmake/templates/TBBConfig.cmake.in -+++ oneTBB-2021.3.0/cmake/templates/TBBConfig.cmake.in -@@ -58,8 +58,6 @@ foreach (_tbb_component ${TBB_FIND_COMPO +--- oneTBB-2021.11.0.orig/cmake/templates/TBBConfig.cmake.in ++++ oneTBB-2021.11.0/cmake/templates/TBBConfig.cmake.in +@@ -80,8 +80,6 @@ foreach (_tbb_component ${TBB_FIND_COMPO add_library(TBB::${_tbb_component} SHARED IMPORTED) get_filename_component(_tbb_include_dir "${_tbb_root}/@TBB_INC_REL_PATH@" ABSOLUTE) diff --git a/retry-pthread_create.patch b/retry-pthread_create.patch deleted file mode 100644 index a9d4636..0000000 --- a/retry-pthread_create.patch +++ /dev/null @@ -1,63 +0,0 @@ -From f12c93efd04991bc982a27e2fa6142538c33ca82 Mon Sep 17 00:00:00 2001 -From: Rui Ueyama -Date: Sat, 7 May 2022 19:55:24 +0800 -Subject: [PATCH] Retry if pthread_create fails with EAGAIN - -On many Unix-like systems, pthread_create can fail spuriously even if -the running machine has enough resources to spawn a new thread. -Therefore, if EAGAIN is returned from pthread_create, we actually have -to try again. - -I observed this issue when running the mold linker -(https://github.com/rui314/mold) under a heavy load. mold uses OneTBB -for parallelization. - -As another data point, Go has the same logic to retry on EAGAIN: -https://go-review.googlesource.com/c/go/+/33894/ - -nanosleep is defined in POSIX 2001, so I believe that all Unix-like -systems support it. - -Signed-off-by: Rui Ueyama ---- - src/tbb/rml_thread_monitor.h | 19 ++++++++++++++++++- - 1 file changed, 18 insertions(+), 1 deletion(-) - -diff --git a/src/tbb/rml_thread_monitor.h b/src/tbb/rml_thread_monitor.h -index 13b556380..5b844b232 100644 ---- a/src/tbb/rml_thread_monitor.h -+++ b/src/tbb/rml_thread_monitor.h -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - #else - #error Unsupported platform - #endif -@@ -191,8 +192,24 @@ inline thread_monitor::handle_type thread_monitor::launch( void* (*thread_routin - check(pthread_attr_init( &s ), "pthread_attr_init has failed"); - if( stack_size>0 ) - check(pthread_attr_setstacksize( &s, stack_size ), "pthread_attr_setstack_size has failed" ); -+ - pthread_t handle; -- check( pthread_create( &handle, &s, thread_routine, arg ), "pthread_create has failed" ); -+ int tries = 0; -+ for (;;) { -+ int error_code = pthread_create(&handle, &s, thread_routine, arg); -+ if (!error_code) -+ break; -+ if (error_code != EAGAIN || tries++ > 20) { -+ handle_perror(error_code, "pthread_create has failed"); -+ break; -+ } -+ -+ // pthreaed_create can spuriously fail on many Unix-like systems. -+ // Retry after tries * 1 millisecond. -+ struct timespec ts = {0, tries * 1000 * 1000}; -+ nanosleep(&ts, NULL); -+ } -+ - check( pthread_attr_destroy( &s ), "pthread_attr_destroy has failed" ); - return handle; - } diff --git a/tbb-2021.12.0.tar.gz b/tbb-2021.12.0.tar.gz new file mode 100644 index 0000000..a907ee3 --- /dev/null +++ b/tbb-2021.12.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7bb7aa69c254d91b8f0041a71c5bcc3936acb64408a1719aec0b2b7639dd84f +size 2617255 diff --git a/tbb-2021.8.0.tar.gz b/tbb-2021.8.0.tar.gz deleted file mode 100644 index 5db9f46..0000000 --- a/tbb-2021.8.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eee380323bb7ce864355ed9431f85c43955faaae9e9bce35c62b372d7ffd9f8b -size 2575336 diff --git a/tbb.changes b/tbb.changes index 3689605..6bd7156 100644 --- a/tbb.changes +++ b/tbb.changes @@ -1,3 +1,63 @@ +------------------------------------------------------------------- +Fri Apr 19 03:16:09 UTC 2024 - Alessandro de Oliveira Faria + +- Update to version 2021.11.0: + * Fixed parallel_for_each algorithm behavior for iterators defining + iterator_concept trait instead of iterator_category. + * Fixed the incorrect binary search order in TBBConfig.cmake. + +------------------------------------------------------------------- +Thu Jan 25 16:31:59 UTC 2024 - Ana Guerrero + +- Fix build to handle changes in (open)SUSE specific cmake macros, + no user visible changes + +------------------------------------------------------------------- +Fri Dec 1 08:24:32 UTC 2023 - Atri Bhattacharya + +- Update to version 2021.11.0: + * Fixed tbb::this_task_arena() behavior for specific + tbb::task_arena{1,0}. + * Restored performance on the high-core count systems that + support _tpause. +- Refresh patches to apply cleanly: + * use-FORTIFY_SOURCE-from-distribution.patch + * add-cmake-check-for-libatomic-requirement-when-build.patch +- Update Summary and description tags to be consistent with + upstream's TBB -> oneTBB renaming. + +------------------------------------------------------------------- +Thu Nov 23 09:53:18 UTC 2023 - Bernhard Wiedemann + +- Avoid stuck build/tests + +------------------------------------------------------------------- +Tue Aug 1 19:25:15 UTC 2023 - Martin Liška + +* Add use-FORTIFY_SOURCE-from-distribution.patch and use FS settings from distribution +(we use either =2 or =3). + +------------------------------------------------------------------- +Tue Aug 1 01:27:35 UTC 2023 - Alessandro de Oliveira Faria + +- Update to 2021.10.0: + * Since C++17, parallel algorithms and Flow Graph nodes are allowed to accept + pointers to the member functions and member objects as the user-provided + callables. + * Added missed member functions, such as assignment operators and swap function, + to the concurrent_queue and concurrent_bounded_queue containers. + +------------------------------------------------------------------- +Thu Jun 15 08:34:01 UTC 2023 - Paolo Stivanin + +- Update to 2021.9.0: + * Hybrid CPU support is now a fully supported feature. + * Fixed the issue reported by the Address Sanitizer. + * Fixed the input_type alias exposed by flow_graph::join_node. +- Drop 917.patch (patch was upstreamed). +- Drop retry-pthread_create.patch (upstream fixed it by using a similar + approach). + ------------------------------------------------------------------- Wed Jan 4 20:08:08 UTC 2023 - John Paul Adrian Glaubitz diff --git a/tbb.spec b/tbb.spec index 185f0d8..71f46aa 100644 --- a/tbb.spec +++ b/tbb.spec @@ -1,7 +1,8 @@ # # spec file for package tbb # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2023 Alessandro de Oliveira Faria (A.K.A. CABELO) # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -40,19 +41,18 @@ %bcond_with python3 %endif Name: tbb -Version: 2021.8.0 +Version: 2021.12.0 Release: 0 -Summary: Threading Building Blocks (TBB) +Summary: oneAPI Threading Building Blocks (oneTBB) License: Apache-2.0 Group: Development/Libraries/C and C++ -URL: https://www.threadingbuildingblocks.org/ +URL: https://oneapi-src.github.io/oneTBB/ Source0: https://github.com/oneapi-src/oneTBB/archive/v%{version}.tar.gz#/tbb-%{version}.tar.gz Source99: tbb-rpmlintrc -Patch1: https://github.com/oneapi-src/oneTBB/pull/917.patch # PATCH-FIX-OPENSUSE cmake-remove-include-path.patch -- openCV include error Patch2: cmake-remove-include-path.patch -Patch3: retry-pthread_create.patch Patch4: add-cmake-check-for-libatomic-requirement-when-build.patch +Patch5: use-FORTIFY_SOURCE-from-distribution.patch BuildRequires: cmake BuildRequires: fdupes BuildRequires: gcc-c++ @@ -75,12 +75,11 @@ BuildRequires: swig >= 3.0.6 %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. +oneTBB (previously known as TBB) is a flexible C++ library that simplifies the +work of adding parallelism to complex applications. The library lets you easily +write parallel programs that take full advantage of the multi-core performance. +oneTBB provides you with functions, interfaces, and classes to parallelize and +scale the code. %package -n libtbb%{so_ver} Summary: Threading Building Blocks (TBB) @@ -89,12 +88,13 @@ 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. +oneTBB (previously known as TBB) is a flexible C++ library that simplifies the +work of adding parallelism to complex applications. The library lets you easily +write parallel programs that take full advantage of the multi-core performance. +oneTBB provides you with functions, interfaces, and classes to parallelize and +scale the code. + +This package provides the core shared library corresponding to oneTBB. %package -n libtbbmalloc%{so_ver_malloc} Summary: Threading Building Blocks (TBB) @@ -103,53 +103,76 @@ Provides: %{name} = %{version} Obsoletes: %{name} < %{version} %description -n libtbbmalloc%{so_ver_malloc} -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. +oneTBB (previously known as TBB) is a flexible C++ library that simplifies the +work of adding parallelism to complex applications. The library lets you easily +write parallel programs that take full advantage of the multi-core performance. +oneTBB provides you with functions, interfaces, and classes to parallelize and +scale the code. + +This package provides the oneTBB memory allocator shared library. %package -n libirml%{so_ver_irml} Summary: Threading Building Blocks (TBB) - IPC Library Group: System/Libraries %description -n libirml%{so_ver_irml} +oneTBB (previously known as TBB) is a flexible C++ library that simplifies the +work of adding parallelism to complex applications. The library lets you easily +write parallel programs that take full advantage of the multi-core performance. +oneTBB provides you with functions, interfaces, and classes to parallelize and +scale the code. + This subpackage provides the library required in order to enable inter-process -(IPC) coordination between oneTBB schedulers for the TBB python module. +(IPC) coordination between oneTBB schedulers for the oneTBB python module. %package -n libtbbbind%{tbbbind_suffix}-%{so_ver_bind} -Summary: Threading Building Blocks (TBB) NUMA support library +Summary: NUMA support library for oneAPI Threading Building Blocks (oneTBB) Group: System/Libraries %description -n libtbbbind%{tbbbind_suffix}-%{so_ver_bind} -The NUMA support library for Threading Building Blocks (TBB) - +oneTBB (previously known as TBB) is a flexible C++ library that simplifies the +work of adding parallelism to complex applications. The library lets you easily +write parallel programs that take full advantage of the multi-core performance. +oneTBB provides you with functions, interfaces, and classes to parallelize and +scale the code. +The NUMA support library for oneTBB. %if 0%{?python_subpackage_only} %package -n python-%{name} -Summary: Python %{python_version} support for Threading Building Blocks (TBB) +Summary: Python %{python_version} support for oneAPI Threading Building Blocks (oneTBB) Group: Development/Languages/Python Requires: libirml%{so_ver_irml} %description -n python-%{name} -This package contains python %{python_version} bindings for Threading Building Blocks -(TBB). +oneTBB (previously known as TBB) is a flexible C++ library that simplifies the +work of adding parallelism to complex applications. The library lets you easily +write parallel programs that take full advantage of the multi-core performance. +oneTBB provides you with functions, interfaces, and classes to parallelize and +scale the code. + +This package contains python %{python_version} bindings for oneTBB. %else %package -n python3-%{name} -Summary: Python 3 support for Threading Building Blocks (TBB) +Summary: Python 3 support for oneAPI Threading Building Blocks (oneTBB) Group: Development/Languages/Python Requires: libirml%{so_ver_irml} %description -n python3-%{name} -This package contains python 3 bindings for Threading Building Blocks -(TBB). +oneTBB (previously known as TBB) is a flexible C++ library that simplifies the +work of adding parallelism to complex applications. The library lets you easily +write parallel programs that take full advantage of the multi-core performance. +oneTBB provides you with functions, interfaces, and classes to parallelize and +scale the code. + +This package contains python 3 bindings for oneAPI Threading Building Blocks +(oneTBB). %endif %package devel -Summary: Development Files for Threading Building Blocks (TBB) +Summary: Development Files for oneAPI Threading Building Blocks (oneTBB) Group: Development/Libraries/C and C++ Requires: c++_compiler Requires: libirml%{so_ver_irml} = %{version} @@ -158,14 +181,13 @@ Requires: libtbbbind%{tbbbind_suffix}-%{so_ver_bind} = %{version} Requires: libtbbmalloc%{so_ver_malloc} = %{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. +oneTBB (previously known as TBB) is a flexible C++ library that simplifies the +work of adding parallelism to complex applications. The library lets you easily +write parallel programs that take full advantage of the multi-core performance. +oneTBB provides you with functions, interfaces, and classes to parallelize and +scale the code. -This package contains the header files needed for development with tbb. +This package contains the header files needed for development with oneTBB. %prep %setup -q -n oneTBB-%{version} @@ -222,7 +244,7 @@ popd %endif # we install it into the devel package docdir -rm -r %{buildroot}%{_datadir}/doc/TBB +rm -rf %{buildroot}%{_datadir}/doc/ # Rename tbb32.pc to tbb.pc (same as 64-bit) so that applications depending on tbb # do not have to call different pkgconfig modules based on arch @@ -238,7 +260,7 @@ test -f %{buildroot}%{_libdir}/pkgconfig/tbb32.pc && mv %{buildroot}%{_libdir}/p mkdir python-test pushd python-test export LD_LIBRARY_PATH="%{buildroot}%{_libdir}" -%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python -m tbb test -v +%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} timeout 5m $python -m tbb test -v popd %endif diff --git a/use-FORTIFY_SOURCE-from-distribution.patch b/use-FORTIFY_SOURCE-from-distribution.patch new file mode 100644 index 0000000..850d034 --- /dev/null +++ b/use-FORTIFY_SOURCE-from-distribution.patch @@ -0,0 +1,11 @@ +diff -uNr oneTBB-2021.12.0.orig/cmake/compilers/GNU.cmake oneTBB-2021.12.0/cmake/compilers/GNU.cmake +--- oneTBB-2021.12.0.orig/cmake/compilers/GNU.cmake 2024-02-13 08:49:20.000000000 -0300 ++++ oneTBB-2021.12.0/cmake/compilers/GNU.cmake 2024-04-19 03:55:56.178055557 -0300 +@@ -75,7 +75,6 @@ + if (NOT APPLE AND NOT MINGW) + set(TBB_LIB_LINK_FLAGS ${TBB_LIB_LINK_FLAGS} -Wl,-z,relro,-z,now,-z,noexecstack) + endif() +-set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} $<$>:-D_FORTIFY_SOURCE=2> ) + + + # TBB malloc settings