From John.Lhotak at noaa.gov Tue Nov 6 23:22:08 2007 From: John.Lhotak at noaa.gov (John Lhotak) Date: Tue, 06 Nov 2007 15:22:08 -0700 Subject: [DB-SIG] pep 249 Message-ID: <4730E910.1010800@noaa.gov> Hello, I have tried to install the Python Database API Specification v2.0 module on a linux system and I am having problem with the import command after what seems like a installation with out errors. Here's how I did the install: Ran the build_ext with the following command: python setup.py build_ext --esql-informixdir=/opt/informix And got the following output: running build_ext /opt/informix/bin/esql -EDHAVE_ESQL9 -EDHAVE_DESCRIBE_INPUT -e _informixdb.ec building '_informixdb' extension creating build creating build/temp.linux-i686-2.4 creating build/temp.linux-i686-2.4/ext gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fPIC -DPYTHON_INCLUDE=/usr/include/python2.4 -DHAVE_C_DATETIME=1 -DHAVE_PY_BOOL=1 -Iext -I/opt/informix/incl/esql -I/usr/include/python2.4 -c ext/_informixdb.c -o build/temp.linux-i686-2.4/ext/_informixdb.o creating build/lib.linux-i686-2.4 gcc -pthread -shared build/temp.linux-i686-2.4/ext/_informixdb.o /opt/informix/lib/esql/checkapi.o -L/opt/informix/lib/esql -L/opt/informix/lib -lifsql -lifasf -lifgen -lifos -lifgls -lc -lm -ldl -lcrypt -lifglx -o build/lib.linux-i686-2.4/_informixdb.so 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 "", 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 Any help or incite is appreciated, John From jeff at taupro.com Wed Nov 7 07:41:29 2007 From: jeff at taupro.com (Jeff Rush) Date: Wed, 07 Nov 2007 00:41:29 -0600 Subject: [DB-SIG] pep 249 In-Reply-To: <4730E910.1010800@noaa.gov> References: <4730E910.1010800@noaa.gov> Message-ID: <47315E19.1080802@taupro.com> 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 "", 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" to have it search in there. I hope this helps, -Jeff From carsten at uniqsys.com Wed Nov 7 14:30:27 2007 From: carsten at uniqsys.com (Carsten Haese) Date: Wed, 07 Nov 2007 08:30:27 -0500 Subject: [DB-SIG] pep 249 In-Reply-To: <4730E910.1010800@noaa.gov> References: <4730E910.1010800@noaa.gov> Message-ID: <1194442227.3452.2.camel@dot.uniqsys.com> On Tue, 2007-11-06 at 15:22 -0700, John Lhotak wrote: > [...] 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 "", 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 [Already sent this response in private email, but I just noticed that the question was also sent to the list] In order to troubleshoot this, I'll need to know a bit more about your system. What output do you get from the command "ldd /usr/lib/python2.4/site-packages/_informixdb.so"? What version does "esql -V" report? What was $INFORMIXDIR set to when you compiled the module? Is $INFORMIXDIR set to something different when you try to run the module, and if so, what is it set to? Thanks, -- Carsten Haese http://informixdb.sourceforge.net From John.Lhotak at noaa.gov Wed Nov 7 20:10:06 2007 From: John.Lhotak at noaa.gov (John Lhotak) Date: Wed, 07 Nov 2007 12:10:06 -0700 Subject: [DB-SIG] pep 249 In-Reply-To: <47315E19.1080802@taupro.com> References: <4730E910.1010800@noaa.gov> <47315E19.1080802@taupro.com> Message-ID: <47320D8E.4050501@noaa.gov> Carsten, Jeff, Thank you for the responses. Carsten here is the out put from the commands you listed. INFORMIXDIR is set to /opt/informix when I compiled the module and when I try to run the module "ldd /usr/lib/python2.4/site-packages/_informixdb.so" returns: linux-gate.so.1 => (0x004db000) libifsql.so => /usr/local/informix/lib/esql/libifsql.so (0x00376000) libifasf.so => /usr/local/informix/lib/libifasf.so (0x006c7000) libifgen.so => /usr/local/informix/lib/esql/libifgen.so (0x00632000) libifos.so => /usr/local/informix/lib/esql/libifos.so (0x007b7000) libifgls.so => /usr/local/informix/lib/esql/libifgls.so (0x0014d000) libc.so.6 => /lib/libc.so.6 (0x00187000) libm.so.6 => /lib/libm.so.6 (0x00bad000) libdl.so.2 => /lib/libdl.so.2 (0x00111000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x00967000) libifglx.so => /usr/local/informix/lib/esql/libifglx.so (0x00c36000) libpthread.so.0 => /lib/libpthread.so.0 (0x006a9000) /lib/ld-linux.so.2 (0x00133000 "esql -V" returns: IBM Informix CSDK Version 2.90, IBM Informix-ESQL Version 2.90.UC1 Software Serial Number RDS#N000000 The grep command Jeff wrote about - "grep -i -r sqli_describe_input_stmt /usr/lib/*" returns: grep: /usr/lib/X11: No such file or directory grep: /usr/lib/cups/filter/foomatic-rip: No such file or directory grep: /usr/lib/cups/backend/smb: No such file or directory Binary file /usr/lib/db2isqls09b.so matches Binary file /usr/lib/db2isqlt09b.so matches grep: /usr/lib/gimp/2.0/plug-ins/xsane: No such file or directory Binary file /usr/lib/icobsqls09b.so matches Binary file /usr/lib/ifgisqls09b.so matches Binary file /usr/lib/isqls09b.so matches Binary file /usr/lib/isqlt09b.so matches Binary file /usr/lib/libdb2ifsql.so matches Binary file /usr/lib/libdb2ixsql.so matches Binary file /usr/lib/libdb2thsql.so matches Binary file /usr/lib/libdb2tsql.so matches Binary file /usr/lib/libifcobsql.so matches Binary file /usr/lib/libiffgisql.so matches Binary file /usr/lib/libifsql.so matches Binary file /usr/lib/libixcobsql.so matches Binary file /usr/lib/libixfgisql.so matches Binary file /usr/lib/libixsql.so matches Binary file /usr/lib/libthsql.so matches Binary file /usr/lib/libtsql.so matches Binary file /usr/lib/python2.4/site-packages/_informixdb.so matches /usr/lib/python2.4/InformixDB-2.5/ext/_informixdb.c: sqli_describe_input_stmt(ESQLINTVERSION, sqli_curs_locate(ESQLINTVERSION, queryNa me, 257), &tda, 0); Binary file /usr/lib/python2.4/InformixDB-2.5/build/temp.linux-i686-2.4/ext/_informixdb.o matches Binary file /usr/lib/python2.4/InformixDB-2.5/build/lib.linux-i686-2.4/_informixdb.so matches grep: /usr/lib/sendmail: No such file or directory grep: /usr/lib/sendmail.sendmail: No such file or directory grep: /usr/lib/vte/gnome-pty-helper: Permission denied Thanks again for the help, John Carsten Haese wrote: > On 11/6/07, John Lhotak wrote: > > In order to troubleshoot this, I'll need to know a bit more about your system. What output do you get from the command "ldd /usr/lib/python2.4/site-packages/_informixdb.so"? What version does "esql -V" report? What was $INFORMIXDIR set to when you compiled the module? Is $INFORMIXDIR set to something different when you try to run the module, and if so, what is it set to? > > Thanks, > > Carsten. Jeff Rush wrote: > 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" to have it search in > there. > > I hope this helps, > > -Jeff > > From carsten at uniqsys.com Wed Nov 7 22:00:29 2007 From: carsten at uniqsys.com (Carsten Haese) Date: Wed, 07 Nov 2007 16:00:29 -0500 Subject: [DB-SIG] pep 249 In-Reply-To: <47320D8E.4050501@noaa.gov> References: <4730E910.1010800@noaa.gov> <47315E19.1080802@taupro.com> <47320D8E.4050501@noaa.gov> Message-ID: <1194469229.13550.8.camel@dot.uniqsys.com> On Wed, 2007-11-07 at 12:10 -0700, John Lhotak wrote: > Carsten, Jeff, Thank you for the responses. > > Carsten here is the out put from the commands you listed. > INFORMIXDIR is set to /opt/informix when I compiled the module and when > I try to run the module > > "ldd /usr/lib/python2.4/site-packages/_informixdb.so" returns: > linux-gate.so.1 => (0x004db000) > libifsql.so => /usr/local/informix/lib/esql/libifsql.so (0x00376000) > [...] This may be the source of your problem. Your $INFORMIXDIR is /opt/informix, yet your dynamic linker finds the Informix libraries in /usr/local/informix. Unless /opt/informix is a symlink to /usr/local/informix, you have two versions of ESQL/C on your system. One lives in /opt/informix, and it has sqli_describe_input_stmt, the other is in /usr/local/informix, and it doesn't have sqli_describe_input_stmt. You compiled with the former, and you're trying to run with the latter. If /opt/informix and /usr/local/informix are in fact two different locations, correct your dynamic linker configuration ($LD_LIBRARY_PATH or /etc/ld.so.conf or /etc/ld.so.conf.d) to make sure that it loads libraries from /opt/informix instead of /usr/local/informix. > "esql -V" returns: > > IBM Informix CSDK Version 2.90, IBM Informix-ESQL Version 2.90.UC1 > Software Serial Number RDS#N000000 That version should have sqli_describe_input_stmt. > > The grep command Jeff wrote about - > "grep -i -r sqli_describe_input_stmt /usr/lib/*" returns: > [...] > Binary file /usr/lib/libifsql.so matches > [...] This is a red herring because you should be looking at /usr/local/informix/lib, since that's the library being pulled in by the dynamic linker according to ldd. What does "grep sqli_describe_input_stmt /usr/local/informix/lib/esql/libifsql.so" show? Hope this helps, -- Carsten Haese http://informixdb.sourceforge.net From John.Lhotak at noaa.gov Thu Nov 8 16:44:15 2007 From: John.Lhotak at noaa.gov (John Lhotak) Date: Thu, 08 Nov 2007 08:44:15 -0700 Subject: [DB-SIG] pep 249 In-Reply-To: <1194469229.13550.8.camel@dot.uniqsys.com> References: <4730E910.1010800@noaa.gov> <47315E19.1080802@taupro.com> <47320D8E.4050501@noaa.gov> <1194469229.13550.8.camel@dot.uniqsys.com> Message-ID: <47332ECF.7040902@noaa.gov> Carsten, Thanks for the help. The problem is solved. It was the different libraries messing everything up. The libraries it kept trying to look at were old and did not have the symbols needed. Seems to be working fine now that it is looking at the correct ones. thanks again, john Carsten Haese wrote: > On Wed, 2007-11-07 at 12:10 -0700, John Lhotak wrote: > >> Carsten, Jeff, Thank you for the responses. >> >> Carsten here is the out put from the commands you listed. >> INFORMIXDIR is set to /opt/informix when I compiled the module and when >> I try to run the module >> >> "ldd /usr/lib/python2.4/site-packages/_informixdb.so" returns: >> linux-gate.so.1 => (0x004db000) >> libifsql.so => /usr/local/informix/lib/esql/libifsql.so (0x00376000) >> [...] >> > > This may be the source of your problem. Your $INFORMIXDIR > is /opt/informix, yet your dynamic linker finds the Informix libraries > in /usr/local/informix. Unless /opt/informix is a symlink > to /usr/local/informix, you have two versions of ESQL/C on your system. > One lives in /opt/informix, and it has sqli_describe_input_stmt, the > other is in /usr/local/informix, and it doesn't have > sqli_describe_input_stmt. You compiled with the former, and you're > trying to run with the latter. > > If /opt/informix and /usr/local/informix are in fact two different > locations, correct your dynamic linker configuration ($LD_LIBRARY_PATH > or /etc/ld.so.conf or /etc/ld.so.conf.d) to make sure that it loads > libraries from /opt/informix instead of /usr/local/informix. > > >> "esql -V" returns: >> >> IBM Informix CSDK Version 2.90, IBM Informix-ESQL Version 2.90.UC1 >> Software Serial Number RDS#N000000 >> > > That version should have sqli_describe_input_stmt. > > >> The grep command Jeff wrote about - >> "grep -i -r sqli_describe_input_stmt /usr/lib/*" returns: >> [...] >> Binary file /usr/lib/libifsql.so matches >> [...] >> > > This is a red herring because you should be looking > at /usr/local/informix/lib, since that's the library being pulled in by > the dynamic linker according to ldd. What does "grep > sqli_describe_input_stmt /usr/local/informix/lib/esql/libifsql.so" show? > > Hope this helps, > >