tbb-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. %bcond_with test
  2. Name: tbb
  3. Summary: The Threading Building Blocks library abstracts low-level threading details
  4. Summary(ja): スレッド処理を抽象化するスレッディング・ビルディング・ブロックライブラリ
  5. Version: 2020.2
  6. Release: 1%{?_dist_release}
  7. Group: System Environment/Libraries
  8. Vendor: Project Vine
  9. Distribution: Vine Linux
  10. License: ASL 2.0
  11. URL: https://github.com/oneapi-src/oneTBB
  12. Source0: https://github.com/intel/tbb/archive/v%{version}/%{name}-%{version}.tar.gz
  13. # These three are downstream sources.
  14. Source6: tbb.pc
  15. Source7: tbbmalloc.pc
  16. Source8: tbbmalloc_proxy.pc
  17. # Don't snip -Wall from C++ flags. Add -fno-strict-aliasing, as that
  18. # uncovers some static-aliasing warnings.
  19. # Related: https://bugzilla.redhat.com/show_bug.cgi?id=1037347
  20. Patch0: tbb-2019-dont-snip-Wall.patch
  21. # Make attributes of aliases match those on the aliased function.
  22. Patch1: tbb-2020-attributes.patch
  23. # Fix test-thread-monitor, which had multiple bugs that could (and did, on
  24. # ppc64le) result in a hang.
  25. Patch2: tbb-2019-test-thread-monitor.patch
  26. # Fix a test that builds a 4-thread barrier, but cannot guarantee that more
  27. # than 2 threads will be available to use it.
  28. Patch3: tbb-2019-test-task-scheduler-init.patch
  29. # Fix compilation on aarch64 and s390x. See
  30. # https://github.com/intel/tbb/issues/186
  31. Patch4: tbb-2019-fetchadd4.patch
  32. BuildRoot: %{_tmppath}/%{name}-%{version}-root
  33. BuildRequires: doxygen
  34. BuildRequires: libstdc++-devel
  35. BuildRequires: python3-rpm-macros
  36. BuildRequires: python3-devel
  37. BuildRequires: python3-setuptools
  38. BuildRequires: swig
  39. %description
  40. Threading Building Blocks (TBB) is a C++ runtime library that
  41. abstracts the low-level threading details necessary for optimal
  42. multi-core performance. It uses common C++ templates and coding style
  43. to eliminate tedious threading implementation work.
  44. TBB requires fewer lines of code to achieve parallelism than other
  45. threading models. The applications you write are portable across
  46. platforms. Since the library is also inherently scalable, no code
  47. maintenance is required as more processor cores become available.
  48. %package devel
  49. Summary: The Threading Building Blocks C++ headers and shared development libraries
  50. Summary(ja): TBBの C++ ヘッダファイルと開発用共有ライブラリ
  51. Group: Development/Libraries
  52. Requires: %{name} = %{version}-%{release}
  53. %description devel
  54. Header files and shared object symlinks for the Threading Building
  55. Blocks (TBB) C++ libraries.
  56. %package doc
  57. Summary: The Threading Building Blocks documentation
  58. Summary(ja): TBBのドキュメント
  59. Group: Documentation
  60. BuildArch: noarch
  61. %description doc
  62. PDF documentation for the user of the Threading Building Block (TBB)
  63. C++ library.
  64. %package -n python3-%{name}
  65. Summary: Python 3 TBB module
  66. %{?python_provide:%python_provide python3-%{name}}
  67. %description -n python3-%{name}
  68. Python 3 TBB module.
  69. %prep
  70. %autosetup -p1 -n oneTBB-%{version}
  71. # For repeatable builds, don't query the hostname or architecture
  72. sed -i 's/"`hostname -s`" ("`uname -m`"/fedorabuild (%{_arch}/' \
  73. build/version_info_linux.sh
  74. # Do not assume the RTM instructions are available.
  75. # Insert --as-needed before the libraries to be linked.
  76. sed -e 's/-mrtm//' \
  77. -e "s/-fPIC/& -Wl,--as-needed/" \
  78. -i build/linux.gcc.inc
  79. # Invoke the right python binary directly
  80. sed -i 's,env python,python3,' python/TBB.py python/tbb/__*.py
  81. # Remove shebang from files that don't need it
  82. sed -i '/^#!/d' python/tbb/{pool,test}.py
  83. %build
  84. make %{?_smp_mflags} tbb_build_prefix=obj stdver=c++14 \
  85. compiler=gcc \
  86. CXXFLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \
  87. LDFLAGS="$RPM_LD_FLAGS -lpthread"
  88. for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
  89. base=$(basename ${file})
  90. sed 's/_FEDORA_VERSION/%{version}/' ${file} > ${base}
  91. touch -r ${file} ${base}
  92. done
  93. # Build for python 3
  94. . build/obj_release/tbbvars.sh
  95. pushd python
  96. make %{?_smp_mflags} -C rml stdver=c++14 \
  97. compiler=gcc \
  98. CPLUS_FLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \
  99. LDFLAGS="$RPM_LD_FLAGS -lpthread"
  100. cp -p rml/libirml.so* .
  101. %py3_build
  102. popd
  103. # Build the documentation
  104. make doxygen
  105. %if %{with test}
  106. %check
  107. # This test assumes it can create thread barriers for arbitrary numbers of
  108. # threads, but tbb limits the number of threads spawned to a function of the
  109. # number of CPUs available. Some of the koji builders have a small number of
  110. # CPUs, so the test hangs waiting for threads that have not been created to
  111. # arrive at the barrier. Skip this test until upstream fixes it.
  112. sed -i '/test_task_scheduler_observer/d' build/Makefile.test
  113. make test tbb_build_prefix=obj stdver=c++14 CXXFLAGS="%{optflags}"
  114. %endif
  115. %install
  116. rm -rf $RPM_BUILD_ROOT
  117. mkdir -p $RPM_BUILD_ROOT%{_libdir}
  118. mkdir -p $RPM_BUILD_ROOT%{_includedir}
  119. pushd build/obj_release
  120. for file in libtbb{,malloc{,_proxy}}; do
  121. install -p -D -m 755 ${file}.so.2 $RPM_BUILD_ROOT/%{_libdir}
  122. ln -s $file.so.2 $RPM_BUILD_ROOT/%{_libdir}/$file.so
  123. done
  124. popd
  125. pushd include
  126. find tbb -type f ! -name \*.htm\* -exec \
  127. install -p -D -m 644 {} $RPM_BUILD_ROOT/%{_includedir}/{} \
  128. \;
  129. popd
  130. for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
  131. install -p -D -m 644 $(basename ${file}) \
  132. $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/$(basename ${file})
  133. done
  134. # Install the rml headers
  135. mkdir -p $RPM_BUILD_ROOT%{_includedir}/rml
  136. cp -p src/rml/include/*.h $RPM_BUILD_ROOT%{_includedir}/rml
  137. # Python 3 install
  138. . build/obj_release/tbbvars.sh
  139. pushd python
  140. %py3_install
  141. chmod a+x $RPM_BUILD_ROOT%{python3_sitearch}/TBB.py
  142. chmod a+x $RPM_BUILD_ROOT%{python3_sitearch}/tbb/__*.py
  143. cp -p libirml.so.1 $RPM_BUILD_ROOT%{_libdir}
  144. ln -s libirml.so.1 $RPM_BUILD_ROOT%{_libdir}/libirml.so
  145. popd
  146. # Install the cmake files
  147. mkdir -p $RPM_BUILD_ROOT%{_libdir}/cmake
  148. cp -a cmake $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}
  149. rm $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}/README.rst
  150. %clean
  151. rm -rf $RPM_BUILD_ROOT
  152. %post -p /sbin/ldconfig
  153. %postun -p /sbin/ldconfig
  154. %files
  155. %doc doc/Release_Notes.txt README.md
  156. %license LICENSE
  157. %{_libdir}/*.so.*
  158. %files devel
  159. %doc CHANGES
  160. %doc CHANGES cmake/README.rst
  161. %{_includedir}/rml/
  162. %{_includedir}/tbb/
  163. %{_libdir}/*.so
  164. %{_libdir}/cmake/tbb/
  165. %{_libdir}/pkgconfig/*.pc
  166. %files doc
  167. %doc doc/Release_Notes.txt
  168. %doc html
  169. %files -n python3-%{name}
  170. %doc python/index.html
  171. %{python3_sitearch}/TBB*
  172. %{python3_sitearch}/tbb/
  173. %{python3_sitearch}/__pycache__/TBB*
  174. %changelog
  175. * Tue Jun 30 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2020.2-1
  176. - new upstream release.
  177. * Sat Sep 03 2016 Toshiaki Ara <ara_t@384.jp> - 4.3u6-2
  178. - rebuild with gcc-5.4.0
  179. * Fri Jun 19 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 4.3u6-1
  180. - new upstream release
  181. * Wed Mar 4 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 4.3u3-2
  182. - Initial build for Vine Linux based on 4.3 update3
  183. * Mon Jan 19 2015 Petr Machata <pmachata@redhat.com> - 4.3-1.20141204
  184. - Rebase to 4.3u2
  185. - Drop ExclusiveArch
  186. * Thu Sep 25 2014 Karsten Hopp <karsten@redhat.com> 4.1-9.20130314
  187. - enable ppc64le and run 'make test' on that new arch
  188. * Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1-8.20130314
  189. - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
  190. * Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1-7.20130314
  191. - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
  192. * Sun Jan 12 2014 Peter Robinson <pbrobinson@fedoraproject.org> 4.1-6.20130314
  193. - Build on aarch64, minor spec cleanups
  194. * Tue Dec 3 2013 Petr Machata <pmachata@redhat.com> - 4.1-5.20130314
  195. - Fix building with -Werror=format-security (tbb-4.1-dont-snip-Wall.patch)
  196. * Thu Oct 3 2013 Petr Machata <pmachata@redhat.com> - 4.1-4.20130314
  197. - Fix %%install to also install include files that are not named *.h
  198. * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1-3.20130314
  199. - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
  200. * Tue May 28 2013 Petr Machata <pmachata@redhat.com> - 4.1-3.20130314
  201. - Enable ARM arches
  202. * Wed May 22 2013 Petr Machata <pmachata@redhat.com> - 4.1-2.20130314
  203. - Fix mfence patch. Since the __TBB_full_memory_fence macro was
  204. function-call-like, it stole () intended for function invocation.
  205. * Wed May 22 2013 Petr Machata <pmachata@redhat.com> - 4.1-1.20130314
  206. - Rebase to 4.1 update 3
  207. * Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-7.20120408
  208. - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
  209. * Tue Aug 28 2012 Petr Machata <pmachata@redhat.com> - 4.0-6.20120408
  210. - Fix build on PowerPC
  211. * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-5.20120408
  212. - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
  213. * Thu Jun 7 2012 Petr Machata <pmachata@redhat.com> - 4.0-4.20120408
  214. - Rebase to 4.0 update 4
  215. - Refresh Getting_Started.pdf, Reference.pdf, Tutorial.pdf
  216. - Provide pkg-config files
  217. - Resolves: #825402
  218. * Thu Apr 05 2012 Karsten Hopp <karsten@redhat.com> 4.0-3.20110809
  219. - tbb builds now on PPC(64)
  220. * Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-2.20110809
  221. - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
  222. * Tue Oct 18 2011 Petr Machata <pmachata@redhat.com> - 4.0-1.20110809
  223. - Rebase to 4.0
  224. - Port the mfence patch
  225. - Refresh the documentation bundle
  226. * Tue Jul 26 2011 Petr Machata <pmachata@redhat.com> - 3.0-1.20110419
  227. - Rebase to 3.0-r6
  228. - Port both patches
  229. - Package Design_Patterns.pdf
  230. - Thanks to Richard Shaw for initial rebase patch
  231. - Resolves: #723043
  232. * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2-3.20090809
  233. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  234. * Thu Jun 10 2010 Petr Machata <pmachata@redhat.com> - 2.2-2.20090809
  235. - Replace mfence instruction with xchg to make it run on ia32-class
  236. machines without SSE2.
  237. - Resolves: #600654
  238. * Tue Nov 3 2009 Petr Machata <pmachata@redhat.com> - 2.2-1.20090809
  239. - New upstream 2.2
  240. - Resolves: #521571
  241. * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-3.20080605
  242. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  243. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-2.20080605
  244. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  245. * Fri Jun 13 2008 Petr Machata <pmachata@redhat.com> - 2.1-1.20080605
  246. - New upstream 2.1
  247. - Drop soname patch, parallel make patch, and GCC 4.3 patch
  248. * Wed Feb 13 2008 Petr Machata <pmachata@redhat.com> - 2.0-4.20070927
  249. - Review fixes
  250. - Use updated URL
  251. - More timestamp preservation
  252. - Initial import into Fedora CVS
  253. * Mon Feb 11 2008 Petr Machata <pmachata@redhat.com> - 2.0-3.20070927
  254. - Review fixes
  255. - Preserve timestamp of installed files
  256. - Fix soname not to contain "debug"
  257. * Tue Feb 5 2008 Petr Machata <pmachata@redhat.com> - 2.0-2.20070927
  258. - Review fixes
  259. - GCC 4.3 patchset
  260. - Add BR util-linux net-tools
  261. - Add full URL to Source0
  262. - Build in debug mode to work around problems with GCC 4.3
  263. * Mon Dec 17 2007 Petr Machata <pmachata@redhat.com> - 2.0-1.20070927
  264. - Initial package.
  265. - Using SONAME patch from Debian.