From: Gomez, D. <dg...@ti...> - 2005-11-09 10:58:27
|
I realize that my problem is because 64-bit sybase libraries are not accomodated in the setup.py file for the 64-bit python. Hence here's a patch to make it select the right libs. (I've never written in python. I am a sysadmin. I was looking for some internal python variable that would return the bit arch, but all I could come up with was a 'uname' command. Not ideal but I do use a bedrock command that all linux os should have.) --- sybase-0.37/setup.py 2005-04-06 18:46:43.000000000 -0400 +++ sybase-0.37.patch/setup.py 2005-11-08 10:44:26.840499000 -0500 @@ -45,7 +45,12 @@ # On Linux the Sybase tcl library is distributed as sybtcl syb_libs =3D [] if os.uname()[0] =3D=3D 'Linux': - lib_names =3D ['blk', 'ct', 'cs', 'sybtcl', 'insck', 'comn', 'intl'] + # accomodate 64-bit sybase libraries + arch =3D os.popen("uname -m").read().splitlines()[0] + if "x86_64" =3D=3D arch: + lib_names =3D ['blk64', 'ct64', 'cs64', 'sybtcl64', = 'insck64', 'comn64', 'intl64'] + else: + lib_names =3D ['blk', 'ct', 'cs', 'sybtcl', 'insck', 'comn', = + 'intl'] elif os.uname()[0] =3D=3D 'AIX': lib_names =3D ['blk', 'ct', 'cs', 'comn', 'tcl', 'intl', = 'insck'] else: -----Original Message----- From: Gomez, Daniel=20 Sent: Monday, November 07, 2005 3:24 PM To: 'pyt...@ww...' Subject: 64-bit python sybase module failure I can report that sybase_OC1251_12655 build fine for python 2.4.2 under 32-bit suse 9.2 Unfortunately it dosn't build for 64-bit. I am using the 64-bit sybase libraries, but somehow libblk.a complains about incompatibilies. Any clue as to why this is taking place? thank you. /usr/bin/ld: skipping incompatible /local/platform/packages/sybase_OC1251_12655/lib/libblk.a when searching for -lblk cronus:/local/src/Linux64/python/modules/sybase-0.37 # /usr/local/packages/python64-2.4.2/bin/python setup.py build running build running build_py creating build creating build/lib.linux-x86_64-2.4 copying Sybase.py -> build/lib.linux-x86_64-2.4 running build_ext building 'sybasect' extension creating build/temp.linux-x86_64-2.4 /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c blk.c -o build/temp.linux-x86_64-2.4/blk.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c databuf.c -o build/temp.linux-x86_64-2.4/databuf.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c cmd.c -o build/temp.linux-x86_64-2.4/cmd.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c conn.c -o build/temp.linux-x86_64-2.4/conn.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c ctx.c -o build/temp.linux-x86_64-2.4/ctx.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c datafmt.c -o build/temp.linux-x86_64-2.4/datafmt.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c iodesc.c -o build/temp.linux-x86_64-2.4/iodesc.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c locale.c -o build/temp.linux-x86_64-2.4/locale.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c msgs.c -o build/temp.linux-x86_64-2.4/msgs.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c numeric.c -o build/temp.linux-x86_64-2.4/numeric.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c money.c -o build/temp.linux-x86_64-2.4/money.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c datetime.c -o build/temp.linux-x86_64-2.4/datetime.o /usr/local/packages/gcc-3.4.4/bin/gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include -fPIC -DWANT_BULKCOPY -DHAVE_BLK_ALLOC -DHAVE_BLK_DESCRIBE -DHAVE_BLK_DROP -DHAVE_BLK_ROWXFER_MULT -DHAVE_BLK_TEXTXFER -DHAVE_CT_CURSOR -DHAVE_CT_DATA_INFO -DHAVE_CT_DYNAMIC -DHAVE_CT_SEND_DATA -DHAVE_CT_SETPARAM -DHAVE_CS_CALC -DHAVE_CS_CMP -I/usr/local/packages/sybase_OLD/include -I/usr/local/packages/python64-2.4.2/include/python2.4 -c sybasect.c -o build/temp.linux-x86_64-2.4/sybasect.o /usr/local/packages/gcc-3.4.4/bin/gcc -pthread -shared -L/usr/local/packages/gcc-3.4.4/lib64 -Wl,-R,/usr/local/packages/gcc-3.4.4/lib64 -I/usr/local/packages/gcc-3.4.4/include -I/usr/local/packages/gcc-3.4.4/include build/temp.linux-x86_64-2.4/blk.o build/temp.linux-x86_64-2.4/databuf.o build/temp.linux-x86_64-2.4/cmd.o build/temp.linux-x86_64-2.4/conn.o build/temp.linux-x86_64-2.4/ctx.o build/temp.linux-x86_64-2.4/datafmt.o build/temp.linux-x86_64-2.4/iodesc.o build/temp.linux-x86_64-2.4/locale.o build/temp.linux-x86_64-2.4/msgs.o build/temp.linux-x86_64-2.4/numeric.o build/temp.linux-x86_64-2.4/money.o build/temp.linux-x86_64-2.4/datetime.o build/temp.linux-x86_64-2.4/sybasect.o -L/usr/local/packages/sybase_OLD/lib -lblk -lct -lcs -lsybtcl -lcomn -lintl -o build/lib.linux-x86_64-2.4/sybasect.so /usr/bin/ld: skipping incompatible /local/platform/packages/sybase_OC1251_12655/lib/libblk.a when searching for -lblk /usr/bin/ld: cannot find -lblk collect2: ld returned 1 exit status error: command '/usr/local/packages/gcc-3.4.4/bin/gcc' failed with exit status 1 cronus:/local/src/Linux64/python/modules/sybase-0.37 # |
From: Andrew M. <an...@ob...> - 2005-11-09 17:28:20
|
>I realize that my problem is because 64-bit sybase libraries are not >accomodated in the setup.py file for the 64-bit python. Hence here's a >patch to make it select the right libs. Thanks! Do you know if this is likely to be true of all linux distributions (i.e., are the files installed by sybase or the distribution)? >(I've never written in python. I am a sysadmin. I hope it won't be your last venture into Python - it's an excellent language for system administration. >I was looking for some internal python variable that would return the bit >arch, but all I could come up with was a 'uname' command. Not ideal but I >do use a bedrock command that all linux os should have.) I think the os.uname() function is the one you're looking for. Can you fire up the Python interactive mode and show us the output on your system? Eg: $ python Python 2.3.5 (#2, Aug 30 2005, 15:50:26) [GCC 4.0.2 20050821 (prerelease) (Debian 4.0.1-6)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> os.uname() ('Linux', 'longblack', '2.6.14', '#1 SMP Mon Oct 31 19:45:30 EST 2005', 'i686') > >--- sybase-0.37/setup.py 2005-04-06 18:46:43.000000000 -0400 >+++ sybase-0.37.patch/setup.py 2005-11-08 10:44:26.840499000 -0500 >@@ -45,7 +45,12 @@ > # On Linux the Sybase tcl library is distributed as sybtcl > syb_libs = [] > if os.uname()[0] == 'Linux': >- lib_names = ['blk', 'ct', 'cs', 'sybtcl', 'insck', 'comn', >'intl'] >+ # accomodate 64-bit sybase libraries >+ arch = os.popen("uname -m").read().splitlines()[0] >+ if "x86_64" == arch: >+ lib_names = ['blk64', 'ct64', 'cs64', 'sybtcl64', 'insck64', >'comn64', 'intl64'] >+ else: >+ lib_names = ['blk', 'ct', 'cs', 'sybtcl', 'insck', 'comn', >+ 'intl'] > elif os.uname()[0] == 'AIX': > lib_names = ['blk', 'ct', 'cs', 'comn', 'tcl', 'intl', 'insck'] > else: -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ |