[Xapian-discuss] problem compiling static python bindings

Olly Betts olly at survex.com
Wed Feb 6 17:11:18 GMT 2008


On Tue, Feb 05, 2008 at 05:09:44PM -0800, Noah Hoffman wrote:
> ldd $HOME/public_html/local/lib/python2.5/site-packages/_xapian.so
>         libxapian.so.15 =>
> /rc21/d75/labmed1/public_html/local/lib/libxapian.so.15 (0x00cf4000)

That's good - libtool has set an rpath so libxapian.so.15 can be found.

> However, I believe that I need to compile the python bindings
> statically, because attempts to import xapian from the cgi script (I'm
> using MoinMoin - moin.cgi, for what it's worth) result in an error:

We don't support building xapian-bindings with a static xapian-core.
For more information see:

http://xapian.org/cgi-bin/bugzilla/show_bug.cgi?id=187

> I've tried to set LD_LIBRARY_PATH from within the script (using
> os.environ['LD_LIBRARY_PATH'] = some_val) to every possible absolute
> or relative path that I can think of, but I get the same error. But in
> any case, I don't think that the cgi script has access to the
> filesystem where libxapian.so.15 is located.

You shouldn't need to set LD_LIBRARY_PATH - the rpath should do the
trick, and has for me in the past on Linux.  It would be interesting
to work out why this doesn't seem to work.

But if you do set it, you may need to set it before invoking the python
script using a shell script wrapper.

For example:

    #!/bin/sh
    LD_LIBRARY_PATH=/rc21/d75/labmed1/public_html/local/lib
    export LD_LIBRARY_PATH
    exec python /path/to/script.py

Cheers,
    Olly



More information about the Xapian-discuss mailing list