Re: ctypes can't find files in /usr/local/lib?
Larry Bugbee <[email protected]>
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <[email protected]> |
>> A few general comments about ctypes >> ----------------------------------- >> ctypes will look in various locations for shared libraries >> but where can vary by platform. Libraries in /usr/lib are >> pretty much guaranteed to be found, but that may not be the >> best place for your compiled libraries. Personally I prefer >> /usr/local/lib. Regardless of where, you may need to set >> and export a load library path appropriate to your platform. >> LD_LIBRARY_PATH Linux >> DYLD_LIBRARY_PATH Darwin >> SHLIB_PATH HP-UX >> LD_LIBRARY_PATH_32 32-bit Solaris >> LD_LIBRARY_PATH_64 64-bit Solaris >> >> I hope this helps... Larry > > Yeah, that helps in coming up with a work-around, but doesn't really > answer the question. Disclaimer: I know frighteningly little about > library loading in the *nix world. I was under he impression that any > library loader was supposed to reference the ldconfig cache when it was > trying to load libraries, thus anything the ldconfig cache knew about > was guaranteed to be loaded. Joshua, Not knowing much about ldconfig, I went looking and found this. See especially the warning in section 3.3.1 http://www.linux.org/docs/ldp/howto/Program-Library-HOWTO/shared-libraries.html (Fortunately most of what I do are prototypes. ;-) > Can you explain (or point to a document > explaining) why this isn't so? No, I cannot. A quick read says I have more to learn. As to why CDLL() doesn't seem to use ldconfig, I'm guessing that while the facility may exist, CDLL() needs to do something to invoke the facility? ...and doesn't? ??? Good question. Dunno. FWIW, I do 90% of my work on Darwin (OSX), and ldconfig does not get installed with Xcode and gcc. ...which raises the question, is Darwin unique not having ldconfig or does this extend to all BSDs? Again, dunno. Perhaps [DY]LD_LIBRARY_PATH does make sense for interop reasons. ...and since my use cases are simple, for now I think I will stick with LD_LIBRARY_PATH. As I learn more I may switch. Larry ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ ctypes-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ctypes-users
smime.p7s
(application/pkcs7-signature, 1.2 KB) - not displayed