2009-09-16 11:20:34 +00:00
|
|
|
#
|
2013-02-21 21:24:06 +00:00
|
|
|
# spec file for package tbb
|
2009-09-16 11:20:34 +00:00
|
|
|
#
|
2020-01-21 15:28:03 +00:00
|
|
|
# Copyright (c) 2020 SUSE LLC
|
2009-09-16 11:20:34 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-04-25 08:31:09 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2009-09-16 11:20:34 +00:00
|
|
|
#
|
|
|
|
|
2013-02-21 21:24:06 +00:00
|
|
|
|
|
|
|
%define so_ver 2
|
2019-05-14 07:58:57 +00:00
|
|
|
|
2020-12-29 10:56:46 +00:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2019-05-14 07:58:57 +00:00
|
|
|
%bcond_with python2
|
2018-01-09 08:02:08 +00:00
|
|
|
%bcond_without python3
|
2020-12-29 10:56:46 +00:00
|
|
|
%if ! %{with python2}
|
|
|
|
%define skip_python2 1
|
|
|
|
%endif
|
2009-09-16 11:20:34 +00:00
|
|
|
Name: tbb
|
2020-08-03 05:55:05 +00:00
|
|
|
Version: 2020.3
|
2013-02-21 21:24:06 +00:00
|
|
|
Release: 0
|
2009-09-16 11:20:34 +00:00
|
|
|
Summary: Threading Building Blocks (TBB)
|
2016-09-17 13:10:24 +00:00
|
|
|
License: Apache-2.0
|
2016-05-04 12:34:10 +00:00
|
|
|
Group: Development/Libraries/C and C++
|
2019-12-18 16:38:17 +00:00
|
|
|
URL: https://www.threadingbuildingblocks.org/
|
2020-03-30 15:55:29 +00:00
|
|
|
Source0: https://github.com/oneapi-src/oneTBB/archive/v%{version}.tar.gz#/tbb-%{version}.tar.gz
|
2013-02-21 21:24:06 +00:00
|
|
|
# PATCH-FIX-OPENSUSE optflags.patch -- Use rpm optflags
|
2016-05-04 11:17:07 +00:00
|
|
|
Patch1: optflags.patch
|
2017-05-30 10:07:37 +00:00
|
|
|
# PATCH-FIX-OPENSUSE reproducible.patch -- Do not compile build hostname+kernel into binary
|
|
|
|
Patch2: reproducible.patch
|
2017-12-21 12:21:29 +00:00
|
|
|
# PATCH-FIX-OPENSUSE disable-irml.patch -- Don't try to link to irml
|
|
|
|
Patch3: disable-irml.patch
|
2019-06-07 10:46:28 +00:00
|
|
|
Patch4: cmake-remove-include-path.patch
|
2020-12-29 10:56:46 +00:00
|
|
|
BuildRequires: %{python_module devel}
|
|
|
|
BuildRequires: %{python_module setuptools}
|
2019-04-25 08:31:09 +00:00
|
|
|
BuildRequires: cmake
|
2020-12-29 10:56:46 +00:00
|
|
|
BuildRequires: fdupes
|
2013-02-21 21:24:06 +00:00
|
|
|
BuildRequires: gcc-c++
|
2020-12-29 10:56:46 +00:00
|
|
|
BuildRequires: python-rpm-macros
|
2016-06-10 08:19:13 +00:00
|
|
|
BuildRequires: swig >= 3.0.6
|
2020-12-29 10:56:46 +00:00
|
|
|
%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
|
2009-09-16 11:20:34 +00:00
|
|
|
|
|
|
|
%description
|
2013-02-21 21:24:06 +00:00
|
|
|
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}
|
2009-09-16 11:20:34 +00:00
|
|
|
Summary: Threading Building Blocks (TBB)
|
2013-02-21 21:24:06 +00:00
|
|
|
Group: System/Libraries
|
2011-08-14 23:37:08 +00:00
|
|
|
Provides: %{name} = %{version}
|
2009-09-16 11:20:34 +00:00
|
|
|
Obsoletes: %{name} < %{version}
|
|
|
|
|
2013-02-21 21:24:06 +00:00
|
|
|
%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.
|
2009-09-16 11:20:34 +00:00
|
|
|
|
2013-02-21 21:24:06 +00:00
|
|
|
%package -n libtbbmalloc%{so_ver}
|
2009-09-16 11:20:34 +00:00
|
|
|
Summary: Threading Building Blocks (TBB)
|
2013-02-21 21:24:06 +00:00
|
|
|
Group: System/Libraries
|
2011-08-14 23:37:08 +00:00
|
|
|
Provides: %{name} = %{version}
|
2009-09-16 11:20:34 +00:00
|
|
|
Obsoletes: %{name} < %{version}
|
|
|
|
|
2013-02-21 21:24:06 +00:00
|
|
|
%description -n libtbbmalloc%{so_ver}
|
2016-05-04 12:34:10 +00:00
|
|
|
This subpackage contains the two TBB memory allocator templates that
|
|
|
|
are similar to the STL template class std::allocator. These two
|
|
|
|
templates, scalable_allocator<T> and cache_aligned_allocator<T>,
|
|
|
|
address critical issues in parallel programming: scalability and
|
|
|
|
false sharing.
|
2009-09-16 11:20:34 +00:00
|
|
|
|
2020-12-29 10:56:46 +00:00
|
|
|
%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
|
2017-11-06 12:38:06 +00:00
|
|
|
%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}
|
2020-12-29 10:56:46 +00:00
|
|
|
This package contains python 3 bindings for Threading Building Blocks
|
2017-11-06 12:38:06 +00:00
|
|
|
(TBB).
|
2020-12-29 10:56:46 +00:00
|
|
|
%endif
|
2017-11-06 12:38:06 +00:00
|
|
|
|
2009-09-16 11:20:34 +00:00
|
|
|
%package devel
|
2013-02-21 21:24:06 +00:00
|
|
|
Summary: Development Files for Threading Building Blocks (TBB)
|
2009-09-16 11:20:34 +00:00
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: c++_compiler
|
2013-02-21 21:24:06 +00:00
|
|
|
Requires: libtbb%{so_ver} = %{version}
|
|
|
|
Requires: libtbbmalloc%{so_ver} = %{version}
|
2009-09-16 11:20:34 +00:00
|
|
|
|
|
|
|
%description devel
|
2013-02-21 21:24:06 +00:00
|
|
|
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.
|
2009-09-16 11:20:34 +00:00
|
|
|
|
|
|
|
This package contains the header files needed for development with tbb.
|
|
|
|
|
|
|
|
%prep
|
2020-03-30 15:55:29 +00:00
|
|
|
%setup -q -n oneTBB-%{version}
|
2019-06-07 10:46:28 +00:00
|
|
|
%autopatch -p1
|
2009-09-16 11:20:34 +00:00
|
|
|
|
2020-12-29 10:56:46 +00:00
|
|
|
sed -i 's/version\s*="0.1"/version = "%{version}"/' python/setup.py
|
|
|
|
sed -i '1{/^#!.*env python/ d}' python/TBB.py python/tbb/*.py
|
|
|
|
|
2009-09-16 11:20:34 +00:00
|
|
|
%build
|
2013-02-21 21:24:06 +00:00
|
|
|
make OPTFLAGS="%{optflags}" %{?_smp_mflags} tbb_build_prefix=obj
|
2009-09-16 11:20:34 +00:00
|
|
|
|
2016-06-08 11:21:21 +00:00
|
|
|
mkdir lib; pushd lib
|
|
|
|
ln -s ../build/obj_release/*.so* .
|
|
|
|
popd
|
|
|
|
|
|
|
|
export TBBROOT=$PWD
|
2017-11-06 12:38:06 +00:00
|
|
|
. build/obj_release/tbbvars.sh
|
2020-12-29 10:56:46 +00:00
|
|
|
%if %{with python2} || %{with python3}
|
2016-06-08 11:21:21 +00:00
|
|
|
pushd python
|
2020-12-29 10:56:46 +00:00
|
|
|
%python_build
|
|
|
|
# only needed for testing? Linking is patched out, not installing.
|
|
|
|
pushd rml
|
|
|
|
make
|
2017-11-06 12:38:06 +00:00
|
|
|
popd
|
2016-06-08 11:21:21 +00:00
|
|
|
popd
|
2018-01-09 08:02:08 +00:00
|
|
|
%endif
|
2016-06-08 11:21:21 +00:00
|
|
|
|
2009-09-16 11:20:34 +00:00
|
|
|
%install
|
2013-02-21 21:24:06 +00:00
|
|
|
mkdir -p %{buildroot}%{_includedir}
|
|
|
|
mkdir -p %{buildroot}%{_libdir}
|
2016-06-08 11:21:21 +00:00
|
|
|
|
2013-02-21 21:24:06 +00:00
|
|
|
pushd include
|
2017-04-19 08:09:56 +00:00
|
|
|
find tbb -type f -exec \
|
2013-02-21 21:24:06 +00:00
|
|
|
install -Dpm 644 {} %{buildroot}%{_includedir}/{} \
|
|
|
|
\;
|
|
|
|
popd
|
2016-06-08 11:21:21 +00:00
|
|
|
|
2013-02-21 21:24:06 +00:00
|
|
|
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
|
2016-06-08 11:21:21 +00:00
|
|
|
popd
|
2016-05-04 11:17:07 +00:00
|
|
|
|
2019-04-25 08:31:09 +00:00
|
|
|
mkdir -p %{buildroot}%{_libdir}/cmake/TBB
|
|
|
|
# Build cmake config files
|
2019-06-04 15:10:32 +00:00
|
|
|
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
|
2019-04-25 08:31:09 +00:00
|
|
|
|
2020-12-29 10:56:46 +00:00
|
|
|
export TBBROOT=$PWD
|
|
|
|
. build/obj_release/tbbvars.sh
|
|
|
|
%if %{with python2} || %{with python3}
|
2016-06-08 11:21:21 +00:00
|
|
|
pushd python
|
2020-12-29 10:56:46 +00:00
|
|
|
%python_install
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitearch}
|
2017-11-06 12:38:06 +00:00
|
|
|
popd
|
2018-01-09 08:02:08 +00:00
|
|
|
%endif
|
2017-11-06 12:38:06 +00:00
|
|
|
|
2020-12-29 10:56:46 +00:00
|
|
|
%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
|
2009-09-16 11:20:34 +00:00
|
|
|
popd
|
2018-01-09 08:02:08 +00:00
|
|
|
%endif
|
2009-09-16 11:20:34 +00:00
|
|
|
|
2013-02-21 21:24:06 +00:00
|
|
|
%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
|
2009-09-16 11:20:34 +00:00
|
|
|
|
2013-02-21 21:24:06 +00:00
|
|
|
%files -n libtbb%{so_ver}
|
|
|
|
%{_libdir}/libtbb.so.%{so_ver}*
|
2017-11-06 12:38:06 +00:00
|
|
|
|
2020-12-29 10:56:46 +00:00
|
|
|
%if %{with python2} && ! 0%{?python_subpackage_only}
|
2017-11-06 12:38:06 +00:00
|
|
|
%files -n python2-%{name}
|
2020-12-29 10:56:46 +00:00
|
|
|
%{python2_sitearch}/tbb
|
|
|
|
%{python2_sitearch}/TBB.py*
|
|
|
|
%{python2_sitearch}/TBB-%{version}*-info
|
2018-01-09 08:02:08 +00:00
|
|
|
%endif
|
2017-11-06 12:38:06 +00:00
|
|
|
|
2020-12-29 10:56:46 +00:00
|
|
|
%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*
|
2018-01-09 08:02:08 +00:00
|
|
|
%endif
|
2009-09-16 11:20:34 +00:00
|
|
|
|
2013-02-21 21:24:06 +00:00
|
|
|
%files -n libtbbmalloc%{so_ver}
|
|
|
|
%{_libdir}/libtbbmalloc.so.%{so_ver}*
|
|
|
|
%{_libdir}/libtbbmalloc_proxy.so.%{so_ver}*
|
2009-09-16 11:20:34 +00:00
|
|
|
|
|
|
|
%files devel
|
2019-04-25 08:31:09 +00:00
|
|
|
%license LICENSE
|
|
|
|
%doc CHANGES doc/Release_Notes.txt
|
2013-02-21 21:24:06 +00:00
|
|
|
%{_includedir}/tbb/
|
2019-04-25 08:31:09 +00:00
|
|
|
%{_libdir}/cmake/TBB
|
2009-09-16 11:20:34 +00:00
|
|
|
%{_libdir}/libtbb.so
|
|
|
|
%{_libdir}/libtbbmalloc.so
|
2013-02-21 21:24:06 +00:00
|
|
|
%{_libdir}/libtbbmalloc_proxy.so
|
2009-09-16 11:20:34 +00:00
|
|
|
|
|
|
|
%changelog
|