Windows installer for matplotlib-toolkits basemap

Dear matplotlib-users, I have made an application for

    > tsunami wave travel time prediction (slowmo.sf.net). The
    > application uses the basemap toolkit and is developed on
    > Linux. I would like to offer potential Windows users an
    > easier way to install and test it than is currently
    > available.

    > For this I would need a binary windows package of the
    > basemap toolkit in a newer version than 0.21 which is
    > currently available. Unfortunately I do not have access to
    > the windows compilers that are necessary to make this
    > binary package. I would therefore be very grateful if
    > anyone from this list has the binary or could easily
    > produce it.

I will try and get this done on Monday.

Note that setting up a free win32 build environment using mingw is
not very difficult. Here are my notes for setting it up -- replace any
version numbers with the most recent

== Required setup ==

  * Download MinGW-3.1.0-1.exe and MSYS-1.0.10.exe from
    MinGW - Minimalist GNU for Windows - Browse /Other at SourceForge.net
    and install both in C:\MinGW

  * Download pexports-0.42h
    from http://starship.python.net/crew/kernr/mingw32/pexports-0.42h.zip
    and extract it to C:\Program Files\pexports-0.42h

For compiling C++ extensions under mingw, I found I needed to patch
c:/Python23/Lib/distutils/cygwinccompiler.py to work with g++. Find
the set_executables part and change it to

        self.set_executables(compiler='gcc -mcygwin -O -Wall',
                             compiler_cxx='g++ -mcygwin -O -Wall',
                             compiler_so='gcc -mcygwin -mdll -O -Wall',
                             linker_exe='gcc -mcygwin',
                             linker_so=('%s -mcygwin %s' %
                                        (self.linker_dll, shared_option)))

The compiler_cxx is where the change is.

For Python2.4 there is another oneline change you must make; see
os.walk bug?.
You must comment out

               #self.dll_libraries = ['msvcr71']

== THE BUILD ==

Execute the following profile batch file to setup path and
environment variables

  SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;c:\Python23;c:\mingw\bin;c:\mingw\mingw32\bin;c:\msys\1.0\bin
  set LDD=gcc
  set CC=gcc
  set CXX=g++
  set CFLAGS=-mms-bitfields

Execute the command below, changing the version numbers for other
pythons

  copy c:\windows\system32\python24.dll .
  c:\progra~1\pexports-0.42h\bin\pexports python24.dll > python24.def
  c:\MinGW\bin\dlltool --dllname python24.dll --def python24.def --output-lib libpython24.a

  copy libpython24.a c:\python24\libs
  del python24.dll
  del libpython24.a

Build the python binary installer for the package of your choice

  python setup.py build --compiler=mingw32 bdist_wininst --install-script postinstall.py

JDH

I'm getting a traceback when trying to run tex_demo.py under Windows (both Win98 and Win2k).
I *think* I've met the specified requirements.
Any help would be appreciated,
thanks,
Gary R.

Here's a dump with debug-annoying set:

loaded rc file C:\PYTHON23\share\matplotlib\.matplotlibrc
matplotlib version 0.82
verbose.level debug-annoying
interactive is False
platform is win32
loaded modules: ['__future__', 'copy_reg', 'sre_compile', 'distutils', 'locale', '_sre', '__main__', 'site', '__builtin__', 'datetime', 'encodings', 'os.path', 'encodings.encodings', 'sre_constants', 'distutils.string', 'dateutil', 'matplotlib.datetime', 'strop', 'matplotlib.warnings', 'encodings.codecs', 'matplotlib.sys', 're', 'ntpath', 'pytz.sys', 'UserDict', 'distutils.sysconfig', 'encodings.exceptions', 'nt', 'pytz.sets', 'stat', 'zipimport', 'string', 'warnings', 'encodings.types', '_codecs', 'distutils.os', 'matplotlib', 'encodings.cp1252', 'sys', 'pytz.tzinfo', 'pytz', 'pytz.datetime', 'matplotlib.__future__', 'codecs', 'distutils.re', 'matplotlib.pytz', 'types', 'matplotlib.dateutil', '_locale', 'matplotlib.os', 'sre', 'bisect', 'matplotlib.distutils', 'signal', 'distutils.errors', 'linecache', 'itertools', 'sets', 'exceptions', 'sre_parse', 'pytz.bisect', 'distutils.sys', 'os']
numerix Numeric 23.7
font search path ['C:\\PYTHON23\\share\\matplotlib']
trying fontname C:\PYTHON23\share\matplotlib\cmex10.ttf
trying fontname C:\PYTHON23\share\matplotlib\cmmi10.ttf
trying fontname C:\PYTHON23\share\matplotlib\cmr10.ttf
trying fontname C:\PYTHON23\share\matplotlib\VeraMono.ttf
trying fontname C:\PYTHON23\share\matplotlib\cmsy10.ttf
trying fontname C:\PYTHON23\share\matplotlib\VeraMoBI.ttf
trying fontname C:\PYTHON23\share\matplotlib\cmtt10.ttf
trying fontname C:\PYTHON23\share\matplotlib\Vera.ttf
matplotlib data path C:\PYTHON23\share\matplotlib
loaded ttfcache file C:\PYTHON23\share\matplotlib\.ttffont.cache
backend TkAgg version 8.4
FigureCanvasAgg.draw
RendererAgg.__init__
This is e-TeX, Version 3.141592-2.2 (MiKTeX 2.4)
entering extended mode
! Undefined control sequence.
<*> 'C:\PYTHON
23\share\matplotlib\.tex.cache\30565a8911a6bb487e3745c0ea3c822...

! Undefined control sequence.
<*> 'C:\PYTHON23\share
\matplotlib\.tex.cache\30565a8911a6bb487e3745c0ea3c822...

! Undefined control sequence.
<*> 'C:\PYTHON23\share\matplotlib
\.tex.cache\30565a8911a6bb487e3745c0ea3c822...

! I can't find file `'C:23.tex'.
<to be read again>
                    \global
<*> 'C:\PYTHON23\share\matplotlib\.
tex.cache\30565a8911a6bb487e3745c0ea3c822...
Please type another input file name
! Emergency stop.
<to be read again>
                    \global
<*> 'C:\PYTHON23\share\matplotlib\.
tex.cache\30565a8911a6bb487e3745c0ea3c822...

No pages of output.
Transcript written on texput.log.

Exception in Tkinter callback
Traceback (most recent call last):
   File "C:\PYTHON23\lib\lib-tk\Tkinter.py", line 1345, in __call__
     return self.func(*args)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 148, in resize
     self.show()
   File "C:\PYTHON23\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 151, in draw
     FigureCanvasAgg.draw(self)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\backends\backend_agg.py", line 369, in draw
     self.figure.draw(renderer)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\figure.py", line 498, in draw
     for a in self.axes: a.draw(renderer)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\axes.py", line 1361, in draw
     self.xaxis.draw(renderer)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\axis.py", line 544, in draw
     tick.draw(renderer)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\axis.py", line 147, in draw
     if self.label1On: self.label1.draw(renderer)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\text.py", line 847, in draw
     self._mytext.draw(renderer)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\text.py", line 334, in draw
     bbox, info = self._get_layout(renderer)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\text.py", line 179, in _get_layout
     w,h = renderer.get_text_width_height(
   File "C:\PYTHON23\Lib\site-packages\matplotlib\backends\backend_agg.py", line 237, in get_text_width_height
     Z = self.texmanager.get_rgba(s, size, dpi, rgb)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\texmanager.py", line 276, in get_rgba
     pngfile = self.make_png(tex, dpi, force=False)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\texmanager.py", line 113, in make_png
     dvifile = self.make_dvi(tex)
   File "C:\PYTHON23\Lib\site-packages\matplotlib\texmanager.py", line 105, in make_dvi
     shutil.move(dvitmp, dvifile)
   File "C:\PYTHON23\lib\shutil.py", line 170, in move
     copy2(src,dst)
   File "C:\PYTHON23\lib\shutil.py", line 82, in copy2
     copyfile(src, dst)
   File "C:\PYTHON23\lib\shutil.py", line 37, in copyfile
     fsrc = open(src, 'rb')
IOError: [Errno 2] No such file or directory: '30565a8911a6bb487e3745c0ea3c8224.dvi'

Oops - sorry about the subject line :frowning:
Gary