intel-tbb: Fix for #16938 add custom libs method (#16972)

* intel-tbb: Fix for #16938 add custom libs method

Override the libs method to look for libraries of form libtbb*
(instead of inherited which looks for libintel-tbb*)

* Fixing pre-existing flake8 issues
This commit is contained in:
Tom Payerle 2020-06-06 17:12:46 -04:00 committed by GitHub
parent c835b93109
commit 885808cc13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,22 +132,22 @@ def coerce_to_spack(self, tbb_build_subdir):
for f in fs: for f in fs:
lines = open(f).readlines() lines = open(f).readlines()
of = open(f, "w") of = open(f, "w")
for l in lines: for lin in lines:
if l.strip().startswith("CPLUS ="): if lin.strip().startswith("CPLUS ="):
of.write("# coerced to spack\n") of.write("# coerced to spack\n")
of.write("CPLUS = $(CXX)\n") of.write("CPLUS = $(CXX)\n")
elif l.strip().startswith("CONLY ="): elif lin.strip().startswith("CONLY ="):
of.write("# coerced to spack\n") of.write("# coerced to spack\n")
of.write("CONLY = $(CC)\n") of.write("CONLY = $(CC)\n")
else: else:
of.write(l) of.write(lin)
def install(self, spec, prefix): def install(self, spec, prefix):
# Deactivate use of RTM with GCC when on an OS with a very old # Deactivate use of RTM with GCC when on an OS with a very old
# assembler. # assembler.
if (spec.satisfies('%gcc@4.8.0: os=rhel6') 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=centos6')
or spec.satisfies('%gcc@4.8.0: os=scientific6')): or spec.satisfies('%gcc@4.8.0: os=scientific6')):
filter_file(r'RTM_KEY.*=.*rtm.*', 'RTM_KEY =', filter_file(r'RTM_KEY.*=.*rtm.*', 'RTM_KEY =',
join_path('build', 'linux.gcc.inc')) join_path('build', 'linux.gcc.inc'))
@ -224,3 +224,9 @@ def darwin_fix(self):
# Replace @rpath in ids with full path # Replace @rpath in ids with full path
if sys.platform == 'darwin': if sys.platform == 'darwin':
fix_darwin_install_name(self.prefix.lib) fix_darwin_install_name(self.prefix.lib)
@property
def libs(self):
shared = True if '+shared' in self.spec else False
return find_libraries(
'libtbb*', root=self.prefix, shared=shared, recursive=True)