-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
activate script should manage LD_LIBRARY_PATH #308
Comments
After having seen many of the problems people have been having with regard to LD_LIBRARY_PATH, I'm wondering if it was a good idea to use RUNPATH (instead of RPATH). While RPATH has been deprecated for a long time, it is still provides a more robust way for the linker to resolve libraries, as it takes precedence over the setting of LD_LIBRARY_PATH. |
Is there any benefit to using both? According to http://blog.tremily.us/posts/rpath/, chrpath can't increase the length of RPATH on Linux. |
You cannot set both (RPATH and RUNPATH). |
commit 0209503 (in particular the equivalent in Anaconda (which means packages will all use RPATH (at some point))) will fix this problem |
Is there an equivalent functionality for OS X? I just created a package for Perl's ZMQ:FFI library, and that tries to dynamically load libzmq. Unfortunately it cannot find it, even though it's inside the same conda environment. If I set |
Unfortunately the situation is more complicated on OS X. The equivalent if |
Well, in this case the library is being loaded via This is actually the same issue that any Python module that uses |
After I made the previous comment I looked at the recipe for |
Well, it looks like I can't just patch the Perl zeromq library (ZMQ::FFI) because the underlying FFI library it's using doesn't appear to support specifying the full path to the library. It will only look for libraries based on a filename, which requires that Doesn't this same sort of problem crop up with anything that uses |
You can also check if @minrk does anything special with his zeromq recipe. |
Setting [DY]LD_LIBRARY_PATH seems like the right thing to do to me. I think PyZMQ itself doesn't need it because rpath is set in a way that doesn't rely on it. But that probably shouldn't be necessary. |
Okay, so that sounds like maybe this issue should be re-opened. What do you think @ilanschnell? |
Setting (DY)LD_LIBRARY_PATH almost never seems to be the right thing to do. The only case where one should set LD_LIBRARY_PATH is during experimental development, when it cannot be avoided otherwise. For deployment of code it should never be necessary. |
Except the one case where it is the right thing to do is when creating environments, e.g. conda or virtualenv. |
But the whole point of conda packages is that they should be relocatable, so that setting these variables should be completely unnecessary. I would rather look at how to fix/work around the libffi issues than to jump the gun with setting LD_LIBRARY_PATH in The discussion at conda/conda-build#50 is also relevant here. As soon as we start adding magic to |
It shouldn't affect conda packages themselves, but it would benefit things compiled into the env by other means. This seems like the whole point of envs, to me. Do you not want libraries in a conda env to be linkable by default while the env is active? |
I do agree that conda packages themselves should not rely on LD_LIBRARY_PATH being set, but that doesn't mean that activate shouldn't set it. |
@asmeurer That's a good point that I hadn't thought of before. After further examination, it does indeed look like Perl's |
@minrk the problem with activate setting LD_LIBRARY_PATH (even when conda packages themselves don't need it) is that it might break other things on the users system. |
Another valid scenario is when you have a software collection (e.g rh-nodejs4 on RHEL) which require setting the LD_LIBRARY_PATH for its programs to work. Now when I run condo to build a package that depends on this software collection, the LD_LIBRARY_PATH is being unset causing the build to fail. Specifically: Please correct me if I'm looking in the wrong direction. |
Hi there, thank you for your contribution to Conda! This issue has been automatically locked since it has not had recent activity after it was closed. Please open a new issue if needed. |
The activate script should check to see if LD_LIBRARY_PATH is set. If it is, then activate should pre-pend the correct /lib directory to LD_LIBRARY_PATH as well as updating PATH
The text was updated successfully, but these errors were encountered: