intel-tbb: fix and update patches for latest versions (#13932)

Commit 78724357 added versions 2019.5 to 2019.8 but failed to update
the patches for these versions.

1. gcc_generic-pedantic patch -- include this up through 2019.5.  This
was fixed in the TBB source tree in 2019.6.

2. tbb_cmakeConfig patch -- this needs to be modified (different file)
for 2019.5 and later.

3. tbb_gcc_rtm_key patch -- replace this with filter_file.  This is
simpler and eliminates the need to update the patch whenever the
surrounding context changes.
This commit is contained in:
Mark W. Krentel 2019-11-29 13:18:56 -06:00 committed by Adam J. Stewart
parent 0f464b8d9f
commit 92ca639905
4 changed files with 33 additions and 48 deletions

View File

@ -17,6 +17,9 @@ class IntelTbb(Package):
"""
homepage = "http://www.threadingbuildingblocks.org/"
# Note: when adding new versions, please check and update the
# patches and filters below as needed.
# See url_for_version() below.
version('2019.8', sha256='7b1fd8caea14be72ae4175896510bf99c809cd7031306a1917565e6de7382fba')
version('2019.7', sha256='4204a93f4c0fd989fb6f79acae74feb02ee39725c93968773d9b6efeb75c7a6a')
@ -86,36 +89,18 @@ class IntelTbb(Package):
# to patch `2019.1` without patching `2019`. When #8957 is fixed, this
# can be simplified.
# Deactivate use of RTM with GCC when on an OS with an elderly assembler.
# one patch format for 2019.1 and after...
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.4 %gcc@4.8.0: os=rhel6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.4 %gcc@4.8.0: os=scientific6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.4 %gcc@4.8.0: os=centos6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.3 %gcc@4.8.0: os=rhel6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.3 %gcc@4.8.0: os=scientific6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.3 %gcc@4.8.0: os=centos6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.2 %gcc@4.8.0: os=rhel6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.2 %gcc@4.8.0: os=scientific6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.2 %gcc@4.8.0: os=centos6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.1 %gcc@4.8.0: os=rhel6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.1 %gcc@4.8.0: os=scientific6')
patch("tbb_gcc_rtm_key_2019U1.patch", level=0, when='@2019.1 %gcc@4.8.0: os=centos6')
# ...another patch file for 2019 and before
patch("tbb_gcc_rtm_key.patch", level=0, when='@:2019.0 %gcc@4.8.0: os=rhel6')
patch("tbb_gcc_rtm_key.patch", level=0, when='@:2019.0 %gcc@4.8.0: os=scientific6')
patch("tbb_gcc_rtm_key.patch", level=0, when='@:2019.0 %gcc@4.8.0: os=centos6')
# patch for pedantic warnings (#10836)
# one patch file for 2019.1 and after...
patch("gcc_generic-pedantic-2019.patch", level=1, when='@2019.4')
patch("gcc_generic-pedantic-2019.patch", level=1, when='@2019.3')
patch("gcc_generic-pedantic-2019.patch", level=1, when='@2019.2')
patch("gcc_generic-pedantic-2019.patch", level=1, when='@2019.1')
# Patch for pedantic warnings (#10836). This was fixed in the TBB
# source tree in 2019.6. One patch file for 2019.1 and after...
patch("gcc_generic-pedantic-2019.patch", level=1,
when='@2019.1,2019.2,2019.3,2019.4,2019.5')
# ...another patch file for 2019 and before
patch("gcc_generic-pedantic-4.4.patch", level=1, when='@:2019.0')
# Patch cmakeConfig.cmake.in to find the libraries where we install them.
patch("tbb_cmakeConfig.patch", level=0, when='@2017.0:')
# Can't use '@2019.5:' because 2019.5 <= 2019 <= 2019.99. wtf!?
patch("tbb_cmakeConfig-2019.5.patch", level=0,
when='@2019.5,2019.6,2019.7,2019.8')
patch("tbb_cmakeConfig.patch", level=0, when='@2017.0:2019.4')
# Some very old systems don't support transactional memory.
patch("disable-tm.patch", when='~tm')
@ -145,6 +130,14 @@ def coerce_to_spack(self, tbb_build_subdir):
of.write(l)
def install(self, spec, prefix):
# Deactivate use of RTM with GCC when on an OS with a very old
# assembler.
if (spec.satisfies('%gcc@4.8.0: os=rhel6')
or spec.satisfies('%gcc@4.8.0: os=centos6')
or spec.satisfies('%gcc@4.8.0: os=scientific6')):
filter_file(r'RTM_KEY.*=.*rtm.*', 'RTM_KEY =',
join_path('build', 'linux.gcc.inc'))
# We need to follow TBB's compiler selection logic to get the proper
# build + link flags but we still need to use spack's compiler wrappers
# to accomplish this, we do two things:

View File

@ -0,0 +1,14 @@
This patch adapts the tbb_cmakeConfig.patch for 2019.5 and later.
The file changed.
--- cmake/TBBMakeConfig.cmake.orig 2019-03-21 10:28:21.000000000 -0500
+++ cmake/TBBMakeConfig.cmake 2019-11-27 22:52:45.270824744 -0600
@@ -175,7 +175,7 @@
${TBB_CHOOSE_COMPILER_SUBDIR}
-get_filename_component(_tbb_lib_path \"\${_tbb_root}/${TBB_SHARED_LIB_DIR}/\${_tbb_arch_subdir}/\${_tbb_compiler_subdir}\" ABSOLUTE)
+get_filename_component(_tbb_lib_path \"\${_tbb_root}/${TBB_SHARED_LIB_DIR}\" ABSOLUTE)
")
set(TBB_RELEASE_LIB_PATH "\${_tbb_lib_path}")

View File

@ -1,11 +0,0 @@
--- build/linux.gcc.inc~ 2016-09-15 07:00:44.000000000 -0500
+++ build/linux.gcc.inc 2018-06-07 17:32:53.181194974 -0500
@@ -46,7 +46,7 @@
# gcc 4.8 and later support RTM intrinsics, but require command line switch to enable them
ifneq (,$(shell gcc -dumpversion | egrep "^(4\.[8-9]|[5-9])"))
- RTM_KEY = -mrtm
+ RTM_KEY = # -mrtm
endif
ifeq ($(cfg), release)

View File

@ -1,11 +0,0 @@
--- build/linux.gcc.inc~ 2016-09-15 07:00:44.000000000 -0500
+++ build/linux.gcc.inc 2018-06-07 17:32:53.181194974 -0500
@@ -46,7 +46,7 @@
# gcc 4.8 and later support RTM intrinsics, but require command line switch to enable them
ifneq (,$(shell $(CONLY) -dumpversion | egrep "^(4\.[8-9]|[5-9])"))
- RTM_KEY = -mrtm
+ RTM_KEY = # -mrtm
endif
ifeq ($(cfg), release)