[mod_python] mod_python & Leopard

Nilesh Govindrajan admin at itech7.com
Tue Mar 18 02:49:19 EDT 2008


Brian wrote:
> Graham ::
>
> I thought that I was using the Python that came with the OS, obviously from your comments I am not.  I re-ran configure
>
> #./configure --with-python=/usr/bin/python   ....     then a make .....      below are the results ::
>
> sh-3.2# ./configure --with-python=/usr/bin/python
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables... 
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ANSI C... none needed
> checking for ar... ar
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether make sets $(MAKE)... yes
> checking for main in -lm... yes
> checking for an ANSI C-conforming const... yes
> checking your blood pressure... a bit high, but we can proceed
> configure: checking whether apxs is available...
> checking for apxs2... no
> checking for apxs... /usr/sbin/apxs
> checking Apache version... 2.2.6
> checking for Apache libexec directory... /usr/libexec/apache2
> checking for Apache include directory... -I/usr/include/apache2
> checking for --with-python... /usr/bin/python
> checking Python version... 2.5
> checking for --with-python-src... no
> checking for --with-mutex-dir... no
> Using MUTEX_DIR /tmp
> checking for --with-max-locks... no
> Using 8 MAX_LOCKS.
> checking for --with-flex... no
> checking for flex... /usr/bin/flex
> found /usr/bin/flex, we'll use this. Use --with-flex to specify another.
> checking flex version... 2.5.33. Good
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: creating src/Makefile
> config.status: creating Doc/Makefile
> config.status: creating src/include/mod_python.h
> config.status: creating test/Makefile
> config.status: creating test/testconf.py
> config.status: creating dist/setup.py
> config.status: creating dist/Makefile
> sh-3.2# make
>
> Please edit Makefile and set PYTHON_SRC to where Python sources are.
>
> make: *** [src_set] Error 1
>
>
> B
>
>
>
> ---- Graham Dumpleton <graham.dumpleton at gmail.com> wrote: 
>   
>> Please use reply-all and keep discussion on mailing list. Do not reply
>> to just me.
>>
>> On 18/03/2008, Brian <brianlong at cox.net> wrote:
>>     
>>> Graham ::
>>>
>>>  Went into ./src folder and ran make.... now get the following result ::
>>>       
>> The instructions don't say to go into the 'src' directory. Why are you
>> doing that? The build and install should be done from the root
>> directory.
>>
>>     
>>>  Compiling for DSO.
>>>
>>>  /usr/sbin/apxs -I/Users/brian/Downloads/mod_python_trunk/src/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -DNDEBUG -Wc,'-arch ppc7400' -Wc,'-arch ppc64' -Wc,'-arch i386' -Wc,'-arch x86_64' -c mod_python.c _apachemodule.c requestobject.c tableobject.c util.c serverobject.c connobject.c filterobject.c hlist.c hlistobject.c finfoobject.c -arch ppc7400 -arch ppc64 -arch i386 -arch x86_64 -Wl,-F/Library/Frameworks -framework Python -u _PyMac_Error  -ldl
>>>  /usr/share/apr-1/build-1/libtool --silent --mode=compile gcc    -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp  -I/usr/include/apache2  -I/usr/include/apr-1   -I/usr/include/apr-1  -arch ppc7400 -arch ppc64 -arch i386 -arch x86_64 -I/Users/brian/Downloads/mod_python_trunk/src/include -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -DNDEBUG  -c -o mod_python.lo mod_python.c && touch mod_python.slo
>>>  In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:57,
>>>                  from /Users/brian/Downloads/mod_python_trunk/src/include/mod_python.h:80,
>>>                  from mod_python.c:28:
>>>  /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:730:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
>>>  In file included from /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/Python.h:57,
>>>                  from /Users/brian/Downloads/mod_python_trunk/src/include/mod_python.h:80,
>>>                  from mod_python.c:28:
>>>  /Library/Frameworks/Python.framework/Versions/2.5/include/python2.5/pyport.h:730:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
>>>  mod_python.c: In function 'python_init':
>>>  mod_python.c:826: warning: initialization from incompatible pointer type
>>>  mod_python.c: In function 'python_init':
>>>  mod_python.c:826: warning: initialization from incompatible pointer type
>>>  mod_python.c: In function 'python_init':
>>>  mod_python.c:826: warning: initialization from incompatible pointer type
>>>  mod_python.c: In function 'python_init':
>>>  mod_python.c:826: warning: initialization from incompatible pointer type
>>>  lipo: can't figure out the architecture type of: /var/folders/kR/kRbwQrcTHXWDKQTg-5pcGE+++TI/-Tmp-//cclvLoaY.out
>>>  apxs:Error: Command failed with rc=65536
>>>       
>> Don't use MacPorts Python, use Python 2.5 that comes supplied with the
>> operating system. I said that in last email.
>>
>> The MacPorts Python 2.5 appears to be broken when it comes to building
>> fully fat binaries for all architectures.
>>
>> You may be able to get it to work by edit src/Makefile and
>> dist/setup.py and removing the arch flags for whatever architecture it
>> is that MacPorts doesn't work properly for. If you work out which
>> architecture it is then please tell me as one other person I have seen
>> with this problem didn't tell me.
>>
>> BTW, make sure you have up to date MacPorts Python if you insist on
>> using it. This problem may occur where you have installed MacPorts
>> Python on Tiger and then upgraded to Leopard.
>>
>> Graham
>>
>>  .
>>     
>>>  make: *** [mod_python.so] Error 1
>>>
>>>
>>>
>>>  B
>>>
>>>
>>>
>>>
>>>  ---- Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
>>>
>>>       
>>>> Try mod_python from subversion source repository. See:
>>>>         
>>>  >
>>>  >  http://www.modpython.org/pipermail/mod_python/2008-March/024954.html
>>>  >
>>>  > Graham
>>>  >
>>>  > On 18/03/2008, Brian <brianlong at cox.net> wrote:
>>>  > > Have read many posts on the internet and I can not get mod_python running on my Mac.
>>>  > >
>>>  > >  I am getting the following error ::
>>>  > >
>>>  > >  httpd: Syntax error on line 95 of /private/etc/apache2/httpd.conf: Can't locate API module structure `python_module' in file /usr/libexec/apache2/mod_python.so: dlsym(0x100204600, python_module): symbol not found
>>>  > >
>>>  > >
>>>  > >  I am using MacOSX Leopard 10.5.2
>>>  > >  Apache 2.2.6
>>>  > >  Python 2.5
>>>  > >
>>>  > >  ./src/Makefile
>>>  > >
>>>  > >  LDFLAGS= -Wl,-framework,Python  -u _PyMac_Error $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) -arch ppc -arch ppc64 -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g
>>>  > >  OPT=
>>>  > >  CFLAGS=$(OPT) $(INCLUDES) -Wc,"-arch ppc" -Wc,"-arch ppc64" -Wc,"-arch i386" -Wc,"-arch x86_64"
>>>  > >  srcdir=.
>>>  > >
>>>  > >  SRCS=   mod_python.c _apachemodule.c requestobject.c tableobject.c util.c \
>>>  > >                 serverobject.c connobject.c filterobject.c hlist.c \
>>>  > >                 hlistobject.c finfoobject.c
>>>  > >
>>>  > >  all:    dso
>>>  > >
>>>  > >  psp_parser.c: psp_parser.l
>>>  > >         @rm -f psp_parser.c
>>>  > >         $(LEX) -R -opsp_parser.c --header-file=include/psp_flex.h psp_parser.l
>>>  > >
>>>  > >  dso:    mod_python.so
>>>  > >         @echo dso > .install
>>>  > >
>>>  > >  mod_python.so: $(SRCS)
>>>  > >         @echo
>>>  > >         @echo 'Compiling for DSO.'
>>>  > >         @echo
>>>  > >         $(APXS) $(INCLUDES) -c -Wc,"-arch x86_64" $(SRCS) $(LDFLAGS) $(LIBS)
>>>  > >         @rm -f mod_python.so
>>>  > >         @ln -s .libs/mod_python.so mod_python.so
>>>  > >
>>>  > >  RESULT OF file /usr/libexec/apache2/mod_python.so
>>>  > >
>>>  > >  /usr/libexec/apache2/mod_python.so: Mach-O universal binary with 3 architectures
>>>  > >  /usr/libexec/apache2/mod_python.so (for architecture i386):     Mach-O bundle i386
>>>  > >  /usr/libexec/apache2/mod_python.so (for architecture ppc):      Mach-O bundle ppc
>>>  > >  /usr/libexec/apache2/mod_python.so (for architecture x86_64):   Mach-O 64-bit bundle x86_64
>>>  > >
>>>  > >  When I do a 'Get Info' on /usr/src/httpd, the kind is listed as 'Universal'
>>>  > >
>>>  > >  Thanx for any help
>>>  > >  B
>>>  > >
>>>  > >
>>>  > >
>>>  > >  _______________________________________________
>>>  > >  Mod_python mailing list
>>>  > >  Mod_python at modpython.org
>>>  > >  http://mailman.modpython.org/mailman/listinfo/mod_python
>>>  > >
>>>
>>>
>>>       
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>   
Dude, do you have Python development libraries installed ?? If not, 
install them.


More information about the Mod_python mailing list