PyGSL: Information for distributors
Author: Pierre Schnizer
Keywords: numeric, scientific, python, extension, module, GNU, library

# Information for Distributors

The information given here is intended for people distributing pygsl as well as for people who are not afraid to run code generation tools in case pygsl generates trouble.

## Preferable array module

The numpy array module should be the first choice these days.

## Wrapper generated modules

The following modules are generated by the SWIG wrappers:

- _block
- _callback
- gslwrap
- hankel
- _poly

In case on of these modules shows a compilation error, just delete the corresponding file in the swig_src directory (e.g. swig_src/poly_wrap.c if for the poly module.). Set the variable `USE_SWIG` to `1` in the `setup.py` file. Run the build process again. Now setup.py should call swig and rebuild the module wrappers.

## Dedicated wrappers

Some modules come with their own wrapping tools which are implemented in python.

### The const module

Change into the src directory. Define the shell variable `PYGSL_GSLCVS` variable, so that it either points to the GSL CVS repository or to the include directory of your GSL installation (typically /usr/include on a linux installation). Then type `python ../tools/constants_tool.py` This will generate the files `const_m_array.c` `const_num_array.c` `const_cgsm_array.c` `const_mksa_array.c`

### The special function module

PyGSL comes with two implementations for the special functions. The sf and the testing.sf module. The first one was the first implementation, while the later one wraps the special functions as Numeric or numpy UFuncs. The UFunc module will eventually replace the sf module.

Generating the wrapper has not been automatized yet. First swig is used to parse the header files and dump them into xml and then a specialized wrapper reads this tree and writes the wrappers.

This involves the following steps:

- Change into the directory `testing/tools`
- Run `swig -python -I -xml swig_test.i` So on a linux machine this is typically `swig -python -I/usr/include -xml swig_test.i`
- Change into the directory `testing/src/sf`
- Run the wrapper generator using `python ../../tools/sf_functions.py`
- Run the build process. Set `BUILD_TESTING = 1` in the setup.py file. If required update the time stamp of the file `testing/src/sf/sfmodule_testing.c`. This will build the module `_ufuncs`.

The functions not wrapped automatically are defined in the list `exclude_list` in the file `sf_functions.py`.