jvandal / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Configure should report an error if python-dev is missing #169

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. ./configure
2. make

What is the expected output? What do you see instead?

/usr/local/apache2/bin/apxs -c -I/usr/include/python2.6 -DNDEBUG   mod_wsgi.c 
-L/usr/lib -
L/usr/lib/python2.6/config  -lpython2.6 -lpthread -ldl  -lutil -lm
/usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic   
-DLINUX=2 -D_REENTRANT -
D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache2/include  
-I/usr/local/apache2/include   -
I/usr/local/apache2/include  -I/usr/include/python2.6 -DNDEBUG  -c -o 
mod_wsgi.lo mod_wsgi.c && touch 
mod_wsgi.slo
mod_wsgi.c:113:20: error: Python.h: No such file or directory
mod_wsgi.c:114:21: error: compile.h: No such file or directory
mod_wsgi.c:115:18: error: node.h: No such file or directory
mod_wsgi.c:116:20: error: osdefs.h: No such file or directory
mod_wsgi.c:119:2: error: #error Sorry, mod_wsgi requires at least Python 2.3.0.
mod_wsgi.c:123:2: error: #error Sorry, mod_wsgi requires that Python supporting 
thread.

etc. etc.

especially the last two errors are confusing, suggesting that its getting the 
wrong version of python when in fact it 
just failed to import Python.h

configure should be able to spot this common problem and should fail to 
configure.

it took quite a while to go through all the documentation to find that I've 
simply missed installing python-dev.  this 
is mentioned in the 

http://code.google.com/p/modwsgi/wiki/InstallationIssues makes no mention of 
python-dev or what it is.

perhaps add something something like:

mod_wsgi requires the python-dev package which includes necessary header files 
for compiling against the Python 
language itself.

googling "python-dev" doesn't even find any page that simply states what it is. 
 then there is "python-devel" just to 
confuse us more.

thanks

Original issue reported on code.google.com by crucialf...@gmail.com on 16 Nov 2009 at 1:54

GoogleCodeExporter commented 8 years ago
The README file in the source code says:

"""If using a Python binary package for a Linux system, also ensure that the
you have the corresponding 'dev' package installed for the Python package
you have installed. Without this package you will be missing the Python
header files and configuration files need to build mod_wsgi."""

The page at:

http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide

says:

"""On Linux systems, if Python has been installed from a package repository, 
you must have installed the 
corresponding Python "dev" package as well."""

I can add a more in depth section to:

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

but adding a check in the 'configure' script is a bit more work. Simplest thing 
can do is to change mod_wsgi.c 
so additional error message comes out at compile time. Thus code would change 
from:

#if !defined(PY_VERSION_HEX) || PY_VERSION_HEX <= 0x02030000
#error Sorry, mod_wsgi requires at least Python 2.3.0 for Python 2.X.
#endif

to:

#if !defined(PY_VERSION_HEX)
#error Sorry, Python developer package does not appear to be installed.
#endif

#if PY_VERSION_HEX <= 0x02030000
#error Sorry, mod_wsgi requires at least Python 2.3.0 for Python 2.X.
#endif

Could possibly do a similar thing for Apache. A common variable for both Apache 
1.3 and 2.X appears to be 
HTTPD_ROOT, so could use:

#if !defined(HTTPD_ROOT)
#error Sorry, Apache developer package does not appear to be installed.
#endif

Original comment by Graham.Dumpleton@gmail.com on 16 Nov 2009 at 10:33

GoogleCodeExporter commented 8 years ago
Added documentation to:

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

Changes to mod_wsgi source code will need to wait until after mod_wsgi 3.0 
released and not making further 
changes at this time.

Original comment by Graham.Dumpleton@gmail.com on 16 Nov 2009 at 10:44

GoogleCodeExporter commented 8 years ago
that looks great. that was the first page I went to, and that would've solved 
it for me.  

hope it helps others

Original comment by crucialf...@gmail.com on 16 Nov 2009 at 11:01

GoogleCodeExporter commented 8 years ago
Checks add in revision 1491 of trunk for mod_wsgi 3.1.

Original comment by Graham.Dumpleton@gmail.com on 23 Nov 2009 at 10:43

GoogleCodeExporter commented 8 years ago
3.1 was released a while back.

Original comment by Graham.Dumpleton@gmail.com on 18 Dec 2009 at 10:29