[DB-SIG] pep 249

Jeff Rush jeff at taupro.com
Wed Nov 7 07:41:29 CET 2007


John Lhotak wrote:
> 
> Then ran the install:
> python setup.py install
> 
> And got this output:
> running install
> running build
> running build_py
> running build_ext
> running install_lib
> copying build/lib.linux-i686-2.4/_informixdb.so -> 
> /usr/lib/python2.4/site-packages
> copying build/lib.linux-i686-2.4/informixdb.py -> 
> /usr/lib/python2.4/site-packages
> byte-compiling /usr/lib/python2.4/site-packages/informixdb.py to 
> informixdb.pyc
> 
> So no errors and everything seems okay. When I get into python and try 
> to run:
> import informixdb
> I get this error:
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.4/site-packages/informixdb.py", line 146, in ?
>     from _informixdb import *
> ImportError: /usr/lib/python2.4/site-packages/_informixdb.so: undefined 
> symbol: sqli_describe_input_stmt

One of the "quirks" of the Linux linking system is that symbols can be left
undefined after a build, to be resolved at runtime, misleading you to think
the build was successful.  Late binding is great, except when it is not. ;-)

The first step in debugging these kinds of things is to check that you have
the set of shared libraries that were linked referentially into the
_informixdb.so module.  Issue the following command at a prompt:

  # ldd /usr/lib/python2.4/site-packages/_informixdb.so

and you will get a list of libraries it needs, along with their path or the
text "not found".  Insure all are actually being found, and install from the
Informix database software those that are missing.

Next is to search for the symbol it wants within the various link libraries,
by doing:

  # grep -i -r sqli_describe_input_stmt /usr/lib/*

Make note of which library contains it, remove the leading "lib" and trailing
".so" and add what's left to the informix build process.  So library
libwwwnews.a becomes an option to the gcc compiler/linker of "-lwwwnews".

You'll also notice that the "-lwwwnews" option lacks a path.  If the needed
library is not in a standard place, add a "-L<directory>" to have it search in
there.

I hope this helps,

-Jeff


More information about the DB-SIG mailing list