From dd3f00a5db62e44729b6193ee52edf556698a56f Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sun, 24 Nov 2024 11:05:19 +0100 Subject: [PATCH 1/2] add CUPTI and nvvm lib dirs to LIBRARY_PATH --- easybuild/easyblocks/c/cuda.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/c/cuda.py b/easybuild/easyblocks/c/cuda.py index 10d6bc3083..022f6ef95d 100644 --- a/easybuild/easyblocks/c/cuda.py +++ b/easybuild/easyblocks/c/cuda.py @@ -43,7 +43,7 @@ from easybuild.easyblocks.generic.binary import Binary from easybuild.framework.easyconfig import CUSTOM from easybuild.tools.build_log import EasyBuildError -from easybuild.tools.config import IGNORE +from easybuild.tools.config import build_option, IGNORE from easybuild.tools.filetools import adjust_permissions, change_dir, copy_dir, expand_glob_paths from easybuild.tools.filetools import patch_perl_script_autoflush, remove_file, symlink, which, write_file from easybuild.tools.run import run_cmd, run_cmd_qa @@ -356,10 +356,18 @@ def make_module_req_guess(self): lib_path.append(os.path.join('nvvm', 'lib64')) inc_path.append(os.path.join('nvvm', 'include')) + library_path = ['lib64', os.path.join('stubs', 'lib64')] + # add lib_path entries to library_path when LD_LIBRARY_PATH is filtered + # and LIBRARY_PATH is not filtered. + # E.g. in an environment such as EESSI. + filtered_env_vars = build_option('filter_env_vars') or [] + if 'LD_LIBRARY_PATH' in filtered_env_vars and 'LIBRARY_PATH' not in filtered_env_vars: + library_path += lib_path + guesses.update({ 'CPATH': inc_path, 'LD_LIBRARY_PATH': lib_path, - 'LIBRARY_PATH': ['lib64', os.path.join('stubs', 'lib64')], + 'LIBRARY_PATH': library_path, 'PATH': bin_path, 'PKG_CONFIG_PATH': ['pkgconfig'], }) From 5077104baf2e0c80d035ba65e5bca3e4d7ce30d1 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Mon, 25 Nov 2024 14:54:54 +0100 Subject: [PATCH 2/2] simplify change --- easybuild/easyblocks/c/cuda.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/easybuild/easyblocks/c/cuda.py b/easybuild/easyblocks/c/cuda.py index 022f6ef95d..a56275f957 100644 --- a/easybuild/easyblocks/c/cuda.py +++ b/easybuild/easyblocks/c/cuda.py @@ -43,7 +43,7 @@ from easybuild.easyblocks.generic.binary import Binary from easybuild.framework.easyconfig import CUSTOM from easybuild.tools.build_log import EasyBuildError -from easybuild.tools.config import build_option, IGNORE +from easybuild.tools.config import IGNORE from easybuild.tools.filetools import adjust_permissions, change_dir, copy_dir, expand_glob_paths from easybuild.tools.filetools import patch_perl_script_autoflush, remove_file, symlink, which, write_file from easybuild.tools.run import run_cmd, run_cmd_qa @@ -356,18 +356,10 @@ def make_module_req_guess(self): lib_path.append(os.path.join('nvvm', 'lib64')) inc_path.append(os.path.join('nvvm', 'include')) - library_path = ['lib64', os.path.join('stubs', 'lib64')] - # add lib_path entries to library_path when LD_LIBRARY_PATH is filtered - # and LIBRARY_PATH is not filtered. - # E.g. in an environment such as EESSI. - filtered_env_vars = build_option('filter_env_vars') or [] - if 'LD_LIBRARY_PATH' in filtered_env_vars and 'LIBRARY_PATH' not in filtered_env_vars: - library_path += lib_path - guesses.update({ 'CPATH': inc_path, 'LD_LIBRARY_PATH': lib_path, - 'LIBRARY_PATH': library_path, + 'LIBRARY_PATH': lib_path + [os.path.join('stubs', 'lib64')], 'PATH': bin_path, 'PKG_CONFIG_PATH': ['pkgconfig'], })