Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
15b48de
added support for Intel 2016 compilers
fmasselink Sep 18, 2015
782d164
Added support for installing Intel compilers v2016
fmasselink Sep 18, 2015
12c6707
Modified according to pull request #691
fmasselink Sep 18, 2015
01254a5
removed make_module_extra
fmasselink Sep 22, 2015
441d1b6
fixed paths for TBB, debugger. dirmap will now hold original items if…
fmasselink Oct 15, 2015
5e95c15
removed double modextravars and explicit gccversion = None
fmasselink Oct 15, 2015
dd719d8
Add mkl 11.3.1.150 support
jas02 Nov 20, 2015
e3d3bd7
Merge remote-tracking branch 'origin/pr/691' into intelstuff
wpoely86 Dec 2, 2015
68601e1
Merge remote-tracking branch 'origin/pr/745' into intelstuff
wpoely86 Dec 2, 2015
0c93d24
Add support for components in intelbase
wpoely86 Dec 2, 2015
2c7b901
Make pep8 happy in icc.py
wpoely86 Dec 2, 2015
1c89414
Add support for components in icc.py
wpoely86 Dec 2, 2015
a80cb3e
Extend sanity check of ifort.py
wpoely86 Dec 2, 2015
e0a699e
Sync sanity check of ifort to icc
wpoely86 Dec 2, 2015
529d833
Fix remarks for intelbase
wpoely86 Dec 2, 2015
a679e85
Fix sanity check for intel components
wpoely86 Dec 2, 2015
a2fe2c6
Added prefix function to tbb.py
wpoely86 Dec 2, 2015
2538db8
Refactor modules_req_guess in icc
wpoely86 Dec 2, 2015
511f306
Bugfix in intelbase
wpoely86 Dec 2, 2015
2eafc48
Fix stuff in icc.py
wpoely86 Dec 3, 2015
ebf0b01
Another bugfix
wpoely86 Dec 3, 2015
aad3aa8
Extend sanity check and guessed paths
wpoely86 Dec 3, 2015
da1e6c1
Another bugfix
wpoely86 Dec 3, 2015
4ba5208
Fix sanity check of ifort
wpoely86 Dec 3, 2015
44691d9
Add Lumir Jasiok to imkl author list
jas02 Dec 3, 2015
28784b8
style fixes in IntelBase
boegel Dec 3, 2015
a28d108
fix check for unquoted COMPONENTS
boegel Dec 3, 2015
6d710a8
avoid magic strings 'ALL' and 'DEFAULTS'
boegel Dec 3, 2015
3da141b
Merge pull request #14 from boegel/intelstuff
wpoely86 Dec 3, 2015
e957325
style fixes + eat your own dogfood in TBB easyblock
boegel Dec 7, 2015
ad5dd90
Merge pull request #15 from boegel/intelstuff
wpoely86 Dec 7, 2015
86980d0
clean up the mess in EB_icc.make_module_req_guess + other style fixes…
boegel Dec 7, 2015
9621fca
avoid duplicate entry for lib/intel64
boegel Dec 7, 2015
2751b6b
use 'include' and 'lib/intel64' last to make @wpoely86 happy
boegel Dec 8, 2015
7c32f22
Merge pull request #16 from boegel/intelstuff
wpoely86 Dec 8, 2015
1e62d51
Merge branch 'develop' into intelstuff
boegel Dec 10, 2015
6db01eb
Merge pull request #17 from boegel/intelstuff
wpoely86 Dec 10, 2015
52576ba
minor style fixes, incl. removing tabs in imkl.py
boegel Dec 10, 2015
5056324
fall back to ALL as value for components for icc/ifort 2016.x
boegel Dec 10, 2015
d45a76c
check for empty list of components
boegel Dec 11, 2015
7fe31aa
fix remark
boegel Dec 11, 2015
1d9671e
Merge pull request #18 from boegel/intelstuff
wpoely86 Dec 11, 2015
690dac6
Merge branch 'develop' into intelstuff
boegel Dec 13, 2015
f95c94e
Merge pull request #19 from boegel/intelstuff
wpoely86 Dec 13, 2015
6b9f768
don't include 'include' icc/ifort subdir in $CPATH, causes problems w…
boegel Dec 14, 2015
2c22db5
Merge pull request #20 from boegel/intelstuff
wpoely86 Dec 14, 2015
b2007f0
Merge branch 'develop' into intelstuff
boegel Dec 14, 2015
f256e2c
Merge pull request #21 from boegel/intelstuff
wpoely86 Dec 14, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 52 additions & 1 deletion easybuild/easyblocks/generic/intelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from easybuild.framework.easyblock import EasyBlock
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.filetools import read_file
from easybuild.tools.run import run_cmd

from vsc.utils import fancylogger
Expand Down Expand Up @@ -81,6 +82,9 @@
LICENSE_FILE_NAME = 'ACTIVATION_LICENSE_FILE' # since icc/ifort v2013_sp1, impi v4.1.1, imkl v11.1
LICENSE_FILE_NAME_2012 = 'PSET_LICENSE_FILE' # previous license file parameter used in older versions

COMP_ALL = 'ALL'
COMP_DEFAULTS = 'DEFAULTS'


class IntelBase(EasyBlock):
"""
Expand All @@ -100,6 +104,8 @@ def __init__(self, *args, **kwargs):
common_tmp_dir = os.path.dirname(tempfile.gettempdir()) # common tmp directory, same across nodes
self.home_subdir_local = os.path.join(common_tmp_dir, os.getenv('USER'), 'easybuild_intel')

self.install_components = None

@staticmethod
def extra_options(extra_vars=None):
extra_vars = EasyBlock.extra_options(extra_vars)
Expand All @@ -111,10 +117,38 @@ def extra_options(extra_vars=None):
# disables TMP_PATH env and command line option
'usetmppath': [False, "Use temporary path for installation", CUSTOM],
'm32': [False, "Enable 32-bit toolchain", CUSTOM],
'components': [None, "List of components to install", CUSTOM],
})

return extra_vars

def parse_components_list(self):
"""parse the regex in the components extra_options and select the matching components
from the mediaconfig.xml file in the install dir"""

mediaconfigpath = os.path.join(self.cfg['start_dir'], 'pset', 'mediaconfig.xml')
if not os.path.isfile(mediaconfigpath):
raise EasyBuildError("Could not find %s to find list of components." % mediaconfigpath)

mediaconfig = read_file(mediaconfigpath)
available_components = re.findall("<Abbr>(?P<component>[^<]+)</Abbr>", mediaconfig, re.M)
self.log.debug("Intel components found: %s" % available_components)
self.log.debug("Using regex list: %s" % self.cfg['components'])

if COMP_ALL in self.cfg['components'] or COMP_DEFAULTS in self.cfg['components']:
if len(self.cfg['components']) == 1:
self.install_components = self.cfg['components']
else:
raise EasyBuildError("If you specify %s as components, you cannot specify anything else: %s",
' or '.join([COMP_ALL, COMP_DEFAULTS]), self.cfg['components'])
else:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only here we need to actually parse mediaconfig.xml, so only do it here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I can print the list of components available when using ALL in debug mode. Lets keep that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, sure, but it does mean there's no way around if mediaconfig.xml is not available for some reason...

unless you allow that mediaconfig.xml is not available above, and only complain here if available_components is None

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to raise if mediaconfig.xml is not found. It has no point specifying components if it's not there.

self.install_components = []
for comp_regex in self.cfg['components']:
comps = [comp for comp in available_components if re.match(comp_regex, comp)]
self.install_components.extend(comps)

self.log.debug("Components to install: %s" % self.install_components)

def clean_home_subdir(self):
"""Remove contents of (local) 'intel' directory home subdir, where stuff is cached."""

Expand Down Expand Up @@ -254,6 +288,12 @@ def configure_step(self):
# clean home directory
self.clean_home_subdir()

# determine list of components, based on 'components' easyconfig parameter (if specified)
if self.cfg['components']:
self.parse_components_list()
else:
self.log.debug("No components specified")

def build_step(self):
"""Binary installation files, so no building."""
pass
Expand All @@ -277,7 +317,8 @@ def install_step(self, silent_cfg_names_map=None, silent_cfg_extras=None):
if lic_activation in lic_file_server_activations:
lic_file_entry = "%(license_file_name)s=%(license_file)s"
elif not self.cfg['license_activation'] in other_activations:
raise EasyBuildError("Unknown type of activation specified: %s (known :%s)", lic_activation, ACTIVATION_TYPES)
raise EasyBuildError("Unknown type of activation specified: %s (known :%s)",
lic_activation, ACTIVATION_TYPES)

silent = '\n'.join([
"%(activation_name)s=%(activation)s",
Expand All @@ -298,6 +339,16 @@ def install_step(self, silent_cfg_names_map=None, silent_cfg_extras=None):
'install_mode_name': silent_cfg_names_map.get('install_mode_name', INSTALL_MODE_NAME_2015),
}

if self.install_components is not None:
if len(self.install_components) == 1 and self.install_components[0] in [COMP_ALL, COMP_DEFAULTS]:
# no quotes should be used for ALL or DEFAULTS
silent += 'COMPONENTS=%s\n' % self.install_components[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for this separate case?

';'.join(['ALL'] is equivalent to 'ALL'?

elif self.install_components:
# a list of components is specified (needs quotes)
silent += 'COMPONENTS="' + ';'.join(self.install_components) + '"\n'
else:
raise EasyBuildError("Empty list of matching components obtained via %s", self.cfg['components'])

if silent_cfg_extras is not None:
if isinstance(silent_cfg_extras, dict):
silent += '\n'.join("%s=%s" % (key, value) for (key, value) in silent_cfg_extras.iteritems())
Expand Down
183 changes: 124 additions & 59 deletions easybuild/easyblocks/i/icc.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@
@author: Kenneth Hoste (Ghent University)
@author: Pieter De Baets (Ghent University)
@author: Jens Timmerman (Ghent University)
@author: Ward Poelmans (Ghent University)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DirkdeDraak You didn't add yourself to the list of authors. What should I add?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, see below

@author: Fokko Masselink
"""

import os
import re
from distutils.version import LooseVersion

from easybuild.easyblocks.generic.intelbase import IntelBase, ACTIVATION_NAME_2012, LICENSE_FILE_NAME_2012
from easybuild.easyblocks.generic.intelbase import IntelBase, ACTIVATION_NAME_2012, COMP_ALL
from easybuild.easyblocks.generic.intelbase import LICENSE_FILE_NAME_2012
from easybuild.easyblocks.t.tbb import get_tbb_gccprefix
from easybuild.tools.run import run_cmd


Expand All @@ -58,6 +62,18 @@ class EB_icc(IntelBase):
- will fail for all older versions (due to newer silent installer)
"""

def __init__(self, *args, **kwargs):
"""Constructor, initialize class variables."""
super(EB_icc, self).__init__(*args, **kwargs)

self.debuggerpath = None

if LooseVersion(self.version) >= LooseVersion('2016') and self.cfg['components'] is None:
# we need to use 'ALL' by default, using 'DEFAULTS' results in key things not being installed (e.g. bin/icc)
self.cfg['components'] = [COMP_ALL]
self.log.debug("Nothing specified for components, but required for version 2016, using %s instead",
self.cfg['components'])

def install_step(self):
"""
Actual installation
Expand All @@ -79,79 +95,128 @@ def install_step(self):
def sanity_check_step(self):
"""Custom sanity check paths for icc."""

binprefix = "bin/intel64"
libprefix = "lib/intel64/lib"
if LooseVersion(self.version) >= LooseVersion("2011"):
if LooseVersion(self.version) <= LooseVersion("2011.3.174"):
binprefix = "bin"
elif LooseVersion(self.version) >= LooseVersion("2013_sp1"):
binprefix = "bin"
libprefix = "lib/intel64/lib"
binprefix = 'bin/intel64'
libprefix = 'lib/intel64'
if LooseVersion(self.version) >= LooseVersion('2011'):
if LooseVersion(self.version) <= LooseVersion('2011.3.174'):
binprefix = 'bin'
elif LooseVersion(self.version) >= LooseVersion('2013_sp1'):
binprefix = 'bin'
else:
libprefix = "compiler/lib/intel64/lib"
libprefix = 'compiler/lib/intel64'

binfiles = ["icc", "icpc"]
if LooseVersion(self.version) < LooseVersion("2014"):
binfiles += ["idb"]
binfiles = ['icc', 'icpc']
if LooseVersion(self.version) < LooseVersion('2014'):
binfiles += ['idb']

binaries = [os.path.join(binprefix, f) for f in binfiles]
libraries = [os.path.join(libprefix, 'lib%s' % l) for l in ['iomp5.a', 'iomp5.so']]
sanity_check_files = binaries + libraries
if LooseVersion(self.version) > LooseVersion('2015'):
sanity_check_files.append('include/omp.h')

custom_paths = {
'files': ["%s/%s" % (binprefix, x) for x in binfiles] +
["%s%s" % (libprefix, x) for x in ["iomp5.a", "iomp5.so"]],
'files': sanity_check_files,
'dirs': [],
}

super(EB_icc, self).sanity_check_step(custom_paths=custom_paths)

def make_module_req_guess(self):
"""Customize paths to check and add in environment.
"""
Additional paths to consider for prepend-paths statements in module file
"""
prefix = None

# guesses per environment variables
# some of these paths only apply to certain versions, but that doesn't really matter
# existence of paths is checked by module generator before 'prepend-paths' statements are included
guesses = {
'CLASSPATH': ['daal/lib/daal.jar'],
# 'include' is deliberately omitted, including it causes problems, e.g. with complex.h and std::complex
# cfr. https://software.intel.com/en-us/forums/intel-c-compiler/topic/338378
'CPATH': ['daal/include', 'ipp/include', 'mkl/include', 'tbb/include'],
'DAALROOT': ['daal'],
'IDB_HOME': ['bin/intel64'],
'IPPROOT': ['ipp'],
'LD_LIBRARY_PATH': ['lib'],
'LIBRARY_PATH': ['lib'],
'MANPATH': ['debugger/gdb/intel64/share/man', 'man', 'man/common', 'man/en_US', 'share/man'],
'PATH': ['bin'],
'TBBROOT': ['tbb'],
}

if self.cfg['m32']:
# 32-bit toolchain
dirmap = {
'PATH': ['bin', 'bin/ia32', 'tbb/bin/ia32'],
'LD_LIBRARY_PATH': ['lib', 'lib/ia32'],
'LIBRARY_PATH': ['lib', 'lib/ia32'],
'MANPATH': ['man', 'share/man', 'man/en_US'],
'IDB_HOME': ['bin/intel64']
}
guesses['PATH'].extend(['bin/ia32', 'tbb/bin/ia32'])
# in the end we set 'LIBRARY_PATH' equal to 'LD_LIBRARY_PATH'
guesses['LD_LIBRARY_PATH'].append('lib/ia32')

else:
# 64-bit toolit
dirmap = {
'PATH': ['bin', 'bin/intel64', 'tbb/bin/emt64'],
'LD_LIBRARY_PATH': ['lib', 'lib/intel64'],
'LIBRARY_PATH': ['lib', 'lib/intel64'],
'MANPATH': ['man', 'share/man', 'man/en_US'],
'IDB_HOME': ['bin/intel64']
}
# 64-bit toolkit
guesses['PATH'].extend([
'bin/intel64',
'debugger/gdb/intel64/bin',
'ipp/bin/intel64',
'mpi/intel64/bin',
'tbb/bin/emt64',
'tbb/bin/intel64',
])

# in the end we set 'LIBRARY_PATH' equal to 'LD_LIBRARY_PATH'
guesses['LD_LIBRARY_PATH'].extend([
'compiler/lib/intel64',
'debugger/ipt/intel64/lib',
'ipp/lib/intel64',
'mkl/lib/intel64',
'mpi/intel64',
'tbb/lib/intel64/%s' % get_tbb_gccprefix(),
])

if LooseVersion(self.version) < LooseVersion('2016'):
prefix = 'composer-xe-%s' % self.version

# debugger is dependent on $INTEL_PYTHONHOME since version 2015 and newer
if LooseVersion(self.version) >= LooseVersion('2015'):
self.debuggerpath = os.path.join('composer-xe-%s' % self.version.split('.')[0], 'debugger')

else:
# new directory layout for Intel Parallel Studio XE 2016
# https://software.intel.com/en-us/articles/new-directory-layout-for-intel-parallel-studio-xe-2016
prefix = 'compilers_and_libraries_%s/linux' % self.version
# Debugger requires INTEL_PYTHONHOME, which only allows for a single value
self.debuggerpath = 'debugger_%s' % self.version.split('.')[0]

guesses['LD_LIBRARY_PATH'].extend([
os.path.join(self.debuggerpath, 'libipt/intel64/lib'),
'daal/lib/intel64_lin',
])

# 'lib/intel64' is deliberately listed last, so it gets precedence over subdirs
guesses['LD_LIBRARY_PATH'].append('lib/intel64')

guesses['LIBRARY_PATH'] = guesses['LD_LIBRARY_PATH']

# set debugger path
if self.debuggerpath:
guesses['PATH'].append(os.path.join(self.debuggerpath, 'gdb', 'intel64', 'bin'))

# in recent Intel compiler distributions, the actual binaries are
# in deeper directories, and symlinked in top-level directories
# however, not all binaries are symlinked (e.g. mcpcom is not)
if os.path.isdir("%s/composerxe-%s" % (self.installdir, self.version)):
prefix = "composerxe-%s" % self.version
oldmap = dirmap
dirmap = {}
for k, vs in oldmap.items():
dirmap[k] = []
if k == "LD_LIBRARY_PATH":
prefix = "composerxe-%s/compiler" % self.version
else:
prefix = "composerxe-%s" % self.version
for v in vs:
v2 = "%s/%s" % (prefix, v)
dirmap[k].append(v2)

elif os.path.isdir("%s/compiler" % (self.installdir)):
prefix = "compiler"
oldmap = dirmap
dirmap = {}
for k, vs in oldmap.items():
dirmap[k] = []
prefix = ''
if k == "LD_LIBRARY_PATH":
prefix = "compiler/"
for v in vs:
v2 = "%s%s" % (prefix, v)
dirmap[k].append(v2)

return dirmap
if prefix and os.path.isdir(os.path.join(self.installdir, prefix)):
for key, subdirs in guesses.items():
guesses[key].extend([os.path.join(prefix, subdir) for subdir in subdirs])

return guesses

def make_module_extra(self):
"""Additional custom variables for icc: $INTEL_PYTHONHOME."""
txt = super(EB_icc, self).make_module_extra()

if self.debuggerpath:
intel_pythonhome = os.path.join(self.installdir, self.debuggerpath, 'python', 'intel64')
if os.path.isdir(intel_pythonhome):
txt += self.module_generator.set_environment('INTEL_PYTHONHOME', intel_pythonhome)

return txt
27 changes: 14 additions & 13 deletions easybuild/easyblocks/i/ifort.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
@author: Kenneth Hoste (Ghent University)
@author: Pieter De Baets (Ghent University)
@author: Jens Timmerman (Ghent University)
@author: Ward Poelmans (Ghent University)
"""

import os
from distutils.version import LooseVersion

from easybuild.easyblocks.generic.intelbase import IntelBase
Expand All @@ -48,25 +50,24 @@ class EB_ifort(EB_icc, IntelBase):
def sanity_check_step(self):
"""Custom sanity check paths for ifort."""

binprefix = "bin/intel64"
libprefix = "lib/intel64/lib"
if LooseVersion(self.version) >= LooseVersion("2011"):
if LooseVersion(self.version) <= LooseVersion("2011.3.174"):
binprefix = "bin"
elif LooseVersion(self.version) >= LooseVersion("2013_sp1"):
binprefix = "bin"
libprefix = "lib/intel64/lib"
binprefix = 'bin/intel64'
libprefix = 'lib/intel64'
if LooseVersion(self.version) >= LooseVersion('2011'):
if LooseVersion(self.version) <= LooseVersion('2011.3.174'):
binprefix = 'bin'
elif LooseVersion(self.version) >= LooseVersion('2013_sp1'):
binprefix = 'bin'
else:
libprefix = "compiler/lib/intel64/lib"
libprefix = 'compiler/lib/intel64'

bins = ["ifort"]
bins = ['ifort']
if LooseVersion(self.version) < LooseVersion('2013'):
# idb is not shipped with ifort anymore in 2013.x versions (it is with icc though)
bins.append("idb")
bins.append('idb')

custom_paths = {
'files': ["%s/%s" % (binprefix, x) for x in bins] +
["%s%s" % (libprefix, x) for x in ["ifcore.a", "ifcore.so", "iomp5.a", "iomp5.so"]],
'files': [os.path.join(binprefix, x) for x in bins] +
[os.path.join(libprefix, 'lib%s' % x) for x in ['ifcore.a', 'ifcore.so', 'iomp5.a', 'iomp5.so']],
'dirs': [],
}

Expand Down
Loading