I have a Mac!

In article
<CAKn7svqsEewsJDR2hyOx+Qwa0N+0ekknpU0fjQAivPaK4HM2fA@...150...>,

That is handy information. I'll start adding a python.org target.

How broad coverage do we want?
10.6, 10.7, 10.8
system, python.org (2.7, 3.3), brew, macports
virtualenv, no virtualenv
with/without third party X

The testing matrix blows up pretty quickly. For those of you with longer
memories, where are the corners where things tend to break?

That list looks reasonable to me, and I'm not sure how to whittle it
down, and it may need to grow. MacOS X 10.9 will be out soon and you may
also want to include fink.

I'm not quite sure what you mean by with/without third party X. If you
are referring to Tck/Tk:
- For Apple's python: I suggest testing both the built-in Tcl/TK and (if
you can) ActiveState Tcl/Tk, since anyone who really cares about Tcl/Tk
will probably not use the one provided by Apple (at least that was true
in older versions of MacOS X; I can't speak for 10.8).
- For python.org I think you only need to test with ActiveState Tcl/Tk.
- for homebrew, macports and fink, I'm not sure how many choices you
have; just one X11-based and one Aqua-based Tcl/Tk (if both are even
available)?

-- Russell

···

Matt Terry <matt.terry@...149...> wrote:

-matt

On Tue, Aug 20, 2013 at 12:09 PM, Russell E. Owen > <rowen@...748...> wrote:

> A few hints:
>
> If you just want to build matplotlib for your own computer (and don't
> care about making an installer that will work on anybody else's) then
> you can install from source with very little trouble:
> - You may want to edit setupext.py to limit searching to those dirs that
> really matter, but this is only needed if you have installed extras that
> might conflict.
> - You may want to edit setup.cfg to select a better default back end.
>
> You have to be much more careful if you want to build a binary installer
> that can be used by others. I've found that bdist_mpkg works, and I've
> found it is safest to build on the oldest platform I want the installer
> to support (for example /usr/X11/lib moved in 10.8 or 10.7 in a way that
> is forward but not backwards compatible).
>
> For Apple's python you need install anything; all you need is in
> /usr/lib and /usr/X11/lib. I have no idea if TkAgg works well.
>
> For python.org python you should install a version of Tcl/Tk. I suggest
> ActiveState Tcl/Tk 8.5.11. Be warned that versions 8.5.12, 8.5.12.1,
> 8.5.13 all have known crashing problems; I have not tried 8.5.14 (which
> came out fairly recently) as 8.5.11 seems to do well enough.
>
> I've cannot comment on building matplotlib for macports, fink or
> homebrew.
>
> – Russell
>
> In article <520E3818.8060009@…31…>,
> Michael Droettboom <mdroe@…31…>
> wrote:
>
> > We actually discussed this very issue yesterday in our Google hangout
> > about continuous integration. We're probably going to need to script a
> > full setup from a clean Mac + XCode to a working matplotlib development
> > environment in order to make that happen, and obviously that will be
> > shared with the world. Things are even more complex on Windows, and I'd
> > like to do that there, too. So stay tuned.
> >
> > Mike
> >
> > On 08/16/2013 10:02 AM, Paul Hobson wrote:
> > > Mike,
> > >
> > > That's great news. Is there any chance we can look forward to
> > > "official" instructions for setting up a Mac to develop matplotlib?
> > >
> > > I gave up a long time ago and started piecing to together my meager
> > > PRs in a linux VM.
> > > -paul
> > >
> > >
> > > On Fri, Aug 16, 2013 at 6:52 AM, Michael Droettboom > > > > <mdroe@…31… > > > > <mailto:mdroe@…31…>> wrote:
> > >
> > > Thanks to the gracious donation from Hans Petter Langtangen and the
> > > Center for Biomedical Computing at Simula
> > > (http://home.simula.no/~hpl <http://home.simula.no/~hpl>),
> > > I now have a new Mac Mini sitting at my desk. This should allow
> me to
> > > keep on top of changes that affect the Mac builds and to better
> track
> > > down Mac-only issues.
> > >
> > > Stay tuned over the next few weeks and months as we will most
> > > likely be
> > > using some more of these funds to pay for hosted continuous
> > > integration
> > > services (as discussed yesterday in our MEP19 Google Hangout).
> > >
> > > Cheers,
> > > Mike
>
>
>
> ----------------------------------------------------------------------------
> –
> Introducing Performance Central, a new site from SourceForge and
> AppDynamics. Performance Central is your source for news, insights,
> analysis and resources for efficient Application Performance Management.
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
---------------------------------------------------------------------
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk---
------------------------------------------------------------------
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

> with/without third party X
I'm not quite sure what you mean by with/without third party X. If you
are referring to Tck/Tk:

I had an issue where MPL found the headers to freetype in /opt/local, but
library in /usr/X11. Hilarity ensues. I *think* /usr/X11 showed up when I
installed XQuartz, but I don't have a clean image to compare against.

The with-X / without-X builds would be there to check that the default
search paths are compatible with common environments.

-matt

I’m banging away at installing MPL on top of python.org’s python. I’m at the libfreetype/freetype issue. There seems to be three approaches to getting MPL’s dependencies.

  1. install libpng[1] and freetype[2] from source

  2. install XQuartz[3] and twiddle /opt/X11, /usr/X11 (per Russell’s directions[4]) so MPL finds XQuartz’s libpng/freetype

  3. install XQuartz[3] and install pkg-config[5] so MPL can find the cleverly installed libraries

  4. create the MPL binary installer and use that

Option 1 seems simple-est, but installing freetype requires more than ./configure && make && sudo make install.

Option 2 worries me with the manual symlinking and such. Who knows what we’ll clobber.

Option 3: haven’t fully explored.

Option 4: This would require some input from whoever (Gohlke?, Owen?) makes the binary installers.

[1] http://www.libpng.org/pub/png/libpng.html
[2] http://www.freetype.org/index.html

[3] http://xquartz.macosforge.org/landing/

[4] http://www.astro.washington.edu/users/rowen/BuildingMatplotlibForMac.html
[5] http://www.freedesktop.org/wiki/Software/pkg-config/

···

On Thu, Aug 22, 2013 at 8:24 PM, Matt Terry <matt.terry@…149…> wrote:

with/without third party X

I’m not quite sure what you mean by with/without third party X. If you

are referring to Tck/Tk:

I had an issue where MPL found the headers to freetype in /opt/local, but library in /usr/X11. Hilarity ensues. I think /usr/X11 showed up when I installed XQuartz, but I don’t have a clean image to compare against.

The with-X / without-X builds would be there to check that the default search paths are compatible with common environments.

-matt

I’m a bit puzzled what you are trying to do. I’ve found that matplotlib “just builds” if I only want to use it on the Mac I’m building it on. Depending on what you’ve added to your Mac you may find you have to restrict the search dirs in setupext.py, but that’s all I have ever had to do for years.

For me the problems arise when trying to build a binary installer that runs on multiple versions of MacOS.

The following comments all deal with that case (making a binary installer):

I would eliminate (2) as an option; I thought it would help but it doesn’t (perhaps I need to update my matplotlib build instructions). The issue is that when I build a binary installer on 10.8, it cannot be used on 10.6 because it is looking for some libraries in /opt/X11 (which is where XQuartz is installed on 10.8) instead of /usr/X11 (which is where X11 is installed on 10.6). It’s only an issue for binary installers; I haven’t had any problem just building matplotlib for python.org python.

I have pretty much given up building binary installers on anything but the oldest version of MacOS X that they can be used on (or as close as I can get). I’ve just run into too many problems like this.

I like (1) for binary installers. It eliminates the need for a user to have installed X11 at all. The hassle is making sure matplotlib statically links these libraries. I’ve always done this by taking the crude approach of deleting the shared object libraries, leaving only the static libraries; it always worked in the past, but recently I ran into a problem where something I was building simply refused to use a static library (I don’t remember the details).

Regarding option [4]. You can get a binary installer for matplotlib 1.3 from here:

<http://www.astro.washington.edu/users/rowen/python/>

but it may clobber your python-dateutil and pytz (especially likely if they were installed by the matplotlib 1.2.1 binary installer). That’s the main reason it’s not an official binary installer.

– Russell

···

On Aug 23, 2013, at 8:14 AM, Matt Terry <matt.terry@…149…> wrote:

I’m banging away at installing MPL on top of python.org’s python. I’m at the libfreetype/freetype issue. There seems to be three approaches to getting MPL’s dependencies.

  1. install libpng[1] and freetype[2] from source
  1. install XQuartz[3] and twiddle /opt/X11, /usr/X11 (per Russell’s directions[4]) so MPL finds XQuartz’s libpng/freetype
  1. install XQuartz[3] and install pkg-config[5] so MPL can find the cleverly installed libraries
  1. create the MPL binary installer and use that

Option 1 seems simple-est, but installing freetype requires more than ./configure && make && sudo make install.

Option 2 worries me with the manual symlinking and such. Who knows what we’ll clobber.

Option 3: haven’t fully explored.

Option 4: This would require some input from whoever (Gohlke?, Owen?) makes the binary installers.

[1] http://www.libpng.org/pub/png/libpng.html
[2] http://www.freetype.org/index.html
[3] http://xquartz.macosforge.org/landing/

[4] http://www.astro.washington.edu/users/rowen/BuildingMatplotlibForMac.html
[5] http://www.freedesktop.org/wiki/Software/pkg-config/

Have you tried eliminating /opt from the search path in setupext.py? If that does the trick, I think we may be stuck. The default search paths are trying to work for default python, python.org python, macports and homebrew, plus user-built libraries in /usr/local. I’m not convinced one file can do it all. Apple moving X from /usr/X11 to /opt/X11 did not help.

Regards,

– Russell

···

with/without third party X

I’m not quite sure what you mean by with/without third party X. If you

are referring to Tck/Tk:

I had an issue where MPL found the headers to freetype in /opt/local, but library in /usr/X11. Hilarity ensues. I think /usr/X11 showed up when I installed XQuartz, but I don’t have a clean image to compare against.

The with-X / without-X builds would be there to check that the default search paths are compatible with common environments.

I'm banging away at installing MPL on top of python.org's python.

This is why binary installers are good idea!

the libfreetype/freetype issue.

yeah, that's kind of ugly....and where is doesn't "just work" for me...

1) install libpng[1] and freetype[2] from source

libpng and freetype are different, though install from source may be
the way to go:

libpng is there, but is not properly installed, I'm not sure it's got
the header for the same version as the lib, and libpng-config is
either not there or not for the right version or somethign ugly. It
look, form messages at build time, that someone has hacked some code
into the MPL build that figures all that out, but for other stuff I'm
doing, I just punt and build libpng -- that's pretty straighforward,
at least. But teh solution in the MPL code now seems to work.

2) install XQuartz[3] and twiddle /opt/X11, /usr/X11 (per Russell's
directions[4]) so MPL finds XQuartz's libpng/freetype

I _think_ that OS-X now ships with X11, which has freetype (though
installed weirdly once again...) we certainly should NOT expect people
to install anything big to build MPL, and binaries should not depend
on anything not shipped by Apple by default.

According to Russell, you do need to install something, so I think that's out.

4) create the MPL binary installer and use that

That's what most people should do -- but one of us needs to build it.

Option 1 seems simple-est, but installing freetype requires more than
./configure && make && sudo make install.

darn. But hopefully we can figure it out.

Option 4: This would require some input from whoever (Gohlke?, Owen?) makes
the binary installers.

I think Russell has been doing it for MPL lately.

My thoughts:

We want to support two user-bases:

1) folks that don't mind a little command line work, and probably need
other scientific libs, etc anyway, an want an MPL that runs on their
machine:
   - these folks should use homebrew or macports to build the
dependencies (or even hand-compile them). Ideally we have setup.py
that will find those libs, and test to see that the builds work once
in a while.

2) folks that "just want to use it" and/or want a binary they can
re-distribute via py2app, etc.
  - for these folks, we need to provide binaries. These binaries should:
   1) Match the python.org python builds. (probably only the Intel ones now...)
   2) statically link the non-sytem libs

This has been done for a while, off and on, most recently by Russell, AFAIK.

But this is not a problem unique to MPL. All sorts of python packages
need this, and only some of the package maintainers do it (well).
Also, a bunch of packages require the same dependencies (i.e. PIL and
MPL both need png and freetype)

So, rather than re-inventing the wheel over and over again, It would
be great to have a central repository where we can develop build
scripts, etc that share an infrustructure for building these binaries.

I've started one:

https://github.com/MacPython/mac-builds

there is not much there, only a couple things I'm working on at the
moment (netCDF4, which is of interest to scipy folks, and py_gd, which
is my own simple drawing lib, that no one else uses (yet?)

If anyone wants to join the project let me know -- if I know you from
your work with this community, I'll gladly add you.

I'm using the gattai build system:
(https://sourceforge.net/projects/gattai/). I decided to do that, as I
was sick of re-writing essentially the same build scripts, and I kept
adding features to mine that would have resulted in re-implementing
gattai anyway. I've been hacking at gattai, and its author is quite
open to moving it forward.

That being said, there is no reason that we need to use the same build
system -- we could easily have custom build scripts for a project, and
still have it share the dependencies.

I was planning on getting it all further along before announcing the
project and looking for help, but since is came up...

-Chris

···

On Fri, Aug 23, 2013 at 8:14 AM, Matt Terry <matt.terry@...149...> wrote:

--

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@...236...

Matt,

Thanks for looking into this! I had already planned to look into building on Travis' Mac facilities, so this is a huge timesaver.

Don't forget we also have Option 5 which is to do whatever it takes to automate some of these things within matplotlib's setup.py script itself. For example, I'm not opposed to detecting which Python we're running (which should be possible from various info available in sys) and then setting search paths accordingly. The pkg-config stuff is really handy on Linux and MacPorts where it's reliably there, but for other Mac environments, we probably should be less reliant on it.

Mike

···

On 08/23/2013 11:14 AM, Matt Terry wrote:

I'm banging away at installing MPL on top of python.org <http://python.org>'s python. I'm at the libfreetype/freetype issue. There seems to be three approaches to getting MPL's dependencies.

1) install libpng[1] and freetype[2] from source
2) install XQuartz[3] and twiddle /opt/X11, /usr/X11 (per Russell's directions[4]) so MPL finds XQuartz's libpng/freetype
3) install XQuartz[3] and install pkg-config[5] so MPL can find the cleverly installed libraries
4) create the MPL binary installer and use that

Option 1 seems simple-est, but installing freetype requires more than ./configure && make && sudo make install.
Option 2 worries me with the manual symlinking and such. Who knows what we'll clobber.
Option 3: haven't fully explored.
Option 4: This would require some input from whoever (Gohlke?, Owen?) makes the binary installers.

[1] http://www.libpng.org/pub/png/libpng.html
[2] http://www.freetype.org/index.html
[3] http://xquartz.macosforge.org/landing/
[4] http://www.astro.washington.edu/users/rowen/BuildingMatplotlibForMac.html
[5] http://www.freedesktop.org/wiki/Software/pkg-config/

On Thu, Aug 22, 2013 at 8:24 PM, Matt Terry <matt.terry@…149… > <mailto:matt.terry@…149…>> wrote:

        > with/without third party X
        I'm not quite sure what you mean by with/without third party
        X. If you
        are referring to Tck/Tk:

    I had an issue where MPL found the headers to freetype in
    /opt/local, but library in /usr/X11. Hilarity ensues. I *think*
    /usr/X11 showed up when I installed XQuartz, but I don't have a
    clean image to compare against.

    The with-X / without-X builds would be there to check that the
    default search paths are compatible with common environments.

    -matt

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and
AppDynamics. Performance Central is your source for news, insights,
analysis and resources for efficient Application Performance Management.
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk

_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel