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

2008-12-14 Thread peter s.
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
--
http://mail.python.org/mailman/listinfo/python-list


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

2008-12-14 Thread peter s.
On Dec 14, 4:54 pm, "Martin v. Löwis"  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
--
http://mail.python.org/mailman/listinfo/python-list


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

2008-12-14 Thread peter s.
On Dec 14, 5:03 pm, "peter s."  wrote:
> On Dec 14, 4:54 pm, "Martin v. Löwis"  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.
--
http://mail.python.org/mailman/listinfo/python-list


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

2008-12-14 Thread peter s.
On Dec 14, 5:20 pm, "Martin v. Löwis"  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.
--
http://mail.python.org/mailman/listinfo/python-list