addressed PR#946 comments from @adamjstewart
This commit is contained in:
parent
b8a91db089
commit
e9b71872a8
@ -154,7 +154,7 @@ def symlink_license(pkg):
|
||||
target = pkg.global_license_file
|
||||
for filename in pkg.license_files:
|
||||
link_name = join_path(pkg.prefix, filename)
|
||||
license_dir = os.path.split(link_name)[0]
|
||||
license_dir = os.path.dirname(link_name)
|
||||
if not os.path.exists(license_dir):
|
||||
mkdirp(license_dir)
|
||||
if os.path.exists(target):
|
||||
|
@ -399,13 +399,15 @@ def __init__(self, spec):
|
||||
|
||||
@property
|
||||
def global_license_dir(self):
|
||||
"""Returns the path where a global license file should be stored."""
|
||||
"""Returns the directory where global license files for all
|
||||
packages are stored."""
|
||||
spack_root = ancestor(__file__, 4)
|
||||
return join_path(spack_root, 'etc', 'spack', 'licenses')
|
||||
|
||||
@property
|
||||
def global_license_file(self):
|
||||
"""Returns the path where a global license file should be stored."""
|
||||
"""Returns the path where a global license file for this
|
||||
particular package should be stored."""
|
||||
if not self.license_files:
|
||||
return
|
||||
return join_path(self.global_license_dir, self.name,
|
||||
|
@ -4,7 +4,7 @@
|
||||
from spack.pkg.builtin.intel import IntelInstaller
|
||||
|
||||
class Daal(IntelInstaller):
|
||||
"""Intel Data Analytics Accesleration Library.
|
||||
"""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
|
||||
|
@ -1,9 +1,9 @@
|
||||
from spack import *
|
||||
import sys, os, re
|
||||
|
||||
from spack.pkg.builtin.intel import IntelInstaller, filter_pick
|
||||
from spack.pkg.builtin.intel import IntelInstaller, filter_pick, get_all_components
|
||||
|
||||
class IntelParallelstudio(IntelInstaller):
|
||||
class IntelParallelStudio(IntelInstaller):
|
||||
"""Intel Parallel Studio.
|
||||
|
||||
Note: You will have to add the download file to a
|
||||
@ -41,12 +41,6 @@ class IntelParallelstudio(IntelInstaller):
|
||||
|
||||
def install(self, spec, prefix):
|
||||
|
||||
# remove the installation DB, otherwise it will try to install into location of other Intel builds
|
||||
try:
|
||||
os.remove(os.path.join(os.environ["HOME"], "intel", "intel_sdp_products.db"))
|
||||
except OSError:
|
||||
pass # if the file does not exist
|
||||
|
||||
base_components = "ALL" # when in doubt, install everything
|
||||
mpi_components = ""
|
||||
mkl_components = ""
|
||||
@ -57,19 +51,13 @@ def install(self, spec, prefix):
|
||||
if spec.satisfies('+all'):
|
||||
base_components = "ALL"
|
||||
else:
|
||||
with open("pset/mediaconfig.xml", "r") as f:
|
||||
lines = f.readlines()
|
||||
all_components = []
|
||||
for line in lines:
|
||||
if line.find('<Abbr>') != -1:
|
||||
component = line[line.find('<Abbr>') + 6:line.find('</Abbr>')]
|
||||
all_components.append(component)
|
||||
base_components = filter_pick(all_components, re.compile('(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)').search)
|
||||
mpi_components = filter_pick(all_components, re.compile('(icsxe|imb|mpi|itac|intel-tc|clck)').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)
|
||||
tool_components = filter_pick(all_components, re.compile('(gdb|vtune|inspector|advisor)').search)
|
||||
all_components = get_all_components()
|
||||
base_components = filter_pick(all_components, re.compile('(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)').search)
|
||||
mpi_components = filter_pick(all_components, re.compile('(icsxe|imb|mpi|itac|intel-tc|clck)').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)
|
||||
tool_components = filter_pick(all_components, re.compile('(gdb|vtune|inspector|advisor)').search)
|
||||
|
||||
components = base_components
|
||||
if not spec.satisfies('+all'):
|
||||
@ -87,10 +75,10 @@ def install(self, spec, prefix):
|
||||
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]
|
||||
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")))
|
||||
|
||||
# symlink or copy?
|
||||
relbindir = absbindir.strip(os.path.commonprefix([self.prefix, absbindir]))
|
||||
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"))
|
@ -2,12 +2,15 @@
|
||||
import sys, os, 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()
|
||||
@ -39,10 +42,8 @@ def global_license_file(self):
|
||||
def install(self, spec, prefix):
|
||||
|
||||
# remove the installation DB, otherwise it will try to install into location of other Intel builds
|
||||
try:
|
||||
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"))
|
||||
except OSError:
|
||||
pass # if the file does not exist
|
||||
|
||||
if not hasattr(self, "intel_prefix"):
|
||||
self.intel_prefix = self.prefix
|
||||
@ -90,14 +91,8 @@ def install(self, spec, prefix):
|
||||
pass # if the file does not exist
|
||||
|
||||
components = []
|
||||
with open("pset/mediaconfig.xml", "r") as f:
|
||||
lines = f.readlines()
|
||||
all_components = []
|
||||
for line in lines:
|
||||
if line.find('<Abbr>') != -1:
|
||||
component = line[line.find('<Abbr>') + 6:line.find('</Abbr>')]
|
||||
all_components.append(component)
|
||||
components = filter_pick(all_components, re.compile('(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)').search)
|
||||
all_components = get_all_components()
|
||||
components = filter_pick(all_components, re.compile('(comp|openmp|intel-tbb|icc|ifort|psxe|icsxe-pset)').search)
|
||||
|
||||
self.intel_components = ';'.join(components)
|
||||
IntelInstaller.install(self, spec, prefix)
|
||||
|
Loading…
Reference in New Issue
Block a user