You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
v5.0.5
Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
build from distribution tarball
Please describe the system on which you are running
Operating system/version: linux
Computer hardware: CI (Azure, x86)
Network type: N/A
Details of the problem
When investigating #12921 where libmpi is linked to libcudart despite being unused, we were curious about why libcudart was not being stripped since we have -Wl,--as-needed in $LDFLAGS.
Looking at the link command for libmpi, it looks like:
where it seems relevant that $LDFLAGS comes after the libraries being linked, which I think means -Wl,--as-needed does not get applied to libcudart or any of the libraries being linked into libmpi. It is possible that there is a fix as simple as moving $LDFLAGS earlier in the link command, but I am not sure if that would have any undesirable consequences.
The text was updated successfully, but these errors were encountered:
minrk
changed the title
$LDFLAGS not affecting all links of libmpi
$LDFLAGS not affecting libraries linked to libmpi
Nov 14, 2024
minrk
changed the title
$LDFLAGS not affecting libraries linked to libmpi
$LDFLAGS not affecting libraries linked by libmpi
Nov 14, 2024
Background information
What version of Open MPI are you using? (e.g., v4.1.6, v5.0.1, git branch name and hash, etc.)
v5.0.5
Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)
build from distribution tarball
Please describe the system on which you are running
Details of the problem
When investigating #12921 where libmpi is linked to libcudart despite being unused, we were curious about why libcudart was not being stripped since we have
-Wl,--as-needed
in $LDFLAGS.Looking at the link command for libmpi, it looks like:
where it seems relevant that $LDFLAGS comes after the libraries being linked, which I think means
-Wl,--as-needed
does not get applied to libcudart or any of the libraries being linked into libmpi. It is possible that there is a fix as simple as moving $LDFLAGS earlier in the link command, but I am not sure if that would have any undesirable consequences.The text was updated successfully, but these errors were encountered: