On 20 October 2010 10:54, Kaen <[email protected]> wrote:
> Hi!
>
> I try to compile mod_wsgi 3.3 on a Linux system using an X86 64 bit
> processor, but I have problem:
>
> -----------------------------------------------
>
> r...@web1 [/usr/src/python26/mod_wsgi-3.3]# ./configure -with-python=/
> opt/python2.6/bin/python
> checking for apxs2... no
> checking for apxs... /usr/bin/apxs
> checking Apache version... 2.0.63
> configure: creating ./config.status
> config.status: creating Makefile
> r...@web1 [/usr/src/python26/mod_wsgi-3.3]# make
>
> /usr/bin/apxs -c -I/opt/python2.6/include/python2.6 -DNDEBUG
> mod_wsgi.c -L/opt/python2.6/lib -L/opt/python2.6/lib/python2.6/config
> -lpython2.6 -lpthread -ldl  -lutil -lm
> /usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-
> pic -m64 -fPIC -DPIC -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -
> D_REENTRANT -D_GNU_SOURCE -I/opt/pcre/include -pthread -I/usr/local/
> apache/include  -I/usr/local/apache/include   -I/usr/local/apache/
> include  -I/opt/python2.6/include/python2.6 -DNDEBUG  -c -o
> mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
> /usr/local/apache/build/libtool --silent --mode=link gcc -o
> mod_wsgi.la  -rpath /usr/local/apache/modules -module -avoid-
> version    mod_wsgi.lo -L/opt/python2.6/lib -L/opt/python2.6/lib/
> python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm
> /usr/bin/ld: /opt/python2.6/lib/libpython2.6.a(node.o): relocation
> R_X86_64_32 against `a local symbol' can not be used when making a
> shared object; recompile with -fPIC
> /opt/python2.6/lib/libpython2.6.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> apxs:Error: Command failed with rc=65536
> .
> make: *** [mod_wsgi.la] Error 1
>
>
> -----------------------------------------------
>
> Project Site has a solution:
>
> http://code.google.com/p/modwsgi/wiki/InstallationIssues
>
> but it isn’t obvious.
>
>
> How do I recompile Pyhton2.6 to 64bit system?

Did you sort this out?

This list isn't really about finding out how to install Python.

The short of it is that there should be 64 bit packages for Python
with your Linux distribution, unless you are using an old distribution
and not something recent.

If you do need to compile from source code, standard instructions are
found in the README file on the Python source distribution itself. You
will though find simplified instructions on various blogs around the
net.

At the minimum, you can probably get away with the following for Python:

  ./configure --prefix=/usr/local/python2.6 --with-threads --enable-shared
  make
  sudo make install

and for mod_wsgi do:

  export LD_RUN_PATH=/usr/local/python2.6/lib
  ./configure --with-python=/usr/local/python2.6/bin/python
  make
  sudo make install

Because you will have two Python installations of same version
installed in different locations, to ensure correct runtime is picked
up by Apache, you may also need to put in Apache configuration:

  WSGIPythonHome /usr/local/python2.6

If possible you are better off just replacing your Python 2.6 with
proper 64 bit binaries from your distributions repository. That way
you don't need these extra funny steps and can just build mod_wsgi as
normal.

Relevant parts of mod_wsgi documentation worth reading are:

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

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to