Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion easybuild/easyblocks/c/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,17 @@ def create_wrapper(wrapper_name, wrapper_comp):
raise EasyBuildError("Unable to find 'ldconfig' in $PATH (%s), nor in any of %s", path, sbin_dirs)

stubs_dir = os.path.join(self.installdir, 'lib64', 'stubs')

# Remove stubs which are not required as the full library is in $EBROOTCUDA/lib64 because this duplication
# causes issues (e.g. CMake warnings) when using this module (see $LIBRARY_PATH & $LD_LIBRARY_PATH)
for stub_lib in expand_glob_paths([os.path.join(stubs_dir, '*.*')]):
real_lib = os.path.join(self.installdir, 'lib64', os.path.basename(stub_lib))
if os.path.exists(real_lib):
self.log.debug("Removing unnecessary stub library %s", stub_lib)
remove_file(stub_lib)
else:
self.log.debug("Keeping stub library %s", stub_lib)

# Run ldconfig to create missing symlinks in the stubs directory (libcuda.so.1, etc)
cmd = ' '.join([ldconfig, '-N', stubs_dir])
run_cmd(cmd)
Expand All @@ -243,7 +254,7 @@ def create_wrapper(wrapper_name, wrapper_comp):
# See e.g. https://github.com/easybuilders/easybuild-easyconfigs/issues/12348
# Workaround: Create a copy that matches this pattern
new_stubs_dir = os.path.join(self.installdir, 'stubs')
copy_dir(stubs_dir, os.path.join(new_stubs_dir, 'lib64'))
copy_dir(stubs_dir, os.path.join(new_stubs_dir, 'lib64'), symlinks=True)
# Also create the lib dir as a symlink
symlink('lib64', os.path.join(new_stubs_dir, 'lib'), use_abspath_source=False)

Expand Down