flake8 fixes
This commit is contained in:
parent
e3cd0a67d0
commit
c2ca5f44b4
2 changed files with 50 additions and 50 deletions
|
@ -2,7 +2,8 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from spack.pkg.builtin.intel import IntelInstaller, filter_pick, get_all_components
|
from spack.pkg.builtin.intel import IntelInstaller, filter_pick, \
|
||||||
|
get_all_components
|
||||||
|
|
||||||
|
|
||||||
class IntelParallelStudio(IntelInstaller):
|
class IntelParallelStudio(IntelInstaller):
|
||||||
|
@ -16,28 +17,28 @@ class IntelParallelStudio(IntelInstaller):
|
||||||
|
|
||||||
# TODO: can also try the online installer (will download files on demand)
|
# TODO: can also try the online installer (will download files on demand)
|
||||||
version('composer.2016.2', '1133fb831312eb519f7da897fec223fa',
|
version('composer.2016.2', '1133fb831312eb519f7da897fec223fa',
|
||||||
url="file://%s/parallel_studio_xe_2016_composer_edition_update2.tgz"
|
url="file://%s/parallel_studio_xe_2016_composer_edition_update2.tgz" # NOQA: ignore=E501
|
||||||
% os.getcwd())
|
% os.getcwd())
|
||||||
version('professional.2016.2', '70be832f2d34c9bf596a5e99d5f2d832',
|
version('professional.2016.2', '70be832f2d34c9bf596a5e99d5f2d832',
|
||||||
url="file://%s/parallel_studio_xe_2016_update2.tgz" % os.getcwd())
|
url="file://%s/parallel_studio_xe_2016_update2.tgz" % os.getcwd()) # NOQA: ignore=E501
|
||||||
version('cluster.2016.2', '70be832f2d34c9bf596a5e99d5f2d832',
|
version('cluster.2016.2', '70be832f2d34c9bf596a5e99d5f2d832',
|
||||||
url="file://%s/parallel_studio_xe_2016_update2.tgz" % os.getcwd())
|
url="file://%s/parallel_studio_xe_2016_update2.tgz" % os.getcwd()) # NOQA: ignore=E501
|
||||||
version('composer.2016.3', '3208eeabee951fc27579177b593cefe9',
|
version('composer.2016.3', '3208eeabee951fc27579177b593cefe9',
|
||||||
url="file://%s/parallel_studio_xe_2016_composer_edition_update3.tgz"
|
url="file://%s/parallel_studio_xe_2016_composer_edition_update3.tgz" # NOQA: ignore=E501
|
||||||
% os.getcwd())
|
% os.getcwd())
|
||||||
version('professional.2016.3', 'eda19bb0d0d19709197ede58f13443f3',
|
version('professional.2016.3', 'eda19bb0d0d19709197ede58f13443f3',
|
||||||
url="file://%s/parallel_studio_xe_2016_update3.tgz" % os.getcwd())
|
url="file://%s/parallel_studio_xe_2016_update3.tgz" % os.getcwd()) # NOQA: ignore=E501
|
||||||
version('cluster.2016.3', 'eda19bb0d0d19709197ede58f13443f3',
|
version('cluster.2016.3', 'eda19bb0d0d19709197ede58f13443f3',
|
||||||
url="file://%s/parallel_studio_xe_2016_update3.tgz" % os.getcwd())
|
url="file://%s/parallel_studio_xe_2016_update3.tgz" % os.getcwd()) # NOQA: ignore=E501
|
||||||
|
|
||||||
variant('rpath', default=True, description="Add rpath to .cfg files")
|
variant('rpath', default=True, description="Add rpath to .cfg files")
|
||||||
variant('all', default=False,
|
variant('all', default=False,
|
||||||
description="Install all files associated with the requested edition")
|
description="Install all files with the requested edition")
|
||||||
variant('mpi', default=True,
|
variant('mpi', default=True,
|
||||||
description="Install the Intel MPI library and ITAC tool")
|
description="Install the Intel MPI library and ITAC tool")
|
||||||
variant('mkl', default=True, description="Install the Intel MKL library")
|
variant('mkl', default=True, description="Install the Intel MKL library")
|
||||||
variant('daal',
|
variant('daal',
|
||||||
default=True, description="Install the Intel DAAL libraries")
|
default=True, description="Install the Intel DAAL libraries")
|
||||||
variant('ipp', default=True, description="Install the Intel IPP libraries")
|
variant('ipp', default=True, description="Install the Intel IPP libraries")
|
||||||
variant('tools', default=True, description="""Install the Intel Advisor,\
|
variant('tools', default=True, description="""Install the Intel Advisor,\
|
||||||
VTune Amplifier, and Inspector tools""")
|
VTune Amplifier, and Inspector tools""")
|
||||||
|
@ -59,19 +60,21 @@ def install(self, spec, prefix):
|
||||||
base_components = "ALL"
|
base_components = "ALL"
|
||||||
else:
|
else:
|
||||||
all_components = get_all_components()
|
all_components = get_all_components()
|
||||||
base_components = filter_pick(all_components,
|
regex = '(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)'
|
||||||
re.compile('(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)'
|
base_components = \
|
||||||
).search)
|
filter_pick(all_components, re.compile(regex).search)
|
||||||
mpi_components = filter_pick(all_components,
|
regex = '(icsxe|imb|mpi|itac|intel-tc|clck)'
|
||||||
re.compile('(icsxe|imb|mpi|itac|intel-tc|clck)').search)
|
mpi_components = \
|
||||||
mkl_components = filter_pick(all_components,
|
filter_pick(all_components, re.compile(regex).search)
|
||||||
re.compile('(mkl)').search)
|
mkl_components = \
|
||||||
daal_components = filter_pick(all_components,
|
filter_pick(all_components, re.compile('(mkl)').search)
|
||||||
re.compile('(daal)').search)
|
daal_components = \
|
||||||
ipp_components = filter_pick(all_components,
|
filter_pick(all_components, re.compile('(daal)').search)
|
||||||
re.compile('(ipp)').search)
|
ipp_components = \
|
||||||
tool_components = filter_pick(all_components,
|
filter_pick(all_components, re.compile('(ipp)').search)
|
||||||
re.compile('(gdb|vtune|inspector|advisor)').search)
|
regex = '(gdb|vtune|inspector|advisor)'
|
||||||
|
tool_components = \
|
||||||
|
filter_pick(all_components, re.compile(regex).search)
|
||||||
|
|
||||||
components = base_components
|
components = base_components
|
||||||
if not spec.satisfies('+all'):
|
if not spec.satisfies('+all'):
|
||||||
|
@ -83,8 +86,8 @@ def install(self, spec, prefix):
|
||||||
components += daal_components
|
components += daal_components
|
||||||
if spec.satisfies('+ipp'):
|
if spec.satisfies('+ipp'):
|
||||||
components += ipp_components
|
components += ipp_components
|
||||||
if spec.satisfies('+tools') and (spec.satisfies('@cluster') or\
|
if spec.satisfies('+tools') and (spec.satisfies('@cluster') or
|
||||||
spec.satisfies('@professional')):
|
spec.satisfies('@professional')):
|
||||||
components += tool_components
|
components += tool_components
|
||||||
|
|
||||||
self.intel_components = ';'.join(components)
|
self.intel_components = ';'.join(components)
|
||||||
|
@ -93,14 +96,12 @@ def install(self, spec, prefix):
|
||||||
absbindir = os.path.dirname(os.path.realpath(os.path.join(
|
absbindir = os.path.dirname(os.path.realpath(os.path.join(
|
||||||
self.prefix.bin, "icc")))
|
self.prefix.bin, "icc")))
|
||||||
abslibdir = os.path.dirname(os.path.realpath(os.path.join
|
abslibdir = os.path.dirname(os.path.realpath(os.path.join
|
||||||
(self.prefix.lib, "intel64", "libimf.a")))
|
(self.prefix.lib, "intel64", "libimf.a")))
|
||||||
|
|
||||||
relbindir = absbindir.strip(os.path.commonprefix([self.prefix,
|
|
||||||
absbindir]))
|
|
||||||
os.symlink(self.global_license_file, os.path.join(absbindir,
|
os.symlink(self.global_license_file, os.path.join(absbindir,
|
||||||
"license.lic"))
|
"license.lic"))
|
||||||
if spec.satisfies('+tools') and (spec.satisfies('@cluster') or\
|
if spec.satisfies('+tools') and (spec.satisfies('@cluster') or
|
||||||
spec.satisfies('@professional')):
|
spec.satisfies('@professional')):
|
||||||
os.mkdir(os.path.join(self.prefix, "inspector_xe/licenses"))
|
os.mkdir(os.path.join(self.prefix, "inspector_xe/licenses"))
|
||||||
os.symlink(self.global_license_file, os.path.join(
|
os.symlink(self.global_license_file, os.path.join(
|
||||||
self.prefix, "inspector_xe/licenses", "license.lic"))
|
self.prefix, "inspector_xe/licenses", "license.lic"))
|
||||||
|
@ -111,17 +112,17 @@ def install(self, spec, prefix):
|
||||||
os.symlink(self.global_license_file, os.path.join(
|
os.symlink(self.global_license_file, os.path.join(
|
||||||
self.prefix, "vtune_amplifier_xe/licenses", "license.lic"))
|
self.prefix, "vtune_amplifier_xe/licenses", "license.lic"))
|
||||||
|
|
||||||
if (spec.satisfies('+all') or spec.satisfies('+mpi')) and\
|
if (spec.satisfies('+all') or spec.satisfies('+mpi')) and \
|
||||||
spec.satisfies('@cluster'):
|
spec.satisfies('@cluster'):
|
||||||
os.symlink(self.global_license_file, os.path.join(
|
os.symlink(self.global_license_file, os.path.join(
|
||||||
self.prefix, "itac_latest", "license.lic"))
|
self.prefix, "itac_latest", "license.lic"))
|
||||||
|
|
||||||
if spec.satisfies('+rpath'):
|
if spec.satisfies('+rpath'):
|
||||||
for compiler_command in ["icc", "icpc", "ifort"]:
|
for compiler_command in ["icc", "icpc", "ifort"]:
|
||||||
cfgfilename = os.path.join(absbindir, "%s.cfg" %\
|
cfgfilename = os.path.join(absbindir, "%s.cfg" %
|
||||||
compiler_command)
|
compiler_command)
|
||||||
with open(cfgfilename, "w") as f:
|
with open(cfgfilename, "w") as f:
|
||||||
f.write('-Xlinker -rpath -Xlinker %s\n' % abslibdir)
|
f.write('-Xlinker -rpath -Xlinker %s\n' % abslibdir)
|
||||||
|
|
||||||
os.symlink(os.path.join(self.prefix.man, "common", "man1"),
|
os.symlink(os.path.join(self.prefix.man, "common", "man1"),
|
||||||
os.path.join(self.prefix.man, "man1"))
|
os.path.join(self.prefix.man, "man1"))
|
||||||
|
|
|
@ -52,9 +52,9 @@ def install(self, spec, prefix):
|
||||||
# Remove the installation DB, otherwise it will try to install into
|
# Remove the installation DB, otherwise it will try to install into
|
||||||
# location of other Intel builds
|
# location of other Intel builds
|
||||||
if os.path.exists(os.path.join(os.environ["HOME"], "intel",
|
if os.path.exists(os.path.join(os.environ["HOME"], "intel",
|
||||||
"intel_sdp_products.db")):
|
"intel_sdp_products.db")):
|
||||||
os.remove(os.path.join(os.environ["HOME"], "intel",
|
os.remove(os.path.join(os.environ["HOME"], "intel",
|
||||||
"intel_sdp_products.db"))
|
"intel_sdp_products.db"))
|
||||||
|
|
||||||
if not hasattr(self, "intel_prefix"):
|
if not hasattr(self, "intel_prefix"):
|
||||||
self.intel_prefix = self.prefix
|
self.intel_prefix = self.prefix
|
||||||
|
@ -71,7 +71,7 @@ def install(self, spec, prefix):
|
||||||
PHONEHOME_SEND_USAGE_DATA=no
|
PHONEHOME_SEND_USAGE_DATA=no
|
||||||
CONTINUE_WITH_OPTIONAL_ERROR=yes
|
CONTINUE_WITH_OPTIONAL_ERROR=yes
|
||||||
COMPONENTS=%s
|
COMPONENTS=%s
|
||||||
""" %(self.intel_prefix, self.global_license_file, self.intel_components))
|
""" % (self.intel_prefix, self.global_license_file, self.intel_components))
|
||||||
|
|
||||||
install_script = which("install.sh")
|
install_script = which("install.sh")
|
||||||
install_script('--silent', silent_config_filename)
|
install_script('--silent', silent_config_filename)
|
||||||
|
@ -88,10 +88,10 @@ class Intel(IntelInstaller):
|
||||||
|
|
||||||
# TODO: can also try the online installer (will download files on demand)
|
# TODO: can also try the online installer (will download files on demand)
|
||||||
version('16.0.2', '1133fb831312eb519f7da897fec223fa',
|
version('16.0.2', '1133fb831312eb519f7da897fec223fa',
|
||||||
url="file://%s/parallel_studio_xe_2016_composer_edition_update2.tgz"\
|
url="file://%s/parallel_studio_xe_2016_composer_edition_update2.tgz" # NOQA: ignore=E501
|
||||||
% os.getcwd())
|
% os.getcwd())
|
||||||
version('16.0.3', '3208eeabee951fc27579177b593cefe9',
|
version('16.0.3', '3208eeabee951fc27579177b593cefe9',
|
||||||
url="file://%s/parallel_studio_xe_2016_composer_edition_update3.tgz"\
|
url="file://%s/parallel_studio_xe_2016_composer_edition_update3.tgz" # NOQA: ignore=E501
|
||||||
% os.getcwd())
|
% os.getcwd())
|
||||||
|
|
||||||
variant('rpath', default=True, description="Add rpath to .cfg files")
|
variant('rpath', default=True, description="Add rpath to .cfg files")
|
||||||
|
@ -99,9 +99,8 @@ class Intel(IntelInstaller):
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
components = []
|
components = []
|
||||||
all_components = get_all_components()
|
all_components = get_all_components()
|
||||||
components = filter_pick(all_components,
|
regex = '(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)'
|
||||||
re.compile('(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)'
|
components = filter_pick(all_components, re.compile(regex).search)
|
||||||
).search)
|
|
||||||
|
|
||||||
self.intel_components = ';'.join(components)
|
self.intel_components = ';'.join(components)
|
||||||
IntelInstaller.install(self, spec, prefix)
|
IntelInstaller.install(self, spec, prefix)
|
||||||
|
@ -113,14 +112,14 @@ def install(self, spec, prefix):
|
||||||
|
|
||||||
# symlink or copy?
|
# symlink or copy?
|
||||||
os.symlink(self.global_license_file, os.path.join(absbindir,
|
os.symlink(self.global_license_file, os.path.join(absbindir,
|
||||||
"license.lic"))
|
"license.lic"))
|
||||||
|
|
||||||
if spec.satisfies('+rpath'):
|
if spec.satisfies('+rpath'):
|
||||||
for compiler_command in ["icc", "icpc", "ifort"]:
|
for compiler_command in ["icc", "icpc", "ifort"]:
|
||||||
cfgfilename = os.path.join(absbindir, "%s.cfg" %\
|
cfgfilename = os.path.join(absbindir, "%s.cfg" %
|
||||||
compiler_command)
|
compiler_command)
|
||||||
with open(cfgfilename, "w") as f:
|
with open(cfgfilename, "w") as f:
|
||||||
f.write('-Xlinker -rpath -Xlinker %s\n' % abslibdir)
|
f.write('-Xlinker -rpath -Xlinker %s\n' % abslibdir)
|
||||||
|
|
||||||
os.symlink(os.path.join(self.prefix.man, "common", "man1"),
|
os.symlink(os.path.join(self.prefix.man, "common", "man1"),
|
||||||
os.path.join(self.prefix.man, "man1"))
|
os.path.join(self.prefix.man, "man1"))
|
||||||
|
|
Loading…
Reference in a new issue