error building mod_wsgi for python2.6 on centos x86_64

76 views
Skip to first unread message

Vishwajeet

unread,
Nov 6, 2010, 10:46:53 AM11/6/10
to modwsgi
Hello,
I am facing this problem while building mod_wsgi on centos x, I went
through the documentation as well i tried to search on the web but
none of the solutions helped me.
I have compiled python from source and it's running perfectly fine.

Any help in this regard is highly appreciated, I am stuck with this
problem since morning, I have previously done the same and it has
worked for me the only difference now is its on amazon ec2

/usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG mod_wsgi.c
-L/usr/local/lib -L/usr/local/lib/python2.6/config -lpython2.6 -
lpthread -ldl -lutil -lm
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -
O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-
protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -
fasynchronous-unwind-tables -fno-strict-aliasing -DLINUX=2 -
D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/
include/httpd -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/
local/include/python2.6 -DNDEBUG -c -o mod_wsgi.lo mod_wsgi.c &&
touch mod_wsgi.slo
In file included from /usr/local/include/python2.6/Python.h:58,
from mod_wsgi.c:135:
/usr/local/include/python2.6/pyport.h:685:2: error: #error "LONG_BIT
definition appears wrong for platform (bad gcc/glibc config?)."
mod_wsgi.c: In function 'wsgi_server_group':
mod_wsgi.c:949: warning: unused variable 'value'
mod_wsgi.c: In function 'Log_writelines':
mod_wsgi.c:1732: warning: unused variable 'msg'
mod_wsgi.c: In function 'Adapter_output':
mod_wsgi.c:3010: warning: unused variable 'n'
mod_wsgi.c: In function 'Adapter_file_wrapper':
mod_wsgi.c:4024: warning: unused variable 'result'
mod_wsgi.c: In function 'wsgi_python_term':
mod_wsgi.c:5631: warning: unused variable 'tstate'
mod_wsgi.c:5630: warning: unused variable 'interp'
mod_wsgi.c: In function 'wsgi_python_child_init':
mod_wsgi.c:6760: warning: unused variable 'l'
mod_wsgi.c:6658: warning: unused variable 'interp'
mod_wsgi.c: In function 'wsgi_add_import_script':
mod_wsgi.c:7411: warning: unused variable 'error'
mod_wsgi.c: In function 'wsgi_add_handler_script':
mod_wsgi.c:7859: warning: unused variable 'dconfig'
mod_wsgi.c:7858: warning: unused variable 'sconfig'
mod_wsgi.c: In function 'wsgi_hook_handler':
mod_wsgi.c:8905: warning: suggest parentheses around assignment used
as truth value
mod_wsgi.c:8907: warning: suggest parentheses around assignment used
as truth value
mod_wsgi.c:8909: warning: suggest parentheses around assignment used
as truth value
mod_wsgi.c:8913: warning: suggest parentheses around assignment used
as truth value
mod_wsgi.c:8933: warning: suggest parentheses around assignment used
as truth value
mod_wsgi.c:8935: warning: suggest parentheses around assignment used
as truth value
mod_wsgi.c:8938: warning: suggest parentheses around assignment used
as truth value
mod_wsgi.c: In function 'wsgi_daemon_worker':
mod_wsgi.c:10227: warning: unused variable 'duration'
mod_wsgi.c:10226: warning: unused variable 'start'
mod_wsgi.c: In function 'wsgi_hook_daemon_handler':
mod_wsgi.c:12423: warning: unused variable 'i'
mod_wsgi.c:12421: warning: unused variable 'elts'
mod_wsgi.c:12420: warning: unused variable 'head'
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1

Carl Nobile

unread,
Nov 6, 2010, 11:51:35 AM11/6/10
to mod...@googlegroups.com
/usr/local/include/python2.6/pyport.h:685:2: error: #error "LONG_BIT
definition appears wrong for platform (bad gcc/glibc config?)."

Seems to be complaining that there is something wrong with the version
of glibc on your box. Sometimes on 64 bit machines there is also a 32
bit version of glibc, could you be pointing to it for some reason? I
see you are using a non CentOS standard version of Python, could this
be messing up your paths for other things?

~Carl

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

--
-------------------------------------------------------------------------------
Carl J. Nobile (Software Engineer)
carl....@gmail.com
-------------------------------------------------------------------------------

Graham Dumpleton

unread,
Nov 6, 2010, 6:50:33 PM11/6/10
to mod...@googlegroups.com
On 7 November 2010 01:46, Vishwajeet <dextr...@gmail.com> wrote:
> Hello,
> I am facing this problem while building mod_wsgi on centos x, I went
> through the documentation as well i tried to search on the web but
> none of the solutions helped me.
> I have compiled python from source and it's running perfectly fine.
>
> Any help in this regard is highly appreciated, I am stuck with this
> problem since morning, I have previously done the same and it has
> worked for me the only difference now is its on amazon ec2
>
> /usr/sbin/apxs -c -I/usr/local/include/python2.6 -DNDEBUG   mod_wsgi.c
> -L/usr/local/lib -L/usr/local/lib/python2.6/config  -lpython2.6 -
> lpthread -ldl  -lutil -lm
> /usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -
> O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-
> protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -
> fasynchronous-unwind-tables -fno-strict-aliasing  -DLINUX=2 -
> D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/
> include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1  -I/usr/
> local/include/python2.6 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c &&
> touch mod_wsgi.slo
> In file included from /usr/local/include/python2.6/Python.h:58,
>                 from mod_wsgi.c:135:
> /usr/local/include/python2.6/pyport.h:685:2: error: #error "LONG_BIT
> definition appears wrong for platform (bad gcc/glibc config?)."

This would normally indicate you are using a 64 bit GCC compiler but
have only a 32 bit Python installation or vice versa.

Have only ever seen this on MacOS X before. See:

http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX#Non_Universal_Developer_Tools

Graham

Vishwajeet

unread,
Nov 6, 2010, 7:01:39 PM11/6/10
to modwsgi


On Nov 6, 8:51 pm, Carl Nobile <carl.nob...@gmail.com> wrote:
> /usr/local/include/python2.6/pyport.h:685:2: error: #error "LONG_BIT
> definition appears wrong for platform (bad gcc/glibc config?)."
>
> Seems to be complaining that there is something wrong with the version
> of glibc on your box. Sometimes on 64 bit machines there is also a 32
> bit version of glibc, could you be pointing to it for some reason?

How do I find that out ?

>I see you are using a non CentOS standard version of Python, could this
> be messing up your paths for other things?

I have similar setup working on three machines, I picked the .so file
from one of the setups and moved to ec2 instance and it seems to be
working fine.
> > For more options, visit this group athttp://groups.google.com/group/modwsgi?hl=en.
>
> --
> -------------------------------------------------------------------------------
> Carl J. Nobile (Software Engineer)
> carl.nob...@gmail.com
> -------------------------------------------------------------------------------

Carl Nobile

unread,
Nov 7, 2010, 1:09:17 AM11/7/10
to mod...@googlegroups.com
You can use ldd on the python executable like so:

$ ldd /usr/bin/python
linux-vdso.so.1 => (0x00007fff6bbb4000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f3b8562b000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f3b85427000)
libutil.so.1 => /lib/libutil.so.1 (0x00007f3b85223000)
libssl.so.0.9.8 => /lib/libssl.so.0.9.8 (0x00007f3b84fd1000)
libcrypto.so.0.9.8 => /lib/libcrypto.so.0.9.8 (0x00007f3b84c41000)
libz.so.1 => /lib/libz.so.1 (0x00007f3b84a29000)
libm.so.6 => /lib/libm.so.6 (0x00007f3b847a6000)
libc.so.6 => /lib/libc.so.6 (0x00007f3b84423000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3b8586b000)

Notice the last line it indicates that the Python executable that I am
using is 64bit since it is pulling in the /lib64/ld-linux-x86-64.so.2
shared object. Your's may be the 32bit version.

~Carl

> For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
>
>

--
-------------------------------------------------------------------------------
Carl J. Nobile (Software Engineer)

carl....@gmail.com
-------------------------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages