Building Numeric 24.2 and pygist 1.5.28 on Windows 7 for Python 2.7 built with MSVS

by Helge Avlesen

Important: my Windows is 64-bit, but gcc, Python etc is 32-bit. You will need a recent MinGW gcc, personally I use the 2.7.1 version from "equation.com", but any recent Mingw should be fine.

Download the source code, I provide them here for convenience, I think these are the original packages:

pygist-1.5.28.tar.gz

Numeric-24.2.tar.gz

First I had to modify Python distutils. This is in the file Lib/distutils/cygwinccompiler.py in the Python install dir, the default location is C:\Python27. Find the mingw32compiler class and remove all occurences of the flag "-mno-cygwin".

Numeric Python

Unpack the archive above (use e.g. the free and excellent tool from www.7-zip.org). In the file setup.py where they check if sys.platform is "win32" find the line
    umath_define_macros = [('HAVE_INVERSE_HYPERBOLIC', '0')] 
change the 0 to 1. Decide where to install Numeric, I chose to put it in a directory called C:\num24.2pygist1.5.28 When done and assuming gcc and python is properly installed, Numeric should build and install with the command
  python setup.py install --prefix=C:\num24.2pygist1.5.28

Pygist

Unpack archive as above. First find the file setup.py. Approximately at line 858 add the include dir for Numeric if it is installed in a non std location, like the above steps (note the use of slash instead of backslash):
   include_dirs = [ 'src/gist', 'src/play', 'src/play/win', 'c:/num24.2pygist1.5.28/include' ]
Next file to change is "src\play\win\playw.h" at line 60. Not sure what is correct to do here yet, but commenting out the line with "extern void..." like this
  /* if set non-zero, p_abort will call this */ 
  //extern void (*w_abort_hook)(void);
should make the build and install command
  python setup.py install --prefix=C:\num24.2pygist1.5.28
work just fine. After setting the environment variables as described on here, and commenting out the calls to gist.winkill in the file gistdemolow.py, it should be possible to test the installation like this
C:\>python
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gistdemolow
>>> gistdemolow.run()
         Pygist Comprehensive Graphics Test

This test suite is similar, but not exactly the same as yorick's grtest

Each frame will be described at the terminal.
Compare what you see with the description, then
hit  to see the next test, or q  to quit.

Test 1:  Commands: window (0, wait=1, dpi=75); plg([0, 1])
A small (75 dpi) window with line marked A from (1,0) to (2,1).

Test 2:  Commands: plg([0,1])
A large (100 dpi) window with line marked A from (1,0) to (2,1).

Test 3:  Commands: plg([1, 0])
Added line marked B from (1,1) to (2,0) to previous plot.

...

Test 26:  Lissajous animation
First run without animation mode
Second run with animation mode
Press RETURN to continue
....