You are not logged in.

#1 2012-01-17 19:34:26

cfarinella
Member
Registered: 2009-10-09
Posts: 12

[SOLVED] Python from source can't use zlib

I need to install a separate version of Python (2.7.2) in a user directory. 

./configure --prefix=/home/statsd --enable-shared

When I run 'make' I get:

==
/home/statsd/src/Python-2.7.2/Modules/zlibmodule.c: In function ‘PyZlib_uncopy’:
/home/statsd/src/Python-2.7.2/Modules/zlibmodule.c:744:5: warning: implicit declaration of function ‘inflateCopy’
/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
==

...and then:

==
Python build finished, but the necessary bits to build these modules were not found:
_tkinter           bsddb185           dl             
imageop            sunaudiodev                       
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


Failed to build these modules:
binascii           zlib
==

pacman -Ss results:

core/zlib 1.2.5-2 [installed]
community/lib32-zlib 1.2.5-2 (lib32) [installed]

This is a live server and I cannot just blindly run a pacman update as it may break some other stuff. 

Does anyone have suggestions as to how I can build this Python with binascii and zlib?

thanks,

--charlie

Last edited by cfarinella (2012-01-17 21:55:46)

Offline

#2 2012-01-17 19:40:58

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Python from source can't use zlib

I'm just guessing here, but maybe check the official PKGBUILD http://projects.archlinux.org/svntogit/ … es/python2

  # Ensure that we are using the system copy of various libraries (expat, zlib and libffi),
  # rather than copies shipped in the tarball
  rm -r Modules/expat
  rm -r Modules/zlib
  rm -r Modules/_ctypes/{darwin,libffi}*

  export OPT="${CFLAGS}"
  ./configure --prefix=/usr --enable-shared --with-threads --enable-ipv6 \
              --enable-unicode=ucs4 --with-system-expat --with-system-ffi \
              --with-dbmliborder=gdbm:ndbm

Offline

#3 2012-01-17 20:39:57

cfarinella
Member
Registered: 2009-10-09
Posts: 12

Re: [SOLVED] Python from source can't use zlib

karol wrote:

I'm just guessing here, but maybe check the official PKGBUILD http://projects.archlinux.org/svntogit/ … es/python2

Thank you so much for your reply, it turns out to be operator (me) error.  I must have installed both the 32bit and 64bit versions of zlib for some reason and the python build was trying to use the first one it found.  I uninstalled the 32bit libraries and all works as expected.

Thank you again  :-)

--charlie

Offline

#4 2012-01-17 21:18:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Python from source can't use zlib

Please remember to mark the thread as solved.

Offline

Board footer

Powered by FluxBB