Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Building from source -- zlib/binascii problems 2.5.2/2.6.1

Reply
Thread Tools

Building from source -- zlib/binascii problems 2.5.2/2.6.1

 
 
peter s.
Guest
Posts: n/a
 
      12-14-2008
I am trying to build Python from source on a RHEL system where I do
not have root access. There are two modules that I am having trouble
with: zlib & binascii.

zlib -- This seems like a make configuration issue. I have noticed
that 'gcc -v' returns '--with-system-zlib':
$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --
infodir=/usr/share/info --enable-shared --enable-threads=posix --
enable-checking=release --with-system-zlib --enable-__cxa_atexit --
disable-libunwind-exceptions --enable-libgcj-multifile --enable-
languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --
disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-
gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)

and then when I run 'make' I see:

building 'zlib' extension
gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -
Wstrict-prototypes -I. -I/location/of/Python-2.5.2/./Include -I. -
IInclude -I./Include -I/usr/local/include -I/location/of/Python-2.5.2/
Include -I/location/of/Python-2.5.2 -c /location/of/Python-2.5.2/
Modules/zlibmodule.c -o build/temp.linux-x86_64-2.5/location/of/
Python-2.5.2/Modules/zlibmodule.o
gcc -pthread -shared build/temp.linux-x86_64-2.5/location/of/
Python-2.5.2/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/
lib.linux-x86_64-2.5/zlib.so
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for
-lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -
lz
/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status

It seems as though I need to force the build process to use the zlib
that comes with python source.

binascii -- I have no idea what binascii requires in order to compile,
so I am clueless. It properly compiles with 2.5.2, but fails to build
in 2.6.1. I am OK using 2.5.2 if I could get zlib to work.

Thanks,

Peter
 
Reply With Quote
 
 
 
 
Martin v. L÷wis
Guest
Posts: n/a
 
      12-14-2008
> Target: x86_64-redhat-linux
> gcc -pthread -shared build/temp.linux-x86_64-2.5/location/of/
> Python-2.5.2/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/
> lib.linux-x86_64-2.5/zlib.so
> /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for
> -lz


Do

file /usr/lib/libz.so

It might be a 32-bit library, in which case you can check whether
/usr/lib64 has a 64-bit library. I'm puzzled why it only
happens for -lz; perhaps you are better of compiling with a 32-bit
compiler.

Regards,
Martin
 
Reply With Quote
 
 
 
 
peter s.
Guest
Posts: n/a
 
      12-14-2008
On Dec 14, 4:54*pm, "Martin v. L÷wis" <(E-Mail Removed)> wrote:
> > Target: x86_64-redhat-linux
> > gcc -pthread -shared build/temp.linux-x86_64-2.5/location/of/
> > Python-2.5.2/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/
> > lib.linux-x86_64-2.5/zlib.so
> > /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for
> > -lz

>
> Do
>
> * file /usr/lib/libz.so
>
> It might be a 32-bit library, in which case you can check whether
> /usr/lib64 has a 64-bit library. I'm puzzled why it only
> happens for -lz; perhaps you are better of compiling with a 32-bit
> compiler.
>
> Regards,
> Martin


$ file /usr/lib/libz.s*
/usr/lib/libz.so: symbolic link to `libz.so.1.2.3'
/usr/lib/libz.so.1: symbolic link to `libz.so.1.2.3'
/usr/lib/libz.so.1.2.3: ELF 32-bit LSB shared object, Intel 80386,
version 1 (SYSV), stripped
 
Reply With Quote
 
peter s.
Guest
Posts: n/a
 
      12-14-2008
On Dec 14, 5:03*pm, "peter s." <(E-Mail Removed)> wrote:
> On Dec 14, 4:54*pm, "Martin v. L÷wis" <(E-Mail Removed)> wrote:
>
>
>
> > > Target: x86_64-redhat-linux
> > > gcc -pthread -shared build/temp.linux-x86_64-2.5/location/of/
> > > Python-2.5.2/Modules/zlibmodule.o -L/usr/local/lib -lz -o build/
> > > lib.linux-x86_64-2.5/zlib.so
> > > /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for
> > > -lz

>
> > Do

>
> > * file /usr/lib/libz.so

>
> > It might be a 32-bit library, in which case you can check whether
> > /usr/lib64 has a 64-bit library. I'm puzzled why it only
> > happens for -lz; perhaps you are better of compiling with a 32-bit
> > compiler.

>
> > Regards,
> > Martin

>
> $ file /usr/lib/libz.s*
> /usr/lib/libz.so: * * * symbolic link to `libz.so.1.2.3'
> /usr/lib/libz.so.1: * * symbolic link to `libz.so.1.2.3'
> /usr/lib/libz.so.1.2.3: ELF 32-bit LSB shared object, Intel 80386,
> version 1 (SYSV), stripped


I meant to also add

$ file /usr/lib64/libz.s*
/usr/lib64/libz.so.1: symbolic link to `libz.so.1.2.3'
/usr/lib64/libz.so.1.2.3: ELF 64-bit LSB shared object, AMD x86-64,
version 1 (SYSV), stripped

So.. it seems as though I need to get it to point to the 64 bit
version (or compile the zlib that comes with Python source). I'm not
sure how to override that.
 
Reply With Quote
 
Martin v. L÷wis
Guest
Posts: n/a
 
      12-14-2008
> So.. it seems as though I need to get it to point to the 64 bit
> version (or compile the zlib that comes with Python source). I'm not
> sure how to override that.


The easiest solution would be to invoke the linker line manually,
and replace -lz with the absolute path to the right library.

Regards,
Martin
 
Reply With Quote
 
peter s.
Guest
Posts: n/a
 
      12-15-2008
On Dec 14, 5:20*pm, "Martin v. L÷wis" <(E-Mail Removed)> wrote:
> > So.. it seems as though I need to get it to point to the 64 bit
> > version (or compile the zlib that comes with Python source). *I'm not
> > sure how to override that.

>
> The easiest solution would be to invoke the linker line manually,
> and replace -lz with the absolute path to the right library.
>
> Regards,
> Martin


Thanks for you help thus far, though I am still stuck. I have tried a
number of things with no success. Modifying the actual command that
builds the zlibmodule to link to other sources produces different
errors, such as "build/lib.linux-x86_64-2.5/zlib.so: undefined symbol:
inflateEnd". Will update this thread if I find a solution.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up." Midex Python 24 05-07-2007 04:23 AM
Arrghh... Problems building Python from source on OS X -- J. Jeffrey Close Python 1 06-28-2006 02:53 PM
Wireless building-to-building 101 Tim Jacob Wireless Networking 2 02-17-2006 09:46 AM
Problems building Ruby from source on Windows Daniel Berger Ruby 2 09-10-2005 11:58 PM
Building to Building wireless Patriot Cisco 2 11-04-2003 05:07 PM



Advertisments