Compiling MPL with WXAgg

Hi all (particularly John),

I just compiled mpl on Linux Fedora core 4 with wxAGG support. In doing so, I got tripped up, for a little bit, with wx-config.

Once I figured it out, I ended up re-arranging the build_wxagg function a bit, just so that more meaning full error messages are likely.

The big difference is that even if WXAgg is on auto, you still get the message about wx-config. Here's my version of build_wxagg, and I've enclosed the whole file if you want to diff it. Perhaps you'd like to role these changes in.


def build_wxagg(ext_modules, packages, numerix, abortOnFailure):
     global BUILT_WXAGG
     if BUILT_WXAGG:

     wxconfig = find_wx_config()

     # Avoid aborting the whole build process if `wx-config' can't be found and
     # BUILD_WXAGG in is set to "auto"
     if wxconfig is None:
         print """
WXAgg's accelerator requires `wx-config'.

The `wx-config\' executable could not be located in any directory of the
PATH environment variable. If you want to build WXAgg, and wx-config is
in some other location or has some other name, set the WX_CONFIG
environment variable to the full path of the executable like so:

export WX_CONFIG=/usr/lib/wxPython-
         if not abortOnFailure:
             print """Building MPL without wxAgg"""
             BUILT_WXAGG = True
     elif not check_wxpython_headers(wxconfig):
         print 'WXAgg\'s accelerator requires the wxPython headers.'

         if not abortOnFailure:
             BUILT_WXAGG = True
             print """
The wxPython header files could not be located in any of the standard include
directories or include directories reported by `wx-config --cppflags'."""

     deps = ['src/_wxagg.cpp', 'src/mplutils.cpp', 'src/_transforms.cpp']

     module = Extension('matplotlib.backends._wxagg', deps)

     add_wx_flags(module, wxconfig)

     BUILT_WXAGG = True (26.1 KB)


Christopher Barker, Ph.D.
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception