Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop unnecessary CUDA stub libraries from $LIBRARY_PATH #2793

Merged
merged 5 commits into from
Jul 7, 2023
Merged
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions easybuild/easyblocks/c/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ 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')

# 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 @@ -247,6 +248,16 @@ def create_wrapper(wrapper_name, wrapper_comp):
# Also create the lib dir as a symlink
symlink('lib64', os.path.join(new_stubs_dir, 'lib'), use_abspath_source=False)

# Remove stubs which are not required as the full library is in /lib64 because this duplication
Flamefire marked this conversation as resolved.
Show resolved Hide resolved
# 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(new_stubs_dir, 'lib64', '*.*')]):
real_lib = os.path.join(self.installdir, 'lib64', os.path.basename(stub_lib))
if os.path.exists(real_lib):
self.log.debug("Removing stub library %s", stub_lib)
Flamefire marked this conversation as resolved.
Show resolved Hide resolved
remove_file(stub_lib)
else:
self.log.debug("Keeping stub library %s", stub_lib)

# Packages like xpra look for version independent pc files.
# See e.g. https://github.com/Xpra-org/xpra/blob/master/setup.py#L206
# Distros provide these files, so let's do it here too
Expand Down