tbb-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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.3
  6. Release: 1%{?_dist_release}
  7. Group: system
  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: programming
  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. %debug_package
  70. %prep
  71. %autosetup -p1 -n oneTBB-%{version}
  72. # For repeatable builds, don't query the hostname or architecture
  73. sed -i 's/"`hostname -s`" ("`uname -m`"/fedorabuild (%{_arch}/' \
  74. build/version_info_linux.sh
  75. # Do not assume the RTM instructions are available.
  76. # Insert --as-needed before the libraries to be linked.
  77. sed -e 's/-mrtm//' \
  78. -e "s/-fPIC/& -Wl,--as-needed/" \
  79. -i build/linux.gcc.inc
  80. # Invoke the right python binary directly
  81. sed -i 's,env python,python3,' python/TBB.py python/tbb/__*.py
  82. # Remove shebang from files that don't need it
  83. sed -i '/^#!/d' python/tbb/{pool,test}.py
  84. %build
  85. make %{?_smp_mflags} tbb_build_prefix=obj stdver=c++14 \
  86. compiler=gcc \
  87. CXXFLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \
  88. LDFLAGS="$RPM_LD_FLAGS -lpthread"
  89. for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
  90. base=$(basename ${file})
  91. sed 's/_FEDORA_VERSION/%{version}/' ${file} > ${base}
  92. touch -r ${file} ${base}
  93. done
  94. # Build for python 3
  95. . build/obj_release/tbbvars.sh
  96. pushd python
  97. make %{?_smp_mflags} -C rml stdver=c++14 \
  98. compiler=gcc \
  99. CPLUS_FLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \
  100. LDFLAGS="$RPM_LD_FLAGS -lpthread"
  101. cp -p rml/libirml.so* .
  102. %py3_build
  103. popd
  104. %ifnarch %{ix86}
  105. # Build the documentation
  106. make doxygen
  107. %endif
  108. %if %{with test}
  109. %check
  110. # This test assumes it can create thread barriers for arbitrary numbers of
  111. # threads, but tbb limits the number of threads spawned to a function of the
  112. # number of CPUs available. Some of the koji builders have a small number of
  113. # CPUs, so the test hangs waiting for threads that have not been created to
  114. # arrive at the barrier. Skip this test until upstream fixes it.
  115. sed -i '/test_task_scheduler_observer/d' build/Makefile.test
  116. make test tbb_build_prefix=obj stdver=c++14 CXXFLAGS="%{optflags}"
  117. %endif
  118. %install
  119. rm -rf $RPM_BUILD_ROOT
  120. mkdir -p $RPM_BUILD_ROOT%{_libdir}
  121. mkdir -p $RPM_BUILD_ROOT%{_includedir}
  122. pushd build/obj_release
  123. for file in libtbb{,malloc{,_proxy}}; do
  124. install -p -D -m 755 ${file}.so.2 $RPM_BUILD_ROOT/%{_libdir}
  125. ln -s $file.so.2 $RPM_BUILD_ROOT/%{_libdir}/$file.so
  126. done
  127. popd
  128. pushd include
  129. find tbb -type f ! -name \*.htm\* -exec \
  130. install -p -D -m 644 {} $RPM_BUILD_ROOT/%{_includedir}/{} \
  131. \;
  132. popd
  133. for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
  134. install -p -D -m 644 $(basename ${file}) \
  135. $RPM_BUILD_ROOT/%{_libdir}/pkgconfig/$(basename ${file})
  136. done
  137. # Install the rml headers
  138. mkdir -p $RPM_BUILD_ROOT%{_includedir}/rml
  139. cp -p src/rml/include/*.h $RPM_BUILD_ROOT%{_includedir}/rml
  140. # Python 3 install
  141. . build/obj_release/tbbvars.sh
  142. pushd python
  143. %py3_install
  144. chmod a+x $RPM_BUILD_ROOT%{python3_sitearch}/TBB.py
  145. chmod a+x $RPM_BUILD_ROOT%{python3_sitearch}/tbb/__*.py
  146. cp -p libirml.so.1 $RPM_BUILD_ROOT%{_libdir}
  147. ln -s libirml.so.1 $RPM_BUILD_ROOT%{_libdir}/libirml.so
  148. popd
  149. # Install the cmake files
  150. mkdir -p $RPM_BUILD_ROOT%{_libdir}/cmake
  151. cp -a cmake $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}
  152. rm $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}/README.rst
  153. %clean
  154. rm -rf $RPM_BUILD_ROOT
  155. %post -p /sbin/ldconfig
  156. %postun -p /sbin/ldconfig
  157. %files
  158. %doc doc/Release_Notes.txt README.md
  159. %license LICENSE
  160. %{_libdir}/*.so.*
  161. %files devel
  162. %doc CHANGES
  163. %doc CHANGES cmake/README.rst
  164. %{_includedir}/rml/
  165. %{_includedir}/tbb/
  166. %{_libdir}/*.so
  167. %{_libdir}/cmake/tbb/
  168. %{_libdir}/pkgconfig/*.pc
  169. %ifnarch %{ix86}
  170. %files doc
  171. %doc doc/Release_Notes.txt
  172. %doc html
  173. %endif
  174. %files -n python3-%{name}
  175. %doc python/index.html
  176. %{python3_sitearch}/TBB*
  177. %{python3_sitearch}/tbb/
  178. %{python3_sitearch}/__pycache__/TBB*
  179. %changelog
  180. * Mon Aug 17 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2020.3-1
  181. - new upstream release.
  182. * Tue Jun 30 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2020.2-1
  183. - new upstream release.
  184. * Sat Sep 03 2016 Toshiaki Ara <ara_t@384.jp> - 4.3u6-2
  185. - rebuild with gcc-5.4.0
  186. * Fri Jun 19 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 4.3u6-1
  187. - new upstream release
  188. * Wed Mar 4 2015 Ryoichi INAGAKI <ryo1@toki.waseda.jp> - 4.3u3-2
  189. - Initial build for Vine Linux based on 4.3 update3
  190. * Mon Jan 19 2015 Petr Machata <pmachata@redhat.com> - 4.3-1.20141204
  191. - Rebase to 4.3u2
  192. - Drop ExclusiveArch
  193. * Thu Sep 25 2014 Karsten Hopp <karsten@redhat.com> 4.1-9.20130314
  194. - enable ppc64le and run 'make test' on that new arch
  195. * Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1-8.20130314
  196. - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
  197. * Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1-7.20130314
  198. - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
  199. * Sun Jan 12 2014 Peter Robinson <pbrobinson@fedoraproject.org> 4.1-6.20130314
  200. - Build on aarch64, minor spec cleanups
  201. * Tue Dec 3 2013 Petr Machata <pmachata@redhat.com> - 4.1-5.20130314
  202. - Fix building with -Werror=format-security (tbb-4.1-dont-snip-Wall.patch)
  203. * Thu Oct 3 2013 Petr Machata <pmachata@redhat.com> - 4.1-4.20130314
  204. - Fix %%install to also install include files that are not named *.h
  205. * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1-3.20130314
  206. - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
  207. * Tue May 28 2013 Petr Machata <pmachata@redhat.com> - 4.1-3.20130314
  208. - Enable ARM arches
  209. * Wed May 22 2013 Petr Machata <pmachata@redhat.com> - 4.1-2.20130314
  210. - Fix mfence patch. Since the __TBB_full_memory_fence macro was
  211. function-call-like, it stole () intended for function invocation.
  212. * Wed May 22 2013 Petr Machata <pmachata@redhat.com> - 4.1-1.20130314
  213. - Rebase to 4.1 update 3
  214. * Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-7.20120408
  215. - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
  216. * Tue Aug 28 2012 Petr Machata <pmachata@redhat.com> - 4.0-6.20120408
  217. - Fix build on PowerPC
  218. * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-5.20120408
  219. - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
  220. * Thu Jun 7 2012 Petr Machata <pmachata@redhat.com> - 4.0-4.20120408
  221. - Rebase to 4.0 update 4
  222. - Refresh Getting_Started.pdf, Reference.pdf, Tutorial.pdf
  223. - Provide pkg-config files
  224. - Resolves: #825402
  225. * Thu Apr 05 2012 Karsten Hopp <karsten@redhat.com> 4.0-3.20110809
  226. - tbb builds now on PPC(64)
  227. * Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-2.20110809
  228. - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
  229. * Tue Oct 18 2011 Petr Machata <pmachata@redhat.com> - 4.0-1.20110809
  230. - Rebase to 4.0
  231. - Port the mfence patch
  232. - Refresh the documentation bundle
  233. * Tue Jul 26 2011 Petr Machata <pmachata@redhat.com> - 3.0-1.20110419
  234. - Rebase to 3.0-r6
  235. - Port both patches
  236. - Package Design_Patterns.pdf
  237. - Thanks to Richard Shaw for initial rebase patch
  238. - Resolves: #723043
  239. * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2-3.20090809
  240. - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
  241. * Thu Jun 10 2010 Petr Machata <pmachata@redhat.com> - 2.2-2.20090809
  242. - Replace mfence instruction with xchg to make it run on ia32-class
  243. machines without SSE2.
  244. - Resolves: #600654
  245. * Tue Nov 3 2009 Petr Machata <pmachata@redhat.com> - 2.2-1.20090809
  246. - New upstream 2.2
  247. - Resolves: #521571
  248. * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-3.20080605
  249. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  250. * Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-2.20080605
  251. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  252. * Fri Jun 13 2008 Petr Machata <pmachata@redhat.com> - 2.1-1.20080605
  253. - New upstream 2.1
  254. - Drop soname patch, parallel make patch, and GCC 4.3 patch
  255. * Wed Feb 13 2008 Petr Machata <pmachata@redhat.com> - 2.0-4.20070927
  256. - Review fixes
  257. - Use updated URL
  258. - More timestamp preservation
  259. - Initial import into Fedora CVS
  260. * Mon Feb 11 2008 Petr Machata <pmachata@redhat.com> - 2.0-3.20070927
  261. - Review fixes
  262. - Preserve timestamp of installed files
  263. - Fix soname not to contain "debug"
  264. * Tue Feb 5 2008 Petr Machata <pmachata@redhat.com> - 2.0-2.20070927
  265. - Review fixes
  266. - GCC 4.3 patchset
  267. - Add BR util-linux net-tools
  268. - Add full URL to Source0
  269. - Build in debug mode to work around problems with GCC 4.3
  270. * Mon Dec 17 2007 Petr Machata <pmachata@redhat.com> - 2.0-1.20070927
  271. - Initial package.
  272. - Using SONAME patch from Debian.