Skip to content

Commit 4adc5b3

Browse files
committed
Merge branch '5.0.x' into parallel_prop
2 parents 99a5851 + f1b6a85 commit 4adc5b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+865
-999
lines changed

easybuild/easyblocks/a/abaqus.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ def __init__(self, *args, **kwargs):
7171
self.log.info("Auto-enabling installation of fe-safe components for ABAQUS versions >= 2020")
7272
self.cfg['with_fe_safe'] = True
7373

74+
# add custom paths to $PATH
75+
path_subdirs = ['Commands']
76+
if self.cfg['with_tosca']:
77+
path_subdirs.append(os.path.join('cae', 'linux_a64', 'code', 'command'))
78+
self.module_load_environment.PATH.extend(path_subdirs)
79+
7480
def extract_step(self):
7581
"""Use default extraction procedure instead of the one for the Binary easyblock."""
7682
EasyBlock.extract_step(self)
@@ -353,20 +359,6 @@ def sanity_check_step(self):
353359

354360
super(EB_ABAQUS, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
355361

356-
def make_module_req_guess(self):
357-
"""Update $PATH guesses for ABAQUS."""
358-
guesses = super(EB_ABAQUS, self).make_module_req_guess()
359-
360-
path_subdirs = ['Commands']
361-
if self.cfg['with_tosca']:
362-
path_subdirs.append(os.path.join('cae', 'linux_a64', 'code', 'command'))
363-
364-
guesses.update({
365-
'PATH': path_subdirs,
366-
})
367-
368-
return guesses
369-
370362
def make_module_extra(self):
371363
"""Add LM_LICENSE_FILE path if specified"""
372364
txt = super(EB_ABAQUS, self).make_module_extra()

easybuild/easyblocks/a/advisor.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,14 @@ def __init__(self, *args, **kwargs):
5757
else:
5858
self.subdir = os.path.join('advisor', 'latest')
5959

60+
# prepare module load environment
61+
self.prepare_intel_tools_env()
62+
6063
def prepare_step(self, *args, **kwargs):
6164
"""Since 2019u3 there is no license required."""
6265
kwargs['requires_runtime_license'] = False
6366
super(EB_Advisor, self).prepare_step(*args, **kwargs)
6467

65-
def make_module_req_guess(self):
66-
"""Find reasonable paths for Advisor"""
67-
return self.get_guesses_tools()
68-
6968
def sanity_check_step(self):
7069
"""Custom sanity check paths for Advisor"""
7170
binaries = ['advixe-cl', 'advixe-feedback', 'advixe-gui', 'advixe-runss', 'advixe-runtrc', 'advixe-runtc']

easybuild/easyblocks/a/anaconda.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,28 @@
3434

3535
from easybuild.easyblocks.generic.binary import Binary
3636
from easybuild.tools.filetools import adjust_permissions, remove_dir
37+
from easybuild.tools.modules import MODULE_LOAD_ENV_HEADERS
3738
from easybuild.tools.run import run_shell_cmd
3839

3940

4041
class EB_Anaconda(Binary):
4142
"""Support for building/installing Anaconda and Miniconda."""
4243

44+
def __init__(self, *args, **kwargs):
45+
"""Initialize class variables."""
46+
super().__init__(*args, **kwargs)
47+
48+
# Do not add installation to search paths for headers or libraries to avoid
49+
# that the Anaconda environment is used by other software at building or linking time.
50+
# LD_LIBRARY_PATH issue discusses here:
51+
# http://superuser.com/questions/980250/environment-module-cannot-initialize-tcl
52+
mod_env_headers = self.module_load_environment.alias_vars(MODULE_LOAD_ENV_HEADERS)
53+
mod_env_libs = ['LD_LIBRARY_PATH', 'LIBRARY_PATH']
54+
mod_env_cmake = ['CMAKE_LIBRARY_PATH', 'CMAKE_PREFIX_PATH']
55+
for disallowed_var in mod_env_headers + mod_env_libs + mod_env_cmake:
56+
self.module_load_environment.remove(disallowed_var)
57+
self.log.debug(f"Purposely not updating ${disallowed_var} in {self.name} module file")
58+
4359
def install_step(self):
4460
"""Copy all files in build directory to the install directory"""
4561

@@ -53,16 +69,6 @@ def install_step(self):
5369
self.log.info("Installing %s using command '%s'..." % (self.name, cmd))
5470
run_shell_cmd(cmd)
5571

56-
def make_module_req_guess(self):
57-
"""
58-
A dictionary of possible directories to look for.
59-
"""
60-
return {
61-
'MANPATH': ['man', os.path.join('share', 'man')],
62-
'PATH': ['bin', 'sbin'],
63-
'PKG_CONFIG_PATH': [os.path.join(x, 'pkgconfig') for x in ['lib', 'lib32', 'lib64', 'share']],
64-
}
65-
6672
def sanity_check_step(self):
6773
"""
6874
Custom sanity check for Anaconda and Miniconda

easybuild/easyblocks/a/ansys.py

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,29 @@ def __init__(self, *args, **kwargs):
4747
super(EB_ANSYS, self).__init__(*args, **kwargs)
4848
self.ansysver = None
4949

50+
# custom extra module environment entries for ANSYS
51+
bin_dirs = [
52+
'tgrid/bin',
53+
'Framework/bin/Linux64',
54+
'aisol/bin/linx64',
55+
'RSM/bin',
56+
'ansys/bin',
57+
'autodyn/bin',
58+
'CFD-Post/bin',
59+
'CFX/bin',
60+
'fluent/bin',
61+
'TurboGrid/bin',
62+
'polyflow/bin',
63+
'Icepak/bin',
64+
'icemcfd/linux64_amd/bin'
65+
]
66+
if LooseVersion(self.version) >= LooseVersion('19.0'):
67+
bin_dirs.append('CEI/bin')
68+
# use glob pattern as we don't know exact version at this stage
69+
# it will be expanded before injection into the module file
70+
ansysver_glob = 'v[0-9]*'
71+
self.module_load_environment.PATH = [os.path.join(ansysver_glob, d) for d in bin_dirs]
72+
5073
def install_step(self):
5174
"""Custom install procedure for ANSYS."""
5275
# Sources (e.g. iso files) may drop the execute permissions
@@ -77,35 +100,6 @@ def set_ansysver(self):
77100
else:
78101
self.ansysver = 'v' + ''.join(self.version.split('.')[0:2])
79102

80-
def make_module_req_guess(self):
81-
"""Custom extra module file entries for ANSYS."""
82-
83-
if self.ansysver is None:
84-
self.set_ansysver()
85-
86-
guesses = super(EB_ANSYS, self).make_module_req_guess()
87-
dirs = [
88-
'tgrid/bin',
89-
'Framework/bin/Linux64',
90-
'aisol/bin/linx64',
91-
'RSM/bin',
92-
'ansys/bin',
93-
'autodyn/bin',
94-
'CFD-Post/bin',
95-
'CFX/bin',
96-
'fluent/bin',
97-
'TurboGrid/bin',
98-
'polyflow/bin',
99-
'Icepak/bin',
100-
'icemcfd/linux64_amd/bin'
101-
]
102-
if LooseVersion(self.version) >= LooseVersion('19.0'):
103-
dirs.append('CEI/bin')
104-
105-
guesses['PATH'] = [os.path.join(self.ansysver, d) for d in dirs]
106-
107-
return guesses
108-
109103
def make_module_extra(self):
110104
"""Define extra environment variables required by Ansys"""
111105

easybuild/easyblocks/a/aocc.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ def __init__(self, *args, **kwargs):
8383
super(EB_AOCC, self).__init__(*args, **kwargs)
8484

8585
self.clangversion = self.cfg['clangversion']
86+
# AOCC is based on Clang. Try to guess the clangversion from the AOCC version
87+
# if clangversion is not specified in the easyconfig
88+
if self.clangversion is None:
89+
self.clangversion = self._aocc_guess_clang_version()
90+
8691
self.gcc_prefix = None
8792

8893
# Bypass the .mod file check for GCCcore installs
@@ -207,11 +212,6 @@ def install_step(self):
207212
# or via 'accept_eula = True' in easyconfig file
208213
self.check_accepted_eula(more_info='http://developer.amd.com/wordpress/media/files/AOCC_EULA.pdf')
209214

210-
# AOCC is based on Clang. Try to guess the clangversion from the AOCC version
211-
# if clangversion is not specified in the easyconfig
212-
if self.clangversion is None:
213-
self.clangversion = self._aocc_guess_clang_version()
214-
215215
super(EB_AOCC, self).install_step()
216216

217217
def post_processing_step(self):
@@ -299,13 +299,3 @@ def make_module_extra(self):
299299
# setting the AOCChome path
300300
txt += self.module_generator.set_environment('AOCChome', self.installdir)
301301
return txt
302-
303-
def make_module_req_guess(self):
304-
"""
305-
A dictionary of possible directories to look for.
306-
Include C_INCLUDE_PATH and CPLUS_INCLUDE_PATH as an addition to default ones
307-
"""
308-
guesses = super(EB_AOCC, self).make_module_req_guess()
309-
guesses['C_INCLUDE_PATH'] = ['include']
310-
guesses['CPLUS_INCLUDE_PATH'] = ['include']
311-
return guesses

easybuild/easyblocks/c/clang.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
from easybuild.tools.build_log import EasyBuildError, print_warning
4848
from easybuild.tools.config import build_option
4949
from easybuild.tools.filetools import apply_regex_substitutions, change_dir, mkdir, symlink, which
50-
from easybuild.tools.modules import get_software_root
50+
from easybuild.tools.modules import MODULE_LOAD_ENV_HEADERS, get_software_root
5151
from easybuild.tools.run import run_shell_cmd
5252
from easybuild.tools.systemtools import AARCH32, AARCH64, POWER, RISCV64, X86_64
5353
from easybuild.tools.systemtools import get_cpu_architecture, get_os_name, get_os_version, get_shared_lib_ext
@@ -753,6 +753,21 @@ def sanity_check_step(self):
753753

754754
super(EB_Clang, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
755755

756+
def make_module_step(self, *args, **kwargs):
757+
"""
758+
Set paths for module load environment based on the actual installation files
759+
"""
760+
# Ensure that installation files are not added to search paths to headers and libs
761+
mod_env_headers = self.module_load_environment.alias_vars(MODULE_LOAD_ENV_HEADERS)
762+
mod_env_libs = ['LIBRARY_PATH']
763+
for disallowed_var in mod_env_headers + mod_env_libs:
764+
self.module_load_environment.remove(disallowed_var)
765+
self.log.debug(f"Purposely not updating ${disallowed_var} in {self.name} module file")
766+
# Clang can find its own headers and libraries but the .so's need to be in LD_LIBRARY_PATH
767+
self.module_load_environment.LD_LIBRARY_PATH = ['lib', 'lib64', self.runtime_lib_path]
768+
769+
return super().make_module_step(*args, **kwargs)
770+
756771
def make_module_extra(self):
757772
"""Custom variables for Clang module."""
758773
txt = super(EB_Clang, self).make_module_extra()
@@ -762,15 +777,3 @@ def make_module_extra(self):
762777
if self.cfg['python_bindings']:
763778
txt += self.module_generator.prepend_paths('PYTHONPATH', os.path.join("lib", "python"))
764779
return txt
765-
766-
def make_module_req_guess(self):
767-
"""
768-
Clang can find its own headers and libraries but the .so's need to be in LD_LIBRARY_PATH
769-
"""
770-
guesses = super(EB_Clang, self).make_module_req_guess()
771-
guesses.update({
772-
'CPATH': [],
773-
'LIBRARY_PATH': [],
774-
'LD_LIBRARY_PATH': ['lib', 'lib64', self.runtime_lib_path],
775-
})
776-
return guesses

easybuild/easyblocks/c/cuda.py

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,28 @@ def __init__(self, *args, **kwargs):
9292
self.cfg.template_values['cudaarch'] = cudaarch
9393
self.cfg.generate_template_values()
9494

95+
# Specify CUDA custom values for module load environment
96+
# The dirs should be in the order ['open64/bin', 'bin']
97+
bin_path = []
98+
if LooseVersion(self.version) < LooseVersion('7'):
99+
bin_path.append(os.path.join('open64', 'bin'))
100+
bin_path.append('bin')
101+
102+
lib_path = ['lib64']
103+
inc_path = ['include']
104+
if LooseVersion(self.version) >= LooseVersion('7'):
105+
lib_path.append(os.path.join('extras', 'CUPTI', 'lib64'))
106+
inc_path.append(os.path.join('extras', 'CUPTI', 'include'))
107+
bin_path.append(os.path.join('nvvm', 'bin'))
108+
lib_path.append(os.path.join('nvvm', 'lib64'))
109+
inc_path.append(os.path.join('nvvm', 'include'))
110+
111+
self.module_load_environment.CPATH = inc_path
112+
self.module_load_environment.LD_LIBRARY_PATH = lib_path
113+
self.module_load_environment.LIBRARY_PATH = lib_path + [os.path.join('stubs', 'lib64')]
114+
self.module_load_environment.PATH = bin_path
115+
self.module_load_environment.PKG_CONFIG_PATH = ['pkgconfig']
116+
95117
def fetch_step(self, *args, **kwargs):
96118
"""Check for EULA acceptance prior to getting sources."""
97119
# EULA for CUDA must be accepted via --accept-eula-for EasyBuild configuration option,
@@ -334,33 +356,3 @@ def make_module_extra(self):
334356
txt += self.module_generator.set_environment('CUDA_PATH', self.installdir)
335357
self.log.debug("make_module_extra added this: %s", txt)
336358
return txt
337-
338-
def make_module_req_guess(self):
339-
"""Specify CUDA custom values for PATH etc."""
340-
341-
guesses = super(EB_CUDA, self).make_module_req_guess()
342-
343-
# The dirs should be in the order ['open64/bin', 'bin']
344-
bin_path = []
345-
if LooseVersion(self.version) < LooseVersion('7'):
346-
bin_path.append(os.path.join('open64', 'bin'))
347-
bin_path.append('bin')
348-
349-
lib_path = ['lib64']
350-
inc_path = ['include']
351-
if LooseVersion(self.version) >= LooseVersion('7'):
352-
lib_path.append(os.path.join('extras', 'CUPTI', 'lib64'))
353-
inc_path.append(os.path.join('extras', 'CUPTI', 'include'))
354-
bin_path.append(os.path.join('nvvm', 'bin'))
355-
lib_path.append(os.path.join('nvvm', 'lib64'))
356-
inc_path.append(os.path.join('nvvm', 'include'))
357-
358-
guesses.update({
359-
'CPATH': inc_path,
360-
'LD_LIBRARY_PATH': lib_path,
361-
'LIBRARY_PATH': lib_path + [os.path.join('stubs', 'lib64')],
362-
'PATH': bin_path,
363-
'PKG_CONFIG_PATH': ['pkgconfig'],
364-
})
365-
366-
return guesses

easybuild/easyblocks/c/cudacompat.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ def __init__(self, *args, **kwargs):
6565
"""Initialize custom class variables for CUDACompat."""
6666
super(EB_CUDAcompat, self).__init__(*args, **kwargs)
6767
self._has_nvidia_smi = None
68+
# avoid building software with this compat libraries
69+
self.module_load_environment.remove('LIBRARY_PATH')
6870

6971
@property
7072
def has_nvidia_smi(self):
@@ -214,17 +216,6 @@ def install_step(self):
214216
unversioned_symlink = versioned_symlink.rsplit('.', 1)[0]
215217
symlink(versioned_symlink, os.path.join(libdir, unversioned_symlink), use_abspath_source=False)
216218

217-
def make_module_req_guess(self):
218-
"""Don't try to guess anything."""
219-
return dict()
220-
221-
def make_module_extra(self):
222-
"""Skip the changes from the Binary EasyBlock and (only) set LD_LIBRARY_PATH."""
223-
224-
txt = super(Binary, self).make_module_extra()
225-
txt += self.module_generator.prepend_paths('LD_LIBRARY_PATH', 'lib')
226-
return txt
227-
228219
def sanity_check_step(self):
229220
"""Check for core files (unversioned libs, symlinks)"""
230221
libraries = [

easybuild/easyblocks/e/eigen.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,3 @@ def sanity_check_step(self):
9898
% os.path.join(self.installdir, cmake_config_dir))
9999

100100
super(EB_Eigen, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)
101-
102-
def make_module_req_guess(self):
103-
"""
104-
A dictionary of possible directories to look for.
105-
Include CPLUS_INCLUDE_PATH as an addition to default ones
106-
"""
107-
guesses = super(EB_Eigen, self).make_module_req_guess()
108-
guesses.update({'CPLUS_INCLUDE_PATH': ['include']})
109-
return guesses

0 commit comments

Comments
 (0)