[mod_python] OS X install mod_python w/o MacPorts

Graham Dumpleton graham.dumpleton at gmail.com
Mon Mar 3 20:33:44 EST 2008


On 04/03/2008, Wilden Mark <mark at mwilden.com> wrote:
> Very kind of you to take this trouble, Graham - thanks.
>
>  Yes, it's a recent (like one-month-old) MacBook Pro. The actual CPU
>  name is "Intel Core 2 Duo", which to my surprise is "64-bit capable".
>  Who knew? :)

Then you need to apply patches.

>  Since my root problem is with apr, I tried to build it, and apparently
>  was successful. However, I now have no idea what to do next. :)
>  MacPorts is still trying to build it before building mod_python.
>
>  So I'm going to take a big step back and try to learn how to build
>  stuff without MacPorts. Your instructions are a great starting point,
>  and again, I appreciate it very much!

Apply patches described in:

  http://www.modpython.org/pipermail/mod_python/2007-October/024394.html
  http://www.modpython.org/pipermail/mod_python/2008-January/024635.html

In summary, modify src/Makefile and add appropriate -arch and
-Wc,-arch options to CFLAGS and LDFLAGS. Also modify dist/setup.py.in
and add appropriate -arch options to PSPExtension class.

Would suggest making it full fat and add all architecture options. Ie., CFLAGS:

  -Wc,"-arch ppc" -Wc,"-arch ppc64" -Wc,"-arch i386" -Wc,"-arch x86_64"

in LDFLAGS:

  -arch ppc -arch ppc64 -arch i386 -arch x86_64

Similarly with setup.py.in.

Rerun configure after making changes.

Graham

>  Best,
>
>  ///ark
>
>
>  On Mar 3, 2008, at 4:56 PM, Graham Dumpleton wrote:
>
>  > On 04/03/2008, Wilden Mark <mark at mwilden.com> wrote:
>  >>> Now, as to whether you can get mod_python working without MacPorts
>  >>> or
>  >>> fink will depend on what version of MacOS X you are running. If
>  >>> using
>  >>> 10.4, can't be easily done unless you install Apache 2.2 yourself
>  >>> from
>  >>> source code. If using 10.5, can be done, but requires some manual
>  >>> changes to be made to makefiles if you are running with a 64bit
>  >>> Intel
>  >>> (maybe 64bit PPC as well) chip.
>  >>>
>  >>> Tell us what chip and OS version you are using and can be more
>  >>> specific about mod_python.
>  >>
>  >>
>  >> Thanks, Graham - your help is much appreciated! I'm running Mac OS X
>  >> 10.5.2 on an Intel 32-bit processor (MacBook Pro).
>  >
>  > Is that an old MacBook Pro? Recent ones have 64bit chip.
>  >
>  >> Of course, I have a
>  >> message posted on the macports-users list, as well as a cry for help
>  >> to the guy who convinced me to switch from Windows to OS X in the
>  >> first place. :)
>  >
>  > If you are running 10.5.2 on an Intel 32bit processor then you should
>  > be able to build mod_python from source tarball directly against the
>  > version of Apache and Python supplied with Leopard.
>  >
>  > Thus, fetch down tarball and unpack it. Then to make sure MacPorts
>  > isn't screwing things up by being found first, run configure as:
>  >
>  >  ./configure --with-python=/usr/bin/python --with-apxs=/usr/sbin/apxs
>  >
>  > then:
>  >
>  >  make
>  >  sudo make install
>  >
>  > Finally configure Apache to use mod_python.
>  >
>  > Do be aware though that if trying to run that same module, compiled as
>  > 32 bit, on a 64 bit chip running Leopard, you will still run into the
>  > problems talked about in that mod_wsgi on MacOS X document I pointed
>  > you to.
>  >
>  > Anyway, just try building it against standard OS Python and Apache and
>  > if there are problems get back to us.
>  >
>  > Graham
>  >
>
>


More information about the Mod_python mailing list