11 Commits

Author SHA256 Message Date
9e871f15f7 Make build recipe POSIX sh compatible 2026-01-03 15:51:16 +01:00
f2c8c99553 Update to 2022.3.0
* [Preview] Introduced API for setting dynamic task dependencies
  in task_group. This allows successor tasks to execute only
  after all their predecessors have completed.
* Extended task_arena with API support for enqueuing functions
  into a task_group and waiting for the task_group to complete.
* Introduced API for setting and getting the assertion handler.
  This allows applications to set their own assertion handling
  functions.

Update cf-prot.patch, partially fixed upstream

* Add tbb-python-setuptools.patch
* gh#uxlfoundation/oneTBB#1941
* replace setup.py direct call
2026-01-03 15:49:49 +01:00
f5efb942ef Adhere to typical changelog syntax for bugrefs 2025-07-30 13:12:01 +02:00
Alessandro de Oliveira Faria (A.K.A.CABELO)
141d8e3c15 Change tbb-2022.2.0.tar.gz file - Bugzilla 1247142 2025-07-30 00:39:18 -03:00
5381658263 Add cf-prot.patch 2025-07-17 10:17:06 +02:00
Alessandro de Oliveira Faria (A.K.A.CABELO)
8999ae2f48 Version 2022.2.0 2025-07-05 20:26:39 -03:00
30971e4e50 Update to 2022.1.0
Also, build with ninja, format the .spec file and
use the common URL format for source URLs
2025-05-06 15:20:16 +02:00
Steve Kowalik
c9e26c7430 Support older and current versions of setuptools
Older versions of setuptools do not normalize the metadata directory,
whereas the newer does, so we need to support both cases.
2025-04-03 16:24:52 +11:00
f7a57bc661 Modernize building of the Python subpackage, don't generate *.egg. 2025-01-08 18:41:37 +01:00
dd92ead7d3 Do away with em dashes in summaries 2024-12-31 16:13:23 +01:00
0485d81d0d Update to 2022.0.0, remove patch and use _service to download tarball 2024-12-31 15:00:11 +01:00
8 changed files with 324 additions and 59 deletions

3
_service Normal file
View File

@@ -0,0 +1,3 @@
<services>
<service name="download_files" mode="manual" />
</services>

23
cf-prot.patch Normal file
View File

@@ -0,0 +1,23 @@
From: Jan Engelhardt <ej@inai.de>
Date: 2025-07-17 10:15:40.088500829 +0200
References: https://github.com/uxlfoundation/oneTBB/issues/1783
-fcf-prot: not supported on this target
[at least i586, armv7hl, ppc64le, s390x, probably also riscv64]
---
cmake/compilers/GNU.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: oneTBB-2022.3.0/cmake/compilers/GNU.cmake
===================================================================
--- oneTBB-2022.3.0.orig/cmake/compilers/GNU.cmake
+++ oneTBB-2022.3.0/cmake/compilers/GNU.cmake
@@ -123,7 +123,7 @@ endif ()
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -fno-strict-overflow -fno-delete-null-pointer-checks -fwrapv)
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -Wformat -Wformat-security -Werror=format-security
-fstack-protector-strong )
-if (CMAKE_SYSTEM_PROCESSOR MATCHES "(AMD64|amd64|i.86|x86)" AND NOT EMSCRIPTEN)
+if (FALSE)
set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fcf-protection=full>)
endif ()
set(TBB_LIB_COMPILE_FLAGS ${TBB_LIB_COMPILE_FLAGS} $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},8.0>>:-fstack-clash-protection>)

Binary file not shown.

BIN
tbb-2022.3.0.tar.gz LFS Normal file

Binary file not shown.

162
tbb-python-setuptools.patch Normal file
View File

@@ -0,0 +1,162 @@
From c654cdc5916cfddbffeb056d9e80809e5ba17c33 Mon Sep 17 00:00:00 2001
From: Ben Greiner <code@bnavigator.de>
Date: Sat, 3 Jan 2026 14:24:05 +0100
Subject: [PATCH] Replace 'setup.py build -I* -L*' usage with pip and
environment variables
---
python/CMakeLists.txt | 18 +++++++++++-------
python/README.md | 5 ++---
python/pyproject.toml | 3 +++
python/setup.py | 30 +++++++++++++++++++++++-------
4 files changed, 39 insertions(+), 17 deletions(-)
create mode 100644 python/pyproject.toml
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 748921a592..e507b97c13 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Copyright (c) 2020-2023 Intel Corporation
+# Copyright (c) 2020-2025 Intel Corporation
+# Copyright (c) 2026 UXL Foundation Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,7 +28,7 @@ add_custom_target(
get_target_property(TBB_INCLUDES tbb INTERFACE_INCLUDE_DIRECTORIES)
foreach(dir ${TBB_INCLUDES})
if (${dir} MATCHES "<BUILD_INTERFACE:" OR TBB_FOUND)
- set(TBB4PY_INCLUDE_STRING "-I${dir} ${TBB4PY_INCLUDE_STRING}")
+ set(TBB4PY_INCLUDE_STRING "${dir} ${TBB4PY_INCLUDE_STRING}")
endif()
endforeach()
string(STRIP "${TBB4PY_INCLUDE_STRING}" TBB4PY_INCLUDE_STRING)
@@ -37,10 +38,13 @@ add_custom_target(
ALL
DEPENDS tbb python_copy
COMMAND
- ${PYTHON_EXECUTABLE} ${PYTHON_BUILD_WORK_DIR}/setup.py
- build -b${PYTHON_BUILD_WORK_DIR}
- build_ext ${TBB4PY_INCLUDE_STRING} -L$<TARGET_FILE_DIR:TBB::tbb>
- install --prefix build -f
+ ${CMAKE_COMMAND} -E env
+ TBB_INCLUDEDIRS="${TBB4PY_INCLUDE_STRING}"
+ TBB_LIBDIRS=$<TARGET_FILE_DIR:TBB::tbb>
+ ${PYTHON_EXECUTABLE} -m pip install
+ --no-build-isolation
+ --prefix build
+ ./${PYTHON_BUILD_WORK_DIR}
COMMENT "Build and install to work directory the oneTBB Python module"
)
@@ -50,7 +54,7 @@ add_test(NAME python_test
-DPYTHON_MODULE_BUILD_PATH=${PYTHON_BUILD_WORK_DIR}/build
-P ${PROJECT_SOURCE_DIR}/cmake/python/test_launcher.cmake)
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_BUILD_WORK_DIR}/build/
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build/
DESTINATION .
COMPONENT tbb4py)
diff --git a/python/README.md b/python/README.md
index e7e3318d30..30afe9a364 100644
--- a/python/README.md
+++ b/python/README.md
@@ -20,7 +20,7 @@ For more information and examples, please refer to [forum discussion](https://co
- **tbb** - The folder contains Python module sources.
## Files
- - **setup.py** - Standard Python setup script.
+ - **setup.py** - Standard Python setuptools script. Calling it directly is deprecated.
- **TBB.py** - Alternative entry point for Python module.
## CMake predefined targets
@@ -33,8 +33,7 @@ For more information and examples, please refer to [forum discussion](https://co
- `pydoc tbb` - Read built-in documentation for Python interfaces.
- `python3 -m tbb your_script.py` - Run your_script.py in context of `with tbb.Monkey():` when oneTBB is enabled. By default only multi-threading will be covered.
- `python3 -m tbb --ipc your_script.py` - Run your_script.py in context of `with tbb.Monkey():` when oneTBB enabled in both multi-threading and multi-processing modes.
- - `python3 setup.py build -b<output_directory_path> -f check` - Build oneTBB module for Python. (Prerequisites: built and sourced oneTBB and IRML libraries)
- - `python3 setup.py build -b<output_directory_path> build_ext -I<path_to_tbb_includes> -L<path_to_prebuilt_libraries> install -f <additional_flags> ` - Build and install oneTBB module for Python. (Prerequisites: built oneTBB and IRML libraries)
+ - `TBB_INCLUDEDIRS=<path_to_tbb_includes> TBB_LIBDIRS=<path_to_prebuilt_libraries> python3 -m pip install --no-build-isolation --prefix <output_directory_path>` - Build and install oneTBB module for Python. (Prerequisites: built oneTBB and IRML libraries)
- `python3 -m TBB test` - run test for oneTBB module for Python.
- `python3 -m tbb test` - run test for oneTBB module for Python.
diff --git a/python/pyproject.toml b/python/pyproject.toml
new file mode 100644
index 0000000000..09977b5b8e
--- /dev/null
+++ b/python/pyproject.toml
@@ -0,0 +1,3 @@
+[build-system]
+requires = ["setuptools>=61"]
+build-backend = "setuptools.build_meta"
diff --git a/python/setup.py b/python/setup.py
index edf8580ff8..779660a594 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -1,4 +1,5 @@
-# Copyright (c) 2016-2023 Intel Corporation
+# Copyright (c) 2016-2025 Intel Corporation
+# Copyright (c) 2026 UXL Foundation Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,8 +18,12 @@
import platform
import os
-from distutils.core import *
-from distutils.command.build import build
+try:
+ from setuptools import setup, Extension
+ from setuptools.command.build import build
+except ImportError:
+ from distutils.core import setup, Extension
+ from distutils.command.build import build
rundir = os.getcwd()
os.chdir(os.path.abspath(os.path.dirname(__file__)))
@@ -57,19 +62,31 @@
compile_flags = ['-std=c++11', '-Wno-unused-variable']
tbb_lib_name = 'tbb'
+tbb_includedirs = os.getenv("TBB_INCLUDEDIRS", "")
+tbb_libdirs = os.getenv("TBB_LIBDIRS", "")
+
+if use_compiler_tbb and (tbb_includedirs or tbb_libdirs):
+ print("Warning: Ignoring TBB_INCLUDEDIRS=%s and TBB_LIBDIRS=%s "
+ "because using oneTBB from Intel (R) C++ Compiler is set"
+ % (tbb_includedirs, tbb_libdirs))
+
_tbb = Extension("tbb._api", ["tbb/api.i"],
- include_dirs=[os.path.join(tbb_root, 'include')] if not use_compiler_tbb else [],
+ include_dirs=([os.path.join(tbb_root, 'include')]
+ + tbb_includedirs.split()
+ ) if not use_compiler_tbb else [],
swig_opts =['-c++', '-O', '-threads'] + ( # add '-builtin' later
['-I' + os.path.join(tbb_root, 'include')] if not use_compiler_tbb else []),
extra_compile_args=compile_flags + tbb_flag,
extra_link_args=tbb_flag,
libraries =([tbb_lib_name] if not use_compiler_tbb else []) +
(['irml'] if platform.system() == "Linux" else []),
- library_dirs=[ rundir, # for custom-builds
+ library_dirs=([rundir, # for custom-builds
os.path.join(tbb_root, 'lib', 'intel64', 'gcc4.8'), # for Linux
os.path.join(tbb_root, 'lib'), # for MacOS
os.path.join(tbb_root, 'lib', 'intel64', 'vc_mt'), # for Windows
- ] if not use_compiler_tbb else [],
+ ]
+ + tbb_libdirs.split()
+ ) if not use_compiler_tbb else [],
language ='c++',
)
@@ -98,7 +115,6 @@ class TBBBuild(build):
'Intended Audience :: System Administrators',
'Intended Audience :: Other Audience',
'Intended Audience :: Science/Research',
- 'License :: OSI Approved :: Apache Software License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',

View File

@@ -1,3 +1,93 @@
-------------------------------------------------------------------
Sat Jan 3 14:49:18 UTC 2026 - Jan Engelhardt <jengelh@inai.de>
- Make build recipe POSIX sh compatible
-------------------------------------------------------------------
Fri Jan 2 21:06:28 UTC 2026 - Ben Greiner <code@bnavigator.de>
- Update to 2022.3.0
* [Preview] Introduced API for setting dynamic task dependencies
in task_group. This allows successor tasks to execute only
after all their predecessors have completed.
* Extended task_arena with API support for enqueuing functions
into a task_group and waiting for the task_group to complete.
* Introduced API for setting and getting the assertion handler.
This allows applications to set their own assertion handling
functions.
- Update cf-prot.patch, partially fixed upstream
- Add tbb-python-setuptools.patch
* gh#uxlfoundation/oneTBB#1941
* replace setup.py direct call
-------------------------------------------------------------------
Wed Jul 30 03:38:43 UTC 2025 - Alessandro de Oliveira Faria <cabelo@opensuse.org>
- Change tbb-2022.2.0.tar.gz file [boo#1247142]
-------------------------------------------------------------------
Thu Jul 17 08:16:41 UTC 2025 - Jan Engelhardt <jengelh@inai.de>
- Drop excessive gcc flags: add cf-prot.patch.
-------------------------------------------------------------------
Mon Jun 30 19:18:22 UTC 2025 - Alessandro de Oliveira Faria <cabelo@opensuse.org>
- Update to version 2022.2.0:
* Improved Hybrid CPU and NUMA Platforms API Support: Enhanced
API availability for better compatibility with Hybrid CPU and
NUMA platforms.
* Refined Environment Setup: Replaced CPATH with C_INCLUDE_PATH
and CPLUS_INCLUDE_PATH in environment setup to avoid
unintended compiler warnings caused by globally applied
include paths.
-------------------------------------------------------------------
Tue May 6 13:19:31 UTC 2025 - Eyad Issa <eyadlorenzo@gmail.com>
- Update to version 2022.1.0:
* Introduced the ONETBB_SPEC_VERSION macro to specify the version
of oneAPI specification implemented by the current version of
the library.
* blocked_nd_range is now a fully supported feature.
- Migrated URLs to the new UXL Foundation organization
- Use common URL format for Source URL
- Format .spec file
- Build with ninja
-------------------------------------------------------------------
Thu Apr 3 05:23:16 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Support older and current versions of setuptools WRT to the case of
the metadata directory.
-------------------------------------------------------------------
Wed Jan 8 17:41:12 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Modernize building of the Python subpackage, don't generate *.egg.
-------------------------------------------------------------------
Tue Dec 31 13:57:21 UTC 2024 - Eyad Issa <eyadlorenzo@gmail.com>
- Remove use-FORTIFY_SOURCE-from-distribution.patch, as it is now
upstreamed
- Use _service to download the source tarball
- Update to version 2022.0.0:
* Extended the Flow Graph receiving nodes with a new
try_put_and_wait API that submits a message to the graph and
waits for its completion.
* Fixed the missed signal for thread request for enqueue
operation
* Significantly improved scalability of task_group, flow_graph,
and parallel_for_each
* Removed usage of std::aligned_storage deprecated in C++23
* Fixed the issue where oneapi::tbb::info interfaces might
interfere with the process affinity mask on the Windows* OS
systems with multiple processor groups.
-------------------------------------------------------------------
Fri Apr 19 03:16:09 UTC 2024 - Alessandro de Oliveira Faria <cabelo@opensuse.org>
@@ -9,7 +99,7 @@ Fri Apr 19 03:16:09 UTC 2024 - Alessandro de Oliveira Faria <cabelo@opensuse.org
-------------------------------------------------------------------
Thu Jan 25 16:31:59 UTC 2024 - Ana Guerrero <ana.guerrero@suse.com>
- Fix build to handle changes in (open)SUSE specific cmake macros,
- Fix build to handle changes in (open)SUSE specific cmake macros,
no user visible changes
-------------------------------------------------------------------
@@ -103,7 +193,7 @@ Sat Sep 24 12:16:41 UTC 2022 - Dirk Müller <dmueller@suse.com>
* Deadlock in a concurrent_vector resize() that could happen when the new
size is less than the previous size
- drop tbb-pr609-32bit-mwaitpkg.patch (upstream)
- add 5cb212d44732947396abdd39eae1229c7cd51644.patch, 917.patch:
- add 5cb212d44732947396abdd39eae1229c7cd51644.patch, 917.patch:
build on riscv64, hppa, s390x
-------------------------------------------------------------------
@@ -123,7 +213,7 @@ Sat May 7 12:51:47 UTC 2022 - Dirk Müller <dmueller@suse.com>
* Extended task_group interface with a new run_and_wait overload to accept
task_handle.
* Fixed possible correctness issue in queuing_rw_mutex on non-Intel platforms.
* Fixed sporadic memory corruption.
* Fixed sporadic memory corruption.
-------------------------------------------------------------------
Tue Apr 5 14:34:05 UTC 2022 - Atri Bhattacharya <badshah400@gmail.com>
@@ -186,7 +276,7 @@ Mon Mar 30 15:50:42 UTC 2020 - Ismail Dönmez <idonmez@suse.com>
- 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
* 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.
@@ -207,7 +297,7 @@ Tue Jan 21 15:25:51 UTC 2020 - Ismail Dönmez <idonmez@suse.com>
-------------------------------------------------------------------
Wed Dec 18 16:28:51 UTC 2019 - Ismail Dönmez <idonmez@suse.com>
- Update to version 2020.0
- Update to version 2020.0
* Extended task_arena interface to simplify development of
NUMA-aware applications.
* Added warning notifications when the deprecated functionality is
@@ -222,13 +312,13 @@ Thu Oct 10 12:45:32 UTC 2019 - Ismail Dönmez <idonmez@suse.com>
* Added C++17 deduction guides for flow graph nodes.
Preview Features
* Added isolated_task_group class that allows multiple threads to add
* 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.
@@ -438,7 +528,7 @@ Sat Sep 17 13:02:18 UTC 2016 - idonmez@suse.com
Wed Jun 8 10:50:50 UTC 2016 - idonmez@suse.com
- Update to version 44_20160526
* Added a Python module which is able to replace Python's thread pool
* 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.
@@ -478,7 +568,7 @@ Sun Jan 29 01:33:25 UTC 2012 - jengelh@medozas.de
-------------------------------------------------------------------
Sun Aug 14 23:35:15 UTC 2011 - crrodriguez@opensuse.org
- Update to version tbb30_20110704
- Update to version tbb30_20110704
-------------------------------------------------------------------
Wed Sep 16 11:09:37 CEST 2009 - meissner@suse.de

View File

@@ -1,7 +1,7 @@
#
# spec file for package tbb
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2023 Alessandro de Oliveira Faria (A.K.A. CABELO)
#
# All modifications and additions to the file contributed by third parties
@@ -34,32 +34,36 @@
%bcond_with test
%if 0%{suse_version} >= 1500
%{?!python_module:%define python_module() python3-%{**}}
%bcond_without python3
%define skip_python2 1
%else
%bcond_with python3
%endif
Name: tbb
Version: 2021.12.0
Version: 2022.3.0
Release: 0
Summary: oneAPI Threading Building Blocks (oneTBB)
License: Apache-2.0
Group: Development/Libraries/C and C++
URL: https://oneapi-src.github.io/oneTBB/
Source0: https://github.com/oneapi-src/oneTBB/archive/v%{version}.tar.gz#/tbb-%{version}.tar.gz
URL: https://uxlfoundation.github.io/oneTBB/
Source0: https://github.com/uxlfoundation/oneTBB/archive/v%{version}/%{name}-%{version}.tar.gz
Source99: tbb-rpmlintrc
# PATCH-FIX-UPSTREAM tbb-python-setuptools.patch gh#uxlfoundation/oneTBB#1941, remove deprecated setup.py usage
Patch1: tbb-python-setuptools.patch
# PATCH-FIX-OPENSUSE cmake-remove-include-path.patch -- openCV include error
Patch2: cmake-remove-include-path.patch
Patch4: add-cmake-check-for-libatomic-requirement-when-build.patch
Patch5: use-FORTIFY_SOURCE-from-distribution.patch
Patch5: cf-prot.patch
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: hwloc-devel
BuildRequires: ninja
%if %{with python3}
BuildRequires: %{python_module devel >= 3.5}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: python-rpm-macros
BuildRequires: swig >= 3.0.6
%endif
@@ -82,9 +86,10 @@ oneTBB provides you with functions, interfaces, and classes to parallelize and
scale the code.
%package -n libtbb%{so_ver}
Summary: Threading Building Blocks (TBB)
Summary: Core library for oneAPI Threading Building Blocks
Group: System/Libraries
Provides: %{name} = %{version}
Provides: onetbb = %{version}
Obsoletes: %{name} < %{version}
%description -n libtbb%{so_ver}
@@ -97,7 +102,7 @@ scale the code.
This package provides the core shared library corresponding to oneTBB.
%package -n libtbbmalloc%{so_ver_malloc}
Summary: Threading Building Blocks (TBB)
Summary: Memory allocator library for oneAPI Threading Building Blocks
Group: System/Libraries
Provides: %{name} = %{version}
Obsoletes: %{name} < %{version}
@@ -112,7 +117,7 @@ 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
Summary: IPC library for oneAPI Threading Building Blocks
Group: System/Libraries
%description -n libirml%{so_ver_irml}
@@ -126,7 +131,7 @@ This subpackage provides the library required in order to enable inter-process
(IPC) coordination between oneTBB schedulers for the oneTBB python module.
%package -n libtbbbind%{tbbbind_suffix}-%{so_ver_bind}
Summary: NUMA support library for oneAPI Threading Building Blocks (oneTBB)
Summary: NUMA support library for oneAPI Threading Building Blocks
Group: System/Libraries
%description -n libtbbbind%{tbbbind_suffix}-%{so_ver_bind}
@@ -140,7 +145,7 @@ The NUMA support library for oneTBB.
%if 0%{?python_subpackage_only}
%package -n python-%{name}
Summary: Python %{python_version} support for oneAPI Threading Building Blocks (oneTBB)
Summary: Python bindings for oneAPI Threading Building Blocks
Group: Development/Languages/Python
Requires: libirml%{so_ver_irml}
@@ -156,7 +161,7 @@ This package contains python %{python_version} bindings for oneTBB.
%else
%package -n python3-%{name}
Summary: Python 3 support for oneAPI Threading Building Blocks (oneTBB)
Summary: Python 3 bindings for oneAPI Threading Building Blocks
Group: Development/Languages/Python
Requires: libirml%{so_ver_irml}
@@ -190,14 +195,15 @@ scale the code.
This package contains the header files needed for development with oneTBB.
%prep
%setup -q -n oneTBB-%{version}
%autopatch -p1
%autosetup -n oneTBB-%{version} -p1
# fix python version
sed -i 's/version\s*="0.2"/version = "%{version}"/' python/setup.py
sed -i '1{/^#!.*env python/ d}' python/TBB.py python/tbb/*.py
%build
# Use ninja to build
%define __builder ninja
# HWLOC: no automatic find on SLE-12 (older cmake)
# TBB_TEST: don't compile by default
# TBB4PY: use cmake build system to build libirml in the python tree
@@ -220,27 +226,24 @@ sed -i '1{/^#!.*env python/ d}' python/TBB.py python/tbb/*.py
%endif
source */vars.sh
cd ..
# rebuild for every python flavor
%if %{with python3}
pushd python
%python_build
popd
cd python/python_build
%pyproject_wheel
cd -
%endif
%install
# create empty python build dir (?)
mkdir -p build/python/build
%cmake_install
source build/*/vars.sh
. build/*/vars.sh
%if %{with python3}
pushd python
%python_install
cd build/python/python_build/
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
popd
cd -
%endif
# we install it into the devel package docdir
@@ -258,20 +261,16 @@ test -f %{buildroot}%{_libdir}/pkgconfig/tbb32.pc && mv %{buildroot}%{_libdir}/p
%if %{with python3}
# avoid shuffling the existing build dir
mkdir python-test
pushd python-test
cd python-test
export LD_LIBRARY_PATH="%{buildroot}%{_libdir}"
%python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} timeout 5m $python -m tbb test -v
popd
cd -
%endif
%post -n libtbb%{so_ver} -p /sbin/ldconfig
%postun -n libtbb%{so_ver} -p /sbin/ldconfig
%post -n libtbbmalloc%{so_ver_malloc} -p /sbin/ldconfig
%postun -n libtbbmalloc%{so_ver_malloc} -p /sbin/ldconfig
%post -n libirml%{so_ver_irml} -p /sbin/ldconfig
%postun -n libirml%{so_ver_irml} -p /sbin/ldconfig
%post -n libtbbbind%{tbbbind_suffix}-%{so_ver_bind} -p /sbin/ldconfig
%postun -n libtbbbind%{tbbbind_suffix}-%{so_ver_bind} -p /sbin/ldconfig
%ldconfig_scriptlets -n libtbb%{so_ver}
%ldconfig_scriptlets -n libtbbmalloc%{so_ver_malloc}
%ldconfig_scriptlets -n libirml%{so_ver_irml}
%ldconfig_scriptlets -n libtbbbind%{tbbbind_suffix}-%{so_ver_bind}
%files -n libtbb%{so_ver}
%{_libdir}/libtbb.so.%{so_ver}*
@@ -305,8 +304,7 @@ popd
%files %{python_files %{name}}
%{python_sitearch}/tbb
%{python_sitearch}/TBB.py
%{python_sitearch}/TBB-*py3*
%{python_sitearch}/TBB-%{version}*-info
%{python_sitearch}/[Tt][Bb][Bb]-%{version}.dist-info
%pycache_only %{python_sitearch}/__pycache__/TBB*
%endif

View File

@@ -1,11 +0,0 @@
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} $<$<NOT:$<CONFIG:Debug>>:-D_FORTIFY_SOURCE=2> )
# TBB malloc settings