diff --git a/easybuild/easyblocks/i/imkl.py b/easybuild/easyblocks/i/imkl.py index 87f7bcb92d..3a0bbdf6e1 100644 --- a/easybuild/easyblocks/i/imkl.py +++ b/easybuild/easyblocks/i/imkl.py @@ -434,44 +434,45 @@ 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.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"""