Dr. David Kirkby wrote: > Georg S. Weber wrote: >> Hmm, >> >> I don't quite get the point of your message. > > Sorry, > > I was trying to get some discussion, and hopefully understanding, of why > these > issues arise, with a hope to trying to fix them. It's clear the present > situation has 'issues' and to my knowledge, nobody has a foolproof way of > building Sage without having to rely on 'hacks' on some operating systems. > >> "Installing the dynamic library somewhere else and link it in by ... >> adding said library to the users LD_LIBRARY_PATH ..." >> >> is pretty much exactly the way things are designed and supposed to >> work (and actually do work to a large extent) in Sage. I don't think >> LD_PRELOAD in its various incarnations is portable enough for the Sage >> purposes (I haven't checked though). > > LD_LIBRARY_PATH tells the program where to look for libraries it can't find. > I'm > not aware of how it is supposed to behave if there are system libraries and > libraries of the same name in LD_LIBRARY_PATH. Can we be sure that system > libraries will be used in preference to those in LD_LIBRARY_PATH, or can we > be > sure those in LD_LIBRARY_PATH will be used in preference to those in the > system? > It seems to me, if the library is on the system in somewhere like /usr/lib, > then it will be loaded from there, despite the fact LD_LIBRARY_PATH might > specify a location where another copy resides. > > For Solaris at least, LD_PRELOAD can be used to force something to be loaded > in > preference to what exists on the system. I've no idea how portable that is. > I'm > not suggesting it is the way forward. >
While not a guarantee, here's what I get from the manpage of ld.so on Ubuntu (x86_64): The necessary shared libraries needed by the program are searched for in the following order * Using the environment variable LD_LIBRARY_PATH (LD_AOUT_LIBRARY_PATH for a.out programs). Except if the exe‐ cutable is a setuid/setgid binary, in which case it is ignored. * From the cache file /etc/ld.so.cache which contains a compiled list of candidate libraries previously found in the augmented library path. * In the default path /lib, and then /usr/lib. So it looks like, for Linux, at least, setting LD_LIBRARY_PATH is sufficient. Also, there's this: LD_PRELOAD A whitespace-separated list of additional, user-specified, ELF shared libraries to be loaded before all others. This can be used to selectively override functions in other shared libraries. For setuid/setgid ELF binaries, only libraries in the standard search directories that are also setgid will be loaded. I don't know very much about these issues, but the above might help, at least for (Ubuntu) linux. Jason -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org