make
/usr/sbin/apxs -c -I/usr/local/include/python2.4 -DNDEBUG mod_wsgi.c -
L/usr/local/lib/python2.4/config -lpython2.4 -lpthread -ldl -lutil
/bin/sh /usr/lib64/apr/build/libtool --silent --mode=compile gcc -
prefer-pic -O2 -g -pipe -m64 -DAP_HAVE_DESIGNATED_INITIALIZER -
DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apr-0 -I/
usr/include/httpd -I/usr/local/include/python2.4 -DNDEBUG -c -o
mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
In file included from /usr/local/include/python2.4/Python.h:8,
from mod_wsgi.c:78:
/usr/local/include/python2.4/pyconfig.h:835:1: warning:
"_POSIX_C_SOURCE" redefined
In file included from /usr/include/sys/types.h:27,
from /usr/include/apr-0/apr.h:149,
from /usr/include/httpd/ap_config.h:19,
from /usr/include/httpd/httpd.h:29,
from mod_wsgi.c:19:
/usr/include/features.h:150:1: warning: this is the location of the
previous definition
/bin/sh /usr/lib64/apr/build/libtool --silent --mode=link gcc -o
mod_wsgi.la -I/usr/local/include/python2.4 -DNDEBUG -rpath /usr/lib64/
httpd/modules -module -avoid-version mod_wsgi.lo -L/usr/local/lib/
python2.4/config -lpython2.4 -lpthread -ldl -lutil
/usr/bin/ld: /usr/local/lib/python2.4/config/
libpython2.4.a(abstract.o): relocation R_X86_64_32 against `a local
symbol' can not be used when making a shared object; recompile with -
fPIC
/usr/local/lib/python2.4/config/libpython2.4.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
I am doing this on a (old) Fedora Core 3 (x86_64). I am not a whizzkid
in compiling stuff so I apologize if this turns out to be a common or
obvious error.
Try reinstalling Python but this time ensure that when you run
configure for Python that you supply the option '--enable-shared'.
This will enable the generation of a shared library for Python, ie.,
libpython2.4.so instead of the libpython2.4.a. The x86_64 platforms
seems to only like linking against a shared library.
If after doing that mod_wsgi does compile, run the command:
ldd .libs/mod_wsgi.so
in the mod_wsgi source directory. This will generate a list of the
shared libraries that mod_wsgi.so requires. It should now list
libpython2.4.so. If it cannot find that library though, set the
environment variable LD_RUN_PATH as:
LD_RUN_PATH=/usr/local/lib/python2.4/config
export LD_RUN_PATH
Then run:
make clean
and:
make
again to rebuild mod_wsgi.
Setting LD_RUN_PATH is sometimes needed like this because
libpython2.4.so not installed in standard library path when doing own
build/install of Python like you have. Run 'ldd' command again to then
see if it finds libpython2.4.so.
If any problems, send 'ls -las' listing of contents of
/usr/local/lib/python2.4/config and .libs directory in mod_wsgi source
code and the output of the ldd command each time you run it.
The LD_RUN_PATH variable only needs to be set when you are building
mod_wsgi, doesn't have to be set when running Apache.
Even if works, appreciate you sending me those directory listings and
ldd output. Actually would be good if you can send them to me a copy
of what they look like before you trying rebuilding Python so I have a
before and after, then I can use it all as examples in some proper
documentation for this specific problem.
Thanks.
Graham
I got mod_wsgi working. I like it. Setup in apache config is simple. I
have only got it installed on my development machine. I have no
'scientific data'. But, it feels solid and quick. As I said earlier, I
am not a compiler whizzkid. So, here is what I did.
This is the output of ls -las /usr/local/lib/python2.4/config before
recompiling Python:
total 5492
4 drwxr-xr-x 2 root root 4096 Jan 13 2006 .
20 drwxr-xr-x 19 root root 20480 Jan 13 2006 ..
4 -rw-r--r-- 1 root root 1777 Jan 13 2006 config.c
4 -rw-r--r-- 1 root root 1191 Jan 13 2006 config.c.in
8 -rwxr-xr-x 1 root root 7122 Jan 13 2006 install-sh
5372 -rw-r--r-- 1 root root 5487860 Jan 13 2006 libpython2.4.a
36 -rw-r--r-- 1 root root 35447 Jan 13 2006 Makefile
8 -rwxr-xr-x 1 root root 7430 Jan 13 2006 makesetup
8 -rw-r--r-- 1 root root 5920 Jan 13 2006 python.o
20 -rw-r--r-- 1 root root 17624 Jan 13 2006 Setup
4 -rw-r--r-- 1 root root 368 Jan 13 2006 Setup.config
4 -rw-r--r-- 1 root root 41 Jan 13 2006 Setup.local
This is the output of ls -las of the .libs directory in the source of
mod_wsgi before recompiling Python:
total 128
4 drwxrwxr-x 2 berry berry 4096 Mar 23 23:42 .
4 drwxrwxr-x 4 berry berry 4096 Mar 23 23:51 ..
120 -rw-rw-r-- 1 berry berry 114928 Mar 23 23:42 mod_wsgi.o
Then I recompiled Python using --enable-shared. I also swithed
versions, because I downloaded Python 2.5. This was easy. I just did ./
configure --enable-shared, make and sudo make install. That's it.
However, when I ran python on the command line I got an error about
not finding a shared library. So, I did /sbin/ldconfig. Now Python 2.5
did run.
Next I went to the source directory of mod_wsgi. Did ./configure, make
and make install. It just worked!
This is the output of ls -las /usr/local/lib/python2.4/config AFTER
recompiling Python:
total 5948
4 drwxr-xr-x 2 root root 4096 Mar 26 23:29 .
20 drwxr-xr-x 21 root root 20480 Mar 26 23:29 ..
4 -rw-r--r-- 1 root root 2078 Mar 26 23:29 config.c
4 -rw-r--r-- 1 root root 1446 Mar 26 23:29 config.c.in
8 -rwxr-xr-x 1 root root 7122 Mar 26 23:29 install-sh
5824 -rw-r--r-- 1 root root 5948432 Mar 26 23:29 libpython2.5.a
40 -rw-r--r-- 1 root root 38319 Mar 26 23:29 Makefile
8 -rwxr-xr-x 1 root root 7430 Mar 26 23:29 makesetup
8 -rw-r--r-- 1 root root 5968 Mar 26 23:29 python.o
20 -rw-r--r-- 1 root root 17862 Mar 26 23:29 Setup
4 -rw-r--r-- 1 root root 368 Mar 26 23:29 Setup.config
4 -rw-r--r-- 1 root root 41 Mar 26 23:29 Setup.local
This is the output of ls -las of the .libs directory in the source of
mod_wsgi AFTER recompiling Python:
total 3356
4 drwxrwxr-x 2 berry berry 4096 Mar 26 23:32 .
4 drwxrwxr-x 4 berry berry 4096 Mar 27 21:20 ..
120 -rw-rw-r-- 1 berry berry 115628 Mar 26 23:32 mod_wsgi.a
0 lrwxrwxrwx 1 berry berry 14 Mar 26 23:32 mod_wsgi.la -> ../
mod_wsgi.la
4 -rw-rw-r-- 1 berry berry 866 Mar 26 23:32 mod_wsgi.lai
120 -rw-rw-r-- 1 berry berry 115480 Mar 26 23:32 mod_wsgi.o
3104 -rwxrwxr-x 1 berry berry 3173332 Mar 26 23:32 mod_wsgi.so
Then I followed instructions for the integration of mod_wsgi with
Django and it worked perfectly!
Thanks very much for your help.
Berry
On 24 mrt, 01:17, "Graham Dumpleton" <graham.dumple...@gmail.com>
wrote:
First off, the AFTER listing you gave for config directory was that
for Python 2.4 and not the Python 2.5 you said you ended up using. Can
you do the same for Python 2.5 config directory?
Second is that the final mod_wsgi.so file is over 3MB which suggests
it still didn't use a Python shared library but a static one. Thus
need to see what was in Python 2.5 config directory as above to verify
the --enable-shared did what I expected and generated a
libpython2.5.so.
Since Python 2.5 is not standard Python on your system, did you use
--with-python option to mod_wsgi configure script to tell it which
Python to use?
Graham