summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-06-17 14:28:39 -0700
committerGitHub <noreply@github.com>2016-06-17 14:28:39 -0700
commit0bbbfc2ef7f91494e057a525718c466c74dca830 (patch)
tree634d50d5897efd34315a98365d48bbceb2a9d224 /var
parentf351e011d1f91372492651829b9dd82d81cd191d (diff)
parent582d01784aa44024da598187c654947bfd2e55de (diff)
downloadspack-0bbbfc2ef7f91494e057a525718c466c74dca830.tar.gz
spack-0bbbfc2ef7f91494e057a525718c466c74dca830.tar.bz2
spack-0bbbfc2ef7f91494e057a525718c466c74dca830.tar.xz
spack-0bbbfc2ef7f91494e057a525718c466c74dca830.zip
Merge pull request #946 from LLNL/features/intel2
Intel software packages and license enhancements
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/daal/package.py28
-rw-r--r--var/spack/repos/builtin/packages/intel-parallel-studio/package.py144
-rw-r--r--var/spack/repos/builtin/packages/intel/package.py125
-rw-r--r--var/spack/repos/builtin/packages/ipp/package.py26
-rw-r--r--var/spack/repos/builtin/packages/mkl/package.py28
5 files changed, 351 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/daal/package.py b/var/spack/repos/builtin/packages/daal/package.py
new file mode 100644
index 0000000000..e13dd80e19
--- /dev/null
+++ b/var/spack/repos/builtin/packages/daal/package.py
@@ -0,0 +1,28 @@
+from spack import *
+import os
+
+from spack.pkg.builtin.intel import IntelInstaller
+
+
+class Daal(IntelInstaller):
+ """Intel Data Analytics Acceleration Library.
+
+ Note: You will have to add the download file to a
+ mirror so that Spack can find it. For instructions on how to set up a
+ mirror, see http://software.llnl.gov/spack/mirrors.html"""
+
+ homepage = "https://software.intel.com/en-us/daal"
+
+ version('2016.2.181', 'aad2aa70e5599ebfe6f85b29d8719d46',
+ url="file://%s/l_daal_2016.2.181.tgz" % os.getcwd())
+ version('2016.3.210', 'ad747c0dd97dace4cad03cf2266cad28',
+ url="file://%s/l_daal_2016.3.210.tgz" % os.getcwd())
+
+ def install(self, spec, prefix):
+
+ self.intel_prefix = os.path.join(prefix, "pkg")
+ IntelInstaller.install(self, spec, prefix)
+
+ daal_dir = os.path.join(self.intel_prefix, "daal")
+ for f in os.listdir(daal_dir):
+ os.symlink(os.path.join(daal_dir, f), os.path.join(self.prefix, f))
diff --git a/var/spack/repos/builtin/packages/intel-parallel-studio/package.py b/var/spack/repos/builtin/packages/intel-parallel-studio/package.py
new file mode 100644
index 0000000000..493ca16417
--- /dev/null
+++ b/var/spack/repos/builtin/packages/intel-parallel-studio/package.py
@@ -0,0 +1,144 @@
+from spack import *
+import os
+import re
+
+from spack.pkg.builtin.intel import IntelInstaller, filter_pick, \
+ get_all_components
+
+
+class IntelParallelStudio(IntelInstaller):
+ """Intel Parallel Studio.
+
+ Note: You will have to add the download file to a
+ mirror so that Spack can find it. For instructions on how to set up a
+ mirror, see http://software.llnl.gov/spack/mirrors.html"""
+
+ homepage = "https://software.intel.com/en-us/intel-parallel-studio-xe"
+
+ # TODO: can also try the online installer (will download files on demand)
+ version('composer.2016.2', '1133fb831312eb519f7da897fec223fa',
+ url="file://%s/parallel_studio_xe_2016_composer_edition_update2.tgz" # NOQA: ignore=E501
+ % os.getcwd())
+ version('professional.2016.2', '70be832f2d34c9bf596a5e99d5f2d832',
+ url="file://%s/parallel_studio_xe_2016_update2.tgz" % os.getcwd()) # NOQA: ignore=E501
+ version('cluster.2016.2', '70be832f2d34c9bf596a5e99d5f2d832',
+ url="file://%s/parallel_studio_xe_2016_update2.tgz" % os.getcwd()) # NOQA: ignore=E501
+ version('composer.2016.3', '3208eeabee951fc27579177b593cefe9',
+ url="file://%s/parallel_studio_xe_2016_composer_edition_update3.tgz" # NOQA: ignore=E501
+ % os.getcwd())
+ version('professional.2016.3', 'eda19bb0d0d19709197ede58f13443f3',
+ url="file://%s/parallel_studio_xe_2016_update3.tgz" % os.getcwd()) # NOQA: ignore=E501
+ version('cluster.2016.3', 'eda19bb0d0d19709197ede58f13443f3',
+ 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('newdtags', default=False,
+ description="Allow use of --enable-new-dtags in MPI wrappers")
+ variant('all', default=False,
+ description="Install all files with the requested edition")
+ variant('mpi', default=True,
+ description="Install the Intel MPI library and ITAC tool")
+ variant('mkl', default=True, description="Install the Intel MKL library")
+ variant('daal',
+ default=True, description="Install the Intel DAAL libraries")
+ variant('ipp', default=True, description="Install the Intel IPP libraries")
+ variant('tools', default=True, description="""Install the Intel Advisor,\
+VTune Amplifier, and Inspector tools""")
+
+ provides('mpi', when='@cluster:+mpi')
+ provides('mkl', when='+mkl')
+ provides('daal', when='+daal')
+ provides('ipp', when='+ipp')
+
+ def install(self, spec, prefix):
+
+ base_components = "ALL" # when in doubt, install everything
+ mpi_components = ""
+ mkl_components = ""
+ daal_components = ""
+ ipp_components = ""
+
+ if spec.satisfies('+all'):
+ base_components = "ALL"
+ else:
+ all_components = get_all_components()
+ regex = '(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)'
+ base_components = \
+ filter_pick(all_components, re.compile(regex).search)
+ regex = '(icsxe|imb|mpi|itac|intel-tc|clck)'
+ mpi_components = \
+ filter_pick(all_components, re.compile(regex).search)
+ mkl_components = \
+ filter_pick(all_components, re.compile('(mkl)').search)
+ daal_components = \
+ filter_pick(all_components, re.compile('(daal)').search)
+ ipp_components = \
+ filter_pick(all_components, re.compile('(ipp)').search)
+ regex = '(gdb|vtune|inspector|advisor)'
+ tool_components = \
+ filter_pick(all_components, re.compile(regex).search)
+
+ components = base_components
+ if not spec.satisfies('+all'):
+ if spec.satisfies('+mpi') and 'cluster' in str(spec.version):
+ components += mpi_components
+ if spec.satisfies('+mkl'):
+ components += mkl_components
+ if spec.satisfies('+daal'):
+ components += daal_components
+ if spec.satisfies('+ipp'):
+ components += ipp_components
+ if spec.satisfies('+tools') and (spec.satisfies('@cluster') or
+ spec.satisfies('@professional')):
+ components += tool_components
+
+ self.intel_components = ';'.join(components)
+ IntelInstaller.install(self, spec, prefix)
+
+ absbindir = os.path.dirname(os.path.realpath(os.path.join(
+ self.prefix.bin, "icc")))
+ abslibdir = os.path.dirname(os.path.realpath(os.path.join
+ (self.prefix.lib, "intel64", "libimf.a")))
+
+ os.symlink(self.global_license_file, os.path.join(absbindir,
+ "license.lic"))
+ if spec.satisfies('+tools') and (spec.satisfies('@cluster') or
+ spec.satisfies('@professional')):
+ os.mkdir(os.path.join(self.prefix, "inspector_xe/licenses"))
+ os.symlink(self.global_license_file, os.path.join(
+ self.prefix, "inspector_xe/licenses", "license.lic"))
+ os.mkdir(os.path.join(self.prefix, "advisor_xe/licenses"))
+ os.symlink(self.global_license_file, os.path.join(
+ self.prefix, "advisor_xe/licenses", "license.lic"))
+ os.mkdir(os.path.join(self.prefix, "vtune_amplifier_xe/licenses"))
+ os.symlink(self.global_license_file, os.path.join(
+ self.prefix, "vtune_amplifier_xe/licenses", "license.lic"))
+
+ if (spec.satisfies('+all') or spec.satisfies('+mpi')) and \
+ spec.satisfies('@cluster'):
+ os.symlink(self.global_license_file, os.path.join(
+ self.prefix, "itac_latest", "license.lic"))
+ if spec.satisfies('~newdtags'):
+ wrappers = ["mpif77", "mpif77", "mpif90", "mpif90",
+ "mpigcc", "mpigcc", "mpigxx", "mpigxx",
+ "mpiicc", "mpiicc", "mpiicpc", "mpiicpc",
+ "mpiifort", "mpiifort"]
+ wrapper_paths = []
+ for root, dirs, files in os.walk(spec.prefix):
+ for name in files:
+ if name in wrappers:
+ wrapper_paths.append(os.path.join(spec.prefix,
+ root, name))
+ for wrapper in wrapper_paths:
+ filter_file(r'-Xlinker --enable-new-dtags', r' ',
+ wrapper)
+
+ if spec.satisfies('+rpath'):
+ for compiler_command in ["icc", "icpc", "ifort"]:
+ cfgfilename = os.path.join(absbindir, "%s.cfg" %
+ compiler_command)
+ with open(cfgfilename, "w") as f:
+ f.write('-Xlinker -rpath -Xlinker %s\n' % abslibdir)
+
+ os.symlink(os.path.join(self.prefix.man, "common", "man1"),
+ os.path.join(self.prefix.man, "man1"))
diff --git a/var/spack/repos/builtin/packages/intel/package.py b/var/spack/repos/builtin/packages/intel/package.py
new file mode 100644
index 0000000000..ec3192380a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/intel/package.py
@@ -0,0 +1,125 @@
+from spack import *
+import os
+import re
+
+
+def filter_pick(input_list, regex_filter):
+ """Returns the items in input_list that are found in the regex_filter"""
+ return [l for l in input_list for m in (regex_filter(l),) if m]
+
+
+def unfilter_pick(input_list, regex_filter):
+ """Returns the items in input_list that are not found in the
+ regex_filter"""
+ return [l for l in input_list for m in (regex_filter(l),) if not m]
+
+
+def get_all_components():
+ """Returns a list of all the components associated with the downloaded
+ Intel package"""
+ all_components = []
+ with open("pset/mediaconfig.xml", "r") as f:
+ lines = f.readlines()
+ for line in lines:
+ if line.find('<Abbr>') != -1:
+ component = line[line.find('<Abbr>') + 6:line.find('</Abbr>')]
+ all_components.append(component)
+ return all_components
+
+
+class IntelInstaller(Package):
+ """Base package containing common methods for installing Intel software"""
+
+ homepage = "https://software.intel.com/en-us"
+ intel_components = "ALL"
+ license_required = True
+ license_comment = '#'
+ license_files = ['Licenses/license.lic']
+ license_vars = ['INTEL_LICENSE_FILE']
+ license_url = \
+ 'https://software.intel.com/en-us/articles/intel-license-manager-faq'
+
+ @property
+ def global_license_file(self):
+ """Returns the path where a global license file should be stored."""
+ if not self.license_files:
+ return
+ return join_path(self.global_license_dir, "intel",
+ os.path.basename(self.license_files[0]))
+
+ def install(self, spec, prefix):
+
+ # Remove the installation DB, otherwise it will try to install into
+ # location of other Intel builds
+ if os.path.exists(os.path.join(os.environ["HOME"], "intel",
+ "intel_sdp_products.db")):
+ os.remove(os.path.join(os.environ["HOME"], "intel",
+ "intel_sdp_products.db"))
+
+ if not hasattr(self, "intel_prefix"):
+ self.intel_prefix = self.prefix
+
+ silent_config_filename = 'silent.cfg'
+ with open(silent_config_filename, 'w') as f:
+ f.write("""
+ACCEPT_EULA=accept
+PSET_MODE=install
+CONTINUE_WITH_INSTALLDIR_OVERWRITE=yes
+PSET_INSTALL_DIR=%s
+ACTIVATION_LICENSE_FILE=%s
+ACTIVATION_TYPE=license_file
+PHONEHOME_SEND_USAGE_DATA=no
+CONTINUE_WITH_OPTIONAL_ERROR=yes
+COMPONENTS=%s
+""" % (self.intel_prefix, self.global_license_file, self.intel_components))
+
+ install_script = which("install.sh")
+ install_script('--silent', silent_config_filename)
+
+
+class Intel(IntelInstaller):
+ """Intel Compilers.
+
+ Note: You will have to add the download file to a
+ mirror so that Spack can find it. For instructions on how to set up a
+ mirror, see http://software.llnl.gov/spack/mirrors.html"""
+
+ homepage = "https://software.intel.com/en-us/intel-parallel-studio-xe"
+
+ # TODO: can also try the online installer (will download files on demand)
+ version('16.0.2', '1133fb831312eb519f7da897fec223fa',
+ url="file://%s/parallel_studio_xe_2016_composer_edition_update2.tgz" # NOQA: ignore=E501
+ % os.getcwd())
+ version('16.0.3', '3208eeabee951fc27579177b593cefe9',
+ url="file://%s/parallel_studio_xe_2016_composer_edition_update3.tgz" # NOQA: ignore=E501
+ % os.getcwd())
+
+ variant('rpath', default=True, description="Add rpath to .cfg files")
+
+ def install(self, spec, prefix):
+ components = []
+ all_components = get_all_components()
+ regex = '(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)'
+ components = filter_pick(all_components, re.compile(regex).search)
+
+ self.intel_components = ';'.join(components)
+ IntelInstaller.install(self, spec, prefix)
+
+ absbindir = os.path.split(os.path.realpath(os.path.join(
+ self.prefix.bin, "icc")))[0]
+ abslibdir = os.path.split(os.path.realpath(os.path.join(
+ self.prefix.lib, "intel64", "libimf.a")))[0]
+
+ # symlink or copy?
+ os.symlink(self.global_license_file, os.path.join(absbindir,
+ "license.lic"))
+
+ if spec.satisfies('+rpath'):
+ for compiler_command in ["icc", "icpc", "ifort"]:
+ cfgfilename = os.path.join(absbindir, "%s.cfg" %
+ compiler_command)
+ with open(cfgfilename, "w") as f:
+ f.write('-Xlinker -rpath -Xlinker %s\n' % abslibdir)
+
+ os.symlink(os.path.join(self.prefix.man, "common", "man1"),
+ os.path.join(self.prefix.man, "man1"))
diff --git a/var/spack/repos/builtin/packages/ipp/package.py b/var/spack/repos/builtin/packages/ipp/package.py
new file mode 100644
index 0000000000..2bd931d5bd
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ipp/package.py
@@ -0,0 +1,26 @@
+from spack import *
+import os
+
+from spack.pkg.builtin.intel import IntelInstaller
+
+
+class Ipp(IntelInstaller):
+ """Intel Integrated Performance Primitives.
+
+ Note: You will have to add the download file to a
+ mirror so that Spack can find it. For instructions on how to set up a
+ mirror, see http://software.llnl.gov/spack/mirrors.html"""
+
+ homepage = "https://software.intel.com/en-us/intel-ipp"
+
+ version('9.0.3.210', '0e1520dd3de7f811a6ef6ebc7aa429a3',
+ url="file://%s/l_ipp_9.0.3.210.tgz" % os.getcwd())
+
+ def install(self, spec, prefix):
+
+ self.intel_prefix = os.path.join(prefix, "pkg")
+ IntelInstaller.install(self, spec, prefix)
+
+ ipp_dir = os.path.join(self.intel_prefix, "ipp")
+ for f in os.listdir(ipp_dir):
+ os.symlink(os.path.join(ipp_dir, f), os.path.join(self.prefix, f))
diff --git a/var/spack/repos/builtin/packages/mkl/package.py b/var/spack/repos/builtin/packages/mkl/package.py
new file mode 100644
index 0000000000..454e78d29c
--- /dev/null
+++ b/var/spack/repos/builtin/packages/mkl/package.py
@@ -0,0 +1,28 @@
+from spack import *
+import os
+
+from spack.pkg.builtin.intel import IntelInstaller
+
+
+class Mkl(IntelInstaller):
+ """Intel Math Kernel Library.
+
+ Note: You will have to add the download file to a
+ mirror so that Spack can find it. For instructions on how to set up a
+ mirror, see http://software.llnl.gov/spack/mirrors.html"""
+
+ homepage = "https://software.intel.com/en-us/intel-mkl"
+
+ version('11.3.2.181', '536dbd82896d6facc16de8f961d17d65',
+ url="file://%s/l_mkl_11.3.2.181.tgz" % os.getcwd())
+ version('11.3.3.210', 'f72546df27f5ebb0941b5d21fd804e34',
+ url="file://%s/l_mkl_11.3.3.210.tgz" % os.getcwd())
+
+ def install(self, spec, prefix):
+
+ self.intel_prefix = os.path.join(prefix, "pkg")
+ IntelInstaller.install(self, spec, prefix)
+
+ mkl_dir = os.path.join(self.intel_prefix, "mkl")
+ for f in os.listdir(mkl_dir):
+ os.symlink(os.path.join(mkl_dir, f), os.path.join(self.prefix, f))