[Distutils] reservations about pythonv
sienkiew at stsci.edu
Wed Mar 30 23:41:45 CEST 2011
> You have rpath to record search paths for shared libraries at link time.
> This enables you not to set LD_LIBRARY_PATH at runtime.
> Something like "cc -Wl,-rpath,/path/to/libdir -L/path/to/libdir -lfoo" is what
> you want.
You left out the hard part: How do I make distutils do that?
> Le 18/03/2011 18:46, Mark Sienkiewicz a écrit :
>>> The above just means my memory is too faulty to of much use ;). I'll just
>>> echo Carl's request for specific cases where $LD_LIBRARY_PATH needs to be set.
>> Here is a case that might resemble what you are talking about:
>> Compile a C extension that requires a shared library that is not in the standard
>> system path. To import it, LD_LIBRARY_PATH needs to be right.
>> This is not really different from what happens in a compiled language, except in
>> one way: In C, I can compile it -static or I can give the full path to the .so
>> file. Either results in a thing that works without LD_LIBRARY_PATH.
>> With distutils, you can't. It goes to great lengths to ensure that you can only
>> compile a C extension with "cc ... -L/some/directory -lname" -- I can't find any
>> way to make it do "cc ... /some/directory/libname.so"
>> So, the real problem here is that distutils uses "cc -L", but it demonstrates a
>> case where LD_LIBRARY_PATH can be important to a python program even when Python
>> itself can run without it.
>> Distutils-SIG maillist - Distutils-SIG at python.org
More information about the Distutils-SIG