-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Spack sets RUNPATH instead of RPATH on latest Ubuntu LTS #9160
Comments
I think to fix this we need to both strip @alalazo: do you want to give this a shot? |
@tgamblin Ok, I'll look into that. |
This comment has been minimized.
This comment has been minimized.
It might have trickled down from Debian: Some people there also think it's a bug: |
My understanding is that RPATH is now deprecated, in favour of RUNPATH. I think this is a good thing, because RPATH is set like concrete and can never be over-ridden, whereas RUNPATH happens after LD_LIBRARY_PATH, thus allowing at least the possibility of over-riding it when a different .so version is required, without having to re-link everything which uses it. Which is kind of the point of dynamic linking. I would be a bit dismayed if Spack started somehow enforcing RPATH. |
We should make this configurable so users can use one or the other, but we shouldn’t ever allow both. They don’t mix well. Fermilab users like @gartung want Spack to use RUNPATH (they want to be able to load modules to override), but LLNL and other HPC sites are very strongly on the RPATH side. I realize that the ld.so manual says that RPATH is “deprecated”, but that’s been there for over 10 years and the functionality isn’t going away. We remind the glibc maintainers of this via our contacts at red hat. The trouble with RUNPATH and the reason we won’t use it is that it’s search semantics are fundamentally broken. It isn’t just a difference in precedence. Whereas an RPATH’d binary will search its RPATH, it’s loading object’s RPATH, all the way up to the executable if need be, RUNPATH gives up after searching the RUNPATH of the object itself. This means that the executable can’t enforce consistent link semantics, and that if libraries are broken or list incomplete paths, you can’t fix that with your executable’s RUNPATH like you can with RPATH. You HAVE to use LD_LIBRARY_PATH, which puts the burden on the user. For libraries like OpenMPI, which come with only partial RPATHs and expect the mpirun script to “finish” the link with LD_LIBRARY_PATH, this means we can’t build an executable that will work properly without help from the user (or the launch script). We use multiple MPIs at LLNL, and we don’t want the users to have to remember which one they built with in order to run with srun under SLURM. So we force RPATH at LLNL. Worse, RPATHs are ignored if there are ANY RUNPATHs in binaries within a DAG. We actually have an ld wrapper that eats the new dtags flag, because of insanity like this. There are more reasons why RUNPATH is broken here. In that case it breaks plugin loading in Qt. Finally, it may seem nice that LD_LIBRARY_PATH can “override” your RUNPATH, because you can experiment, and that is great for testing, but LD_LIBRARY_PATH is it’s own kind of evil in practice. It’s a global setting for your environment, so all the executables in an environment will use it. This means that if you have spack things built from a while ago with old versions of libraries, and if you have newer versions in LD_LIBRARY_PATH, running the old things will break. You can no longer have a workflow where two applications have different versions of common dependencies. Users frequently botch this somehow — when a long-forgotten LD_LIBRARY_PATH breaks some new program, and we end up getting support calls about the unexpected behavior. We like RPATH because we trust the builder of the application, much more than the user, to know the dependencies. At any rate, though, some sites do like RUNPATH, and if we’re doing this it should be settable. @alalazo: do you mind adding a config option to pick which we use? That should suffice initially but for reasons mentioned above we should probably eventually wnforce the no mixing rule by preventing users from linking RUNPATH’d libraries into RPATH DAGs. |
Ah - I think I stand corrected - all good points. I was aware of the alternative views on LD_LIBRARY_PATH, but had not known of the deeper differences between RPATH and RUNPATH. I probably need to be more knowledgable. Thank you for the more comprehensive explanation. As it happens, on my SLES-12 system, Spack ends up setting RUNPATH only. |
I tried to check the RPATH of a few applications installed with Spack on my Ubuntu 18.04 and found out that Spack was setting RUNPATH instead of RPATH.
Steps to reproduce the issue
I was able to reproduce the issue using a docker image, and it seems related to the Ubuntu version:
Error Message
At this point, trying to check the dynamic section of the ELF executable:
Additional information
Repeating the same procedure on the previous LTS (Ubuntu 16.04) gives instead the expected result:
so this seems to be related in some way to the version of the OS.
Information on your system
The bug can be reproduced on the latest Ubuntu LTS docker image (
ubuntu:18.04
), while it's not there in the previous LTS (ubuntu:16.04
).The text was updated successfully, but these errors were encountered: