py4science OSX installation problems

Hello OSX SVN MPL users

I am following the instructions on
http://ipython.scipy.org/moin/Py4Science/InstallationOSX
and ran into some trouble.

The computer is a 13" intel macbook,
OSX 10.5.2 installed fresh in December 2007

Everything went reasonably well until I got to matplotlib.
I ran into an architecture incompatibility:

** ld: warning [snip] missing required architecture ppc in file

My notes, along with various comments and links to error output etc,
are contained in this link:
  http://currents.soest.hawaii.edu/misc/mins_notes/py4science_anotes.html

Any comments and/or help would be appreciated.

Jules

The internal compiler error is something we are all running into right now. The only known fix is to run the build with the gcc flag “-Os” instead of “-O3”. You should be able to do this by setting the environment during your build:

CFLAGS=“-Os” python setup.py build

···

On Mon, Apr 21, 2008 at 8:24 PM, jules hummon <hummon@…202…> wrote:

Hello OSX SVN MPL users

I am following the instructions on

http://ipython.scipy.org/moin/Py4Science/InstallationOSX

and ran into some trouble.

The computer is a 13" intel macbook,

OSX 10.5.2 installed fresh in December 2007

Everything went reasonably well until I got to matplotlib.

I ran into an architecture incompatibility:

** ld: warning [snip] missing required architecture ppc in file

My notes, along with various comments and links to error output etc,

are contained in this link:

http://currents.soest.hawaii.edu/misc/mins_notes/py4science_anotes.html

Any comments and/or help would be appreciated.

Jules


This SF.net email is sponsored by the 2008 JavaOne(SM) Conference

Don’t miss this year’s exciting event. There’s still time to save $100.

Use priority code J8TL2D2.

http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I don't think he is getting the compiler error, but an architecture
error (ppc vs i386). Some combination of setting CFLAGS and LDFLAGS
as Charlie points out in his build notes at
http://ipython.scipy.org/moin/MatplotlibOSXBuildNotes may help (but
adding the -Os is probably needed to)

The following is working for me (using the macpython python and the
xcode freetype and libpng):

  500 export CFLAGS='-Os -arch i386 -arch ppc'
  501 export LDFLAGS='-arch i386 -arch ppc'
  506 export PKG_CONFIG_PATH="/usr/X11/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig"
  510 export PATH="/usr/local/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
  511 rm -rf build
  512 python setup.py build
  513 sudo python setup.py install
  514 python -c 'import matplotlib; print matplotlib.__file__'

You may need to make sure that you freetype and libpng are universal
as well -- if you are using the X11 ones as provided by apple you
should be fine, but if you are building them yourself make sure you
set the arch flags when building them, as Charlie describes in his
build notes.

···

On Tue, Apr 22, 2008 at 5:28 PM, Charlie Moad <cwmoad@...287...> wrote:

The internal compiler error is something we are all running into right now.
The only known fix is to run the build with the gcc flag "-Os" instead of
"-O3". You should be able to do this by setting the environment during your
build:

CFLAGS="-Os" python setup.py build

Alternatively, if you're only building this for your own use and not
for packaging a Universal Binary you want PowerPC users to be able to
use, you could simply eliminate the ppc arch flags in the Makefile
inside /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/

···

On Mon, Apr 21, 2008 at 5:24 PM, jules hummon <hummon@...202...> wrote:

Hello OSX SVN MPL users

I am following the instructions on
http://ipython.scipy.org/moin/Py4Science/InstallationOSX
and ran into some trouble.

The computer is a 13" intel macbook,
OSX 10.5.2 installed fresh in December 2007

Everything went reasonably well until I got to matplotlib.
I ran into an architecture incompatibility:

** ld: warning [snip] missing required architecture ppc in file

My notes, along with various comments and links to error output etc,
are contained in this link:
  http://currents.soest.hawaii.edu/misc/mins_notes/py4science_anotes.html

Any comments and/or help would be appreciated.

Jules

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Apologies for perhaps raising an old chestnut here.... but these
issues would not arise if we had separate intel and ppc MacPython
binaries.

George Nurser.

···

On 23/04/2008, Joshua Lippai <discerptor@...287...> wrote:

Alternatively, if you're only building this for your own use and not
for packaging a Universal Binary you want PowerPC users to be able to
use, you could simply eliminate the ppc arch flags in the Makefile
inside /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/

George Nurser wrote:

Apologies for perhaps raising an old chestnut here.... but these
issues would not arise if we had separate intel and ppc MacPython
binaries.

But all sorts of other issues would arise. The tricky bit to all of this is getting/building Universal versions of the various dependencies. I still have no idea why Apple doesn't just provide a few more common libs, like libpng and libfreetype (which is now included with X11, but as I understand it, that's an optional install). Anyway as we don't have any control over what Apples does (and even less control over what they have already not done!), we need other solutions:

My proposal:

We try to build a consensus among the MacPython community about a "standard" way to deal with common dependencies. There is now more-or-less a consensus that we should provide binaries for MacPython (and now 10.5's Apple python) that are statically linked against universal versions of all the dependencies. That works great, but the truth is that it's a pain in the $$%#@ to get those dependencies built right, so we've substantially raised the barrier for folks to build binary packages. Also, it seems a bit silly to separately deal with something like libpng for multiple packages. I think I've got at least four python extensions with libpng.

For example: Fredrik Lundh recently asked on the PIL list for recommendations as to what binaries he should provide for OS-X, and for someone to build them (he doesn't have a Mac). I set out to do it for him, and am still mired in dependency heck. Note that the key dependencies are the same as for Matplotlib (libpng, libfreetype)

My proposal for the "standard" way to provide the libs:

Kyng Chaos (William Kyngesburye)'s Frameworks:

http://www.kyngchaos.com/wiki/software:frameworks

He's got UnixImageIO, which provides libpng and others, and freetype, plus a bunch of others. They are all build as proper versioned OS-X frameworks, as well as a nice little hack where he puts soft links in to create a standard "unixy" hierarchy, so that they can be used by libs that don't understand frameworks.

Yes, it's a bit extra to tell folks to first install these two frameworks, then whatever the python package lib is, but I think it really would make it easier all around, particularly for package builders, and making things easier for package builders means that more binaries would be built properly, which would make things easier for users.

Note: William's Frameworks are all versioned properly, so there would be no harm in installing them multiple times, or having multiple versions installed. In fact, I think you could build a *.mpkg that had both your python package and the frameworks it needs, so that users would have a one download and one click install. It wouldn't hurt to have multiple packages with the same Frameworks installed this way.

Thoughts?

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...