From: Andrew T. <and...@ap...> - 2005-02-11 20:30:53
|
Hi, I'm now trying to use the sybase module under Linux RHEL 3 and Sybase 12.5. The module compiles and installs cleanly however scripts don't like importing Sybase. /temp.linux-i686-2.4/datetime.o build/temp.linux-i686-2.4/sybasect.o -L/opt/sybase/OCS-12_5/lib -o build/lib.linux-i686-2.4/sybasect.so running install_lib copying build/lib.linux-i686-2.4/Sybase.py -> /usr/local/lib/python2.4/site-packages copying build/lib.linux-i686-2.4/sybasect.so -> /usr/local/lib/python2.4/site-packages byte-compiling /usr/local/lib/python2.4/site-packages/Sybase.py to Sybase.pyc [root@scratch sybase-0.36]# [root@scratch sybase-0.36]# /usr/local/bin/python -ic "import Sybase" Traceback (most recent call last): File "<string>", line 1, in ? File "Sybase.py", line 20, in ? from sybasect import * ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: undefined symbol: cs_dt_info I have tried this with Python 2.2 as per installed by RHEL 3 and also with Python 2.4. Any guidance appreciated. Regards, Andrew. -- Andrew Thomson <and...@ap...> |
From: Andrew M. <an...@ob...> - 2005-02-11 22:08:29
|
>/temp.linux-i686-2.4/datetime.o build/temp.linux-i686-2.4/sybasect.o >-L/opt/sybase/OCS-12_5/lib -o build/lib.linux-i686-2.4/sybasect.so >running install_lib >copying build/lib.linux-i686-2.4/Sybase.py >-> /usr/local/lib/python2.4/site-packages >copying build/lib.linux-i686-2.4/sybasect.so >-> /usr/local/lib/python2.4/site-packages >byte-compiling /usr/local/lib/python2.4/site-packages/Sybase.py to >Sybase.pyc >[root@scratch sybase-0.36]# > >[root@scratch sybase-0.36]# /usr/local/bin/python -ic "import Sybase" >Traceback (most recent call last): > File "<string>", line 1, in ? > File "Sybase.py", line 20, in ? > from sybasect import * >ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: >undefined symbol: cs_dt_info Try starting python like this and see if it makes any difference: $ LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib python -ic "import Sybase" -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |
From: Andrew T. <and...@ap...> - 2005-02-14 22:02:31
|
On Fri, 2005-02-11 at 14:08 +1100, Andrew McNamara wrote: > >/temp.linux-i686-2.4/datetime.o build/temp.linux-i686-2.4/sybasect.o > >-L/opt/sybase/OCS-12_5/lib -o build/lib.linux-i686-2.4/sybasect.so > >running install_lib > >copying build/lib.linux-i686-2.4/Sybase.py > >-> /usr/local/lib/python2.4/site-packages > >copying build/lib.linux-i686-2.4/sybasect.so > >-> /usr/local/lib/python2.4/site-packages > >byte-compiling /usr/local/lib/python2.4/site-packages/Sybase.py to > >Sybase.pyc > >[root@scratch sybase-0.36]# > > > >[root@scratch sybase-0.36]# /usr/local/bin/python -ic "import Sybase" > >Traceback (most recent call last): > > File "<string>", line 1, in ? > > File "Sybase.py", line 20, in ? > > from sybasect import * > >ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: > >undefined symbol: cs_dt_info > > Try starting python like this and see if it makes any difference: > > $ LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib python -ic "import Sybase" > > Thanks for the suggestion Andrew. I believe my Sybase environment was already setup ok with the following variables set. [ajt@scratch ajt]$ env | grep -i ld LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib:/opt/sybase/OCS-12_5/lib3p:/opt/sybase/SQLRemote/lib:/opt/sybase/ASE-12_5/lib:/opt/tibco/tibrv/lib Nonetheless, I tried your suggestion as follows: [ajt@scratch ajt]$ LD_LIBRARY_PATH=/opt/sybase/OCS-12_5/lib python -ic "import Sybase" Traceback (most recent call last): File "<string>", line 1, in ? File "/usr/local/lib/python2.4/site-packages/Sybase.py", line 20, in ? from sybasect import * ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: undefined symbol: cs_dt_info >>> Any further pointers appreciated. Thanks, ajt. -- Andrew Thomson <and...@ap...> |
From: Andrew M. <an...@ob...> - 2005-02-14 23:42:33
|
>Nonetheless, I tried your suggestion as follows: [...] >ImportError: /usr/local/lib/python2.4/site-packages/sybasect.so: >undefined symbol: cs_dt_info What does the output of: $ ldd /usr/local/lib/python2.4/site-packages/sybasect.so look like? I know very little about Sybase (I don't have it installed, either), but I've been working with the dynamic linkers under Linux (and Solaris) for years. I've seen this specific problem mentioned on the list a few times, but I can't find a solution in the list archives. The error is more suggestive of an incorrect library version, rather than a missing file, so pay careful attention to the paths. You can also use ldd to explore the shared dependancies of any other libraries being used by sybasect.so. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |
From: Andrew T. <and...@ap...> - 2005-02-15 00:27:58
|
On Mon, 2005-02-14 at 15:42 +1100, Andrew McNamara wrote: > What does the output of: > > $ ldd /usr/local/lib/python2.4/site-packages/sybasect.so > > look like? Andrew, Here's the output.. looks good? [ajt@scratch ajt]$ ldd /usr/local/lib/python2.4/site-packages/sybasect.so libpthread.so.0 => /lib/tls/libpthread.so.0 (0x004c9000) libc.so.6 => /lib/tls/libc.so.6 (0x00e6a000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x008af000) I also did it for my 2.2 installation.. [ajt@scratch ajt]$ ldd /usr/lib/python2.2/site-packages/sybasect.so libc.so.6 => /lib/tls/libc.so.6 (0x0070b000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00a14000) Looks exciting! ;) Regards, ajt. > > I know very little about Sybase (I don't have it installed, either), > but I've been working with the dynamic linkers under Linux (and Solaris) > for years. I've seen this specific problem mentioned on the list a few > times, but I can't find a solution in the list archives. The error is > more suggestive of an incorrect library version, rather than a missing > file, so pay careful attention to the paths. > > You can also use ldd to explore the shared dependancies of any other > libraries being used by sybasect.so. > -- Andrew Thomson <and...@ap...> |
From: Andrew M. <an...@ob...> - 2005-02-15 02:34:04
|
>Here's the output.. looks good? > >[ajt@scratch ajt]$ >ldd /usr/local/lib/python2.4/site-packages/sybasect.so > libpthread.so.0 => /lib/tls/libpthread.so.0 (0x004c9000) > libc.so.6 => /lib/tls/libc.so.6 (0x00e6a000) > /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x008af000) > >I also did it for my 2.2 installation.. > >[ajt@scratch ajt]$ ldd /usr/lib/python2.2/site-packages/sybasect.so > libc.so.6 => /lib/tls/libc.so.6 (0x0070b000) > /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00a14000) > >Looks exciting! ;) Hmmm - either it statically linked with the sybase client lib, or it's pulling in shared libs by hand. Anyone on the list have a better idea what it's up to? You might want to try running strace (linux) or truss (solaris) on python as it starts. Something like: strace -o /tmp/trace.out -f python -ic "import Sybase" The contents of trace.out will be too large to post to the list, but reading through it might give some clues as to how it's pulling in the client libs. Jump to where it's reading sybasect.so and see what happens after that. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |
From: Gregory B. <gn...@it...> - 2005-02-15 03:12:28
|
Andrew McNamara wrote: >Hmmm - either it statically linked with the sybase client lib, or it's >pulling in shared libs by hand. Anyone on the list have a better idea >what it's up to? > > > > The sybase libs do dlopen() (or equiv) to link some of their libraries at connect time, so ldd doesn't help much. You've pretty much gotta have the correct LD_LIBRARY_PATH at runtime. |
From: Andrew M. <an...@ob...> - 2005-02-15 04:38:05
|
>>Hmmm - either it statically linked with the sybase client lib, or it's >>pulling in shared libs by hand. Anyone on the list have a better idea >>what it's up to? > >The sybase libs do dlopen() (or equiv) to link some of their libraries >at connect time, so ldd doesn't help much. You've pretty much gotta have >the correct LD_LIBRARY_PATH at runtime. Ta. That's what I suspected. Is it using LD_LIBRARY_PATH in that case, or some other environment variable (if they're using dlopen(), they can take their choice)? Anyway, strace should reveal if it's coming off the rails and pulling in an old version of the lib. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |
From: Gregory B. <gn...@it...> - 2005-02-15 17:09:21
|
Andrew McNamara wrote: >Ta. That's what I suspected. Is it using LD_LIBRARY_PATH in that case, or >some other environment variable > It uses LD_LIBRARY_PATH, because that's what the SYBASE.sh script sets. (I think the dlopen is for the transport stuff, so at connect time it dynamically links the appropriate transport library.) |