formatting
This commit is contained in:
parent
1a187e73ae
commit
267666cd97
@ -23,9 +23,9 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack import *
|
||||
import os
|
||||
import glob
|
||||
|
||||
|
||||
class Tbb(Package):
|
||||
"""Widely used C++ template library for task parallelism.
|
||||
Intel Threading Building Blocks (Intel TBB) lets you easily write parallel
|
||||
@ -35,12 +35,13 @@ class Tbb(Package):
|
||||
homepage = "http://www.threadingbuildingblocks.org/"
|
||||
|
||||
# Only version-specific URL's work for TBB
|
||||
version('4.4.4', 'd4cee5e4ca75cab5181834877738619c56afeb71', url='https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160413oss_src.tgz')
|
||||
version('4.4.3', '80707e277f69d9b20eeebdd7a5f5331137868ce1', url='https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160128oss_src_0.tgz')
|
||||
version('4.4.4', 'd4cee5e4ca75cab5181834877738619c56afeb71', url='https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160413oss_src.tgz') # NOQA: ignore=E501
|
||||
version('4.4.3', '80707e277f69d9b20eeebdd7a5f5331137868ce1', url='https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb44_20160128oss_src_0.tgz') # NOQA: ignore=E501
|
||||
|
||||
def coerce_to_spack(self, tbb_build_subdir):
|
||||
for compiler in ["icc", "gcc", "clang"]:
|
||||
fs = glob.glob(join_path(tbb_build_subdir,"*.%s.inc" % compiler ))
|
||||
fs = glob.glob(join_path(tbb_build_subdir,
|
||||
"*.%s.inc" % compiler))
|
||||
for f in fs:
|
||||
lines = open(f).readlines()
|
||||
of = open(f, "w")
|
||||
@ -52,21 +53,21 @@ def coerce_to_spack(self,tbb_build_subdir):
|
||||
of.write("# coerced to spack\n")
|
||||
of.write("CONLY = $(CC)\n")
|
||||
else:
|
||||
of.write(l);
|
||||
of.write(l)
|
||||
|
||||
def install(self, spec, prefix):
|
||||
if spec.satisfies('%gcc@6.1:') and spec.satisfies('@:4.4.3'):
|
||||
raise InstallError('Only TBB 4.4.4 and above build with GCC 6.1!')
|
||||
|
||||
# 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
|
||||
# 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:
|
||||
#
|
||||
# * Look at the spack spec to determine which compiler we should pass to tbb's Makefile
|
||||
# * Look at the spack spec to determine which compiler we should pass
|
||||
# to tbb's Makefile;
|
||||
#
|
||||
# * patch tbb's build system to use the compiler wrappers (CC, CXX) for
|
||||
# icc, gcc, clang
|
||||
# (see coerce_to_spack())
|
||||
# icc, gcc, clang (see coerce_to_spack());
|
||||
#
|
||||
self.coerce_to_spack("build")
|
||||
|
||||
@ -77,7 +78,6 @@ def install(self, spec, prefix):
|
||||
else:
|
||||
tbb_compiler = "gcc"
|
||||
|
||||
|
||||
mkdirp(prefix)
|
||||
mkdirp(prefix.lib)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user