From c41cb57ba0c6073098b32391dcf099fb34c82f04 Mon Sep 17 00:00:00 2001 From: Alex Domingo Date: Mon, 13 Jan 2025 23:46:40 +0100 Subject: [PATCH] replace make_module_req_guess with module_load_environment in intel-compilers easyblock --- easybuild/easyblocks/i/intel_compilers.py | 59 +++++++++++------------ 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/easybuild/easyblocks/i/intel_compilers.py b/easybuild/easyblocks/i/intel_compilers.py index 5b9c2dc3a69..9ceed59db97 100644 --- a/easybuild/easyblocks/i/intel_compilers.py +++ b/easybuild/easyblocks/i/intel_compilers.py @@ -134,41 +134,36 @@ def sanity_check_step(self): super(EB_intel_minus_compilers, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands) - def make_module_req_guess(self): + def make_module_step(self, *args, **kwargs): """ - Paths to consider for prepend-paths statements in module file + Set paths for module load environment based on the actual installation files """ - libdirs = [ - 'lib', - os.path.join('lib', 'x64'), - os.path.join('compiler', 'lib', 'intel64_lin'), + tbb_lib_prefix = os.path.join(self.tbb_subdir, 'lib', 'intel64') + tbb_lib_gccdir = get_tbb_gccprefix(os.path.join(self.installdir, tbb_lib_prefix)) + + self.module_load_environment.PATH = [os.path.join(self.compilers_subdir, path) for path in ( + 'bin', + os.path.join('bin', 'intel64'), + )] + self.module_load_environment.LD_LIBRARY_PATH = [ + os.path.join(self.compilers_subdir, 'lib'), + os.path.join(self.compilers_subdir, 'lib', 'x64'), + os.path.join(self.compilers_subdir, 'compiler', 'lib', 'intel64_lin'), + os.path.join(tbb_lib_prefix, tbb_lib_gccdir), ] - libdirs = [os.path.join(self.compilers_subdir, x) for x in libdirs] - tbb_subdir = self.tbb_subdir - tbb_libsubdir = os.path.join(tbb_subdir, 'lib', 'intel64') - libdirs.append(os.path.join(tbb_libsubdir, - get_tbb_gccprefix(os.path.join(self.installdir, tbb_libsubdir)))) - guesses = { - 'PATH': [ - os.path.join(self.compilers_subdir, 'bin'), - os.path.join(self.compilers_subdir, 'bin', 'intel64'), - ], - 'LD_LIBRARY_PATH': libdirs, - 'LIBRARY_PATH': libdirs, - 'MANPATH': [ - os.path.join(os.path.dirname(self.compilers_subdir), 'documentation', 'en', 'man', 'common'), - os.path.join(self.compilers_subdir, 'share', 'man'), - ], - 'OCL_ICD_FILENAMES': [ - os.path.join(self.compilers_subdir, 'lib', 'x64', 'libintelocl.so'), - os.path.join(self.compilers_subdir, 'lib', 'libintelocl.so'), - ], - 'CPATH': [ - os.path.join(tbb_subdir, 'include'), - ], - 'TBBROOT': [tbb_subdir], - } - return guesses + self.module_load_environment.LIBRARY_PATH = self.module_load_environment.LD_LIBRARY_PATH + self.module_load_environment.CPATH = [os.path.join(self.tbb_subdir, 'include')] + self.module_load_environment.MANPATH = [ + os.path.join(os.path.dirname(self.compilers_subdir), 'documentation', 'en', 'man', 'common'), + os.path.join(self.compilers_subdir, 'share', 'man'), + ] + self.module_load_environment.OCL_ICD_FILENAMES = [os.path.join(self.compilers_subdir, path) for path in ( + os.path.join('lib', 'x64', 'libintelocl.so'), + os.path.join('lib', 'libintelocl.so'), + )] + self.module_load_environment.TBBROOT = [self.tbb_subdir] + + return super().make_module_step(*args, **kwargs) def make_module_extra(self): """Additional custom variables for intel-compiler"""