[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to package a Python module with shared libraries ?



Le dimanche 25 avril 2010 à 19:37 +0100, Floris Bruynooghe a écrit :
> Hi
> 
> On Sun, Apr 25, 2010 at 02:10:12PM +0200, Sylvestre Ledru wrote:
> > * All Scilab libraries are stored in /usr/lib/scilab/
> > 
> > * cdll.LoadLibrary("/usr/lib/scilab/libscilab.so") will fails
> > since /usr/lib/scilab is not in the search path for libraries
> > 
> > * setting thhe LD_LIBRARY_PATH into Python does not fix things since it
> > seems it is only used on startup
> > os.environ["LD_LIBRARY_PATH"]="/usr/lib/scilab/" 
> 
> No, that won't work.  As you noted below you need this set in the
> environment which the dynamic linker will see, which is the one you
> give when you start python in this case.
> 
> > * I don't want load explicitly all Scilab libraries (there are a few)
> > 
> > * Calling python the following way make things work:
> > LD_LIBRARY_PATH=/usr/lib/scilab python 
> > but I want to avoid the user to have to do manipulations
> 
> You could try setting RUNPATH/RPATH into the extension module.  If
> it's using distutils you can use --rpath to setup.py build_ext, see
> the --help of the build_ext sub-command.
I forgot to say but I also tried with the rpath but library load of
Python does not seems to follow it.

Since I am also the packager of Scilab, I could also move the library
into /usr/lib but since Scilab has many libraries, I was hoping to store
them separately but if there is no other way, I could do that...

Thanks for your highlight anyway,
Sylvestre



Reply to: