Re[2]: [python-sybase] installation problem of the Sybase module

Harri Pasanen harri.pasanen at trema.com
Wed, 3 Apr 2002 09:50:10 +0200 (CEST)


On Wed, 03 Apr 2002 13:08:16 +1000 Andrew McNamara <andrewm@object-craft.com.au> wrote:

> >Forgot to mention an installation/build problem with the Sybase module.
>  
> >On Linux Mandrake 8.1 + some patches, Python 2.2,  the module linked
> with
> >libintl.so from Sybase.  But at runtime it picked up the library from
> >/usr/lib, which is of course not the Sybase lib, even if has the same
> name.
> >
> >My workaround for the above was to create a symlink libsybintl.so ->
> >libintl.so in the sybase lib directory, and tweak the setup.py to use
> >libsybintl.so.
> 
> Hmm. Maybe setting an LD_LIBRARY_PATH environment variable including
> the Sybase library directory would allow you to run your application
> without the symlink (man ld.so)?
> 
> The Solaris linker allows the application builder to set the directories
> that will be searched at run-time with the "-R" option.  Opinion is split
> over whether this is "a good thing", but it's handy in cases like this. I
> don't know of a linux equivilent (-R means something else to GNU ld).
> 

Yes, setting LD_LIBRARY_PATH will fix it, but problem is that one does not
always have control of its value, as it can be overridden by some other
application.  Btw.  the sympton of the problem is that it complains about
missing symbol comn_free.  I've seen that both on linux and Solaris.

As to "-R", that can be used, but better is to use -rpath. 

From GNU ld man page:

           For  compatibility with other ELF linkers, if the "-R"
           option is followed by a directory name, rather than  a
           file name, it is treated as the "-rpath" option.

Indeed it might be preferable to use -rpath in setup.py.  The problem with
that is when you are delivering binaries.  Then it may be that the target
machine has Sybase client libs in a different directory, like if they have
12.5 client libs and not 11.9.2, or have installed those into user
directory.

Another option would be to link statically.

-Harri