Skip to content

Commit

Permalink
Merge pull request #3555 from lexming/modload-imkl
Browse files Browse the repository at this point in the history
adopt `module_load_environment`: imkl
  • Loading branch information
boegel authored Feb 10, 2025
2 parents 05af8e0 + 1658127 commit 6073ac5
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions easybuild/easyblocks/i/imkl.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,44 +434,46 @@ def sanity_check_step(self):

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

def make_module_req_guess(self):
def make_module_step(self, *args, **kwargs):
"""
A dictionary of possible directories to look for
Set paths for module load environment based on the actual installation files
"""
guesses = super(EB_imkl, self).make_module_req_guess()

if LooseVersion(self.version) >= LooseVersion('2021'):
compiler_subdir = os.path.join(self.get_versioned_subdir('compiler'), self.compiler_libdir)
pkg_config_path = [os.path.join(self.mkl_basedir, 'tools', 'pkgconfig'),
os.path.join(self.mkl_basedir, 'lib', 'pkgconfig')]
pkg_config_path = [
os.path.join(self.mkl_basedir, 'tools', 'pkgconfig'),
os.path.join(self.mkl_basedir, 'lib', 'pkgconfig'),
]
else:
compiler_subdir = os.path.join('lib', 'intel64')
pkg_config_path = [os.path.join(self.mkl_basedir, 'bin', 'pkgconfig')]
guesses['MANPATH'] = ['man', os.path.join('man', 'en_US')]
guesses['MIC_LD_LIBRARY_PATH'] = [
os.path.join('lib', 'intel64_lin_mic'),
os.path.join(self.mkl_basedir, 'lib', 'mic'),
]
library_path = [

self.module_load_environment.PATH = []
self.module_load_environment.LD_LIBRARY_PATH = [
compiler_subdir,
os.path.join(self.mkl_basedir, 'lib', 'intel64'),
]
cpath = [
self.module_load_environment.LIBRARY_PATH = self.module_load_environment.LD_LIBRARY_PATH
self.module_load_environment.CPATH = [
os.path.join(self.mkl_basedir, 'include'),
os.path.join(self.mkl_basedir, 'include', 'fftw'),
]
cmake_prefix_path = [self.mkl_basedir]
guesses.update({
'PATH': [],
'LD_LIBRARY_PATH': library_path,
'LIBRARY_PATH': library_path,
'CPATH': cpath,
'CMAKE_PREFIX_PATH': cmake_prefix_path,
'PKG_CONFIG_PATH': pkg_config_path,
})
self.module_load_environment.CMAKE_PREFIX_PATH = [self.mkl_basedir]
self.module_load_environment.PKG_CONFIG_PATH = pkg_config_path

if LooseVersion(self.version) < LooseVersion('2021'):
self.module_load_environment.MANPATH = ['man', os.path.join('man', 'en_US')]
self.module_load_environment.MIC_LD_LIBRARY_PATH = [
os.path.join('lib', 'intel64_lin_mic'),
os.path.join(self.mkl_basedir, 'lib', 'mic'),
]

if self.cfg['flexiblas']:
guesses['FLEXIBLAS_LIBRARY_PATH'] = os.path.join(library_path[1], 'flexiblas')
return guesses
self.module_load_environment.FLEXIBLAS_LIBRARY_PATH = os.path.join(
self.mkl_basedir, 'lib', 'intel64', 'flexiblas'
)

return super().make_module_step(*args, **kwargs)

def make_module_extra(self):
"""Overwritten from Application to add extra txt"""
Expand Down

0 comments on commit 6073ac5

Please sign in to comment.