1

I'm trying to compile mod_wsgi for use with python2.7 on my centos 6.6 server.

I've downloaded the source code and ran the following command -

./configure --with-python=/usr/local/bin/python2.7 --disable-framework

Which ran fine. However, when I try to run make I get the following -

/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
.
make: *** [src/server/mod_wsgi.la] Error 1

edit - I ran the following command and my Python2.7 is 64 bit -

import struct
print struct.calcsize("P") * 8

I also tried doing a pip2.7 install mod_wsgi and I get the following -

/usr/local/lib/python2.7/config -lpython2.7
    /usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
    /usr/local/lib/libpython2.7.a: could not read symbols: Bad value
    collect2: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1

In reading the documenation here -

http://code.google.com/p/modwsgi/wiki/InstallationIssues#Lack_Of_Python_Shared_Library

It would seem I have an issue with my symlinks. How would I go about creating or replacing the symlink they're referencing here -

If the version of Python being used was compiled for X86 64 bit architecture and a shared library does exist, but not in the 'config' directory, then adding the missing symlink may be all that is required.

I've confirmed the Python2.7 is a 64 bit install and I ran the following to configure it so it is indeed a shared environment -

./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
whoisearth
  • 4,080
  • 13
  • 62
  • 130
  • I had to re-compile my install of python2.7 as per this - http://stackoverflow.com/questions/7880454/python-executable-not-finding-libpython-shared-library – whoisearth Dec 15 '15 at 03:52

1 Answers1

0

I needed to recompile my Python as found in the following documentation -

Python executable not finding libpython shared library

After that I was able to use the 64bit version of mod-wsgi.

Community
  • 1
  • 1
whoisearth
  • 4,080
  • 13
  • 62
  • 130