Numeric Pointer Module

Written by: Rodrigo Caballero Augi (,
Updated: Christian Dieterich (,
Packaged: Michael Steder (
Department of Geophysical Sciences, University of Chicago


The Numeric Pointer module (NumPtr) is a SWIGable module that makes it possible to access data stored in Numeric arrays as if they were normal C/C++ arrays( declared type name[][]; ).

NumPtr was developed to make it possible to work with SWIG'ed C or Fortran climate codes from Python.

This package is also a good example of how to write C extensions for Python that manipulate arrays.

Getting the Module

You can download the current version of the module here:


This package was most recently tested with Python 2.3.3, GCC 3.4.1, and SWIG 1.3.21.

Compiling NumPtr

To compile NumPtr you simply have to invoke distutils build process: ( $ represents the command prompt )

Installing NumPtr

To install NumPtr with administrative privileges you must invoke distutils with the "install" option:

To install NumPtr into a different directory then the standard or to install it into a home directory (for non-administrators), you can set the "--prefix" or "--install-base" options when calling For instance.

Alternatively you can simply copy the files from build/lib.ARCH (where ARCH is your machines python version and operating system(kernel) version) to your chosen install location.

Using the Module

Getting Help

The Climate Systems Group @ U of C maintains a Wiki community site, if you have questions or comments about the Numeric Pointer module please ask there: