Could you contribute to SWIG?
SWIG is an all volunteer project which has been publicly available since 1996 and is only as good as it is because of free software collaboration.
There are many warts though and so
we are always looking for people to help out with various aspects of SWIG development.
This can be anything from improving functionality in the SWIG source code or typemaps to writing documentation.
Development versions of SWIG are available through a Git repository hosted
There is also a Subversion (SVN) interface provided by Github.
The Git release represents work in progress and is not guaranteed to compile on your machine or be functional in any
However, it is often in better shape than the last official release!
To compile SWIG from the raw source available from Git, you will need the following tools:
- Either Git or Subversion
- Autoconf 2.58 or higher
- Automake 1.7.2 or higher
- A working C and C++ compiler.
- yacc or bison (to compile the SWIG parser).
- libpcre (regular expressions library dependency)
It is important to note that the Git repository does not include the C++ code
generated by yacc nor the files produced by Autoconf or Automake or the documentation
that is generated. These are however included in a normal release. Thus, you will have
to install the above tools on your machine for everything to work.
To build the latest version
generic Git help
available from Github, but the steps below should be all you need to get going quickly.
However, Windows users should also look at the Building swig.exe on Windows.
Note: The Git repository is read-only so the system will not
accept code modifications unless you are a registered SWIG developer.
If you would like to see your modifications in the official SWIG distribution, you can
fork the repository
and send a pull request
or submit a patch to the patch tracker.
The latest development (master) version of SWIG can be retrieved using:
$ git clone https://github.com/swig/swig.git
You can also use Github as if it was a Subversion server, see Collaborating on GitHub with Subversion.
The following should get you going with the latest:
$ svn checkout https://github.com/swig/swig/trunk swig
To build the system, follow these steps
$ cd swig
$ ./configure --prefix=/some/directory
$ make install
To check the build, run the tests:
$ make -k check
This could take up to an hour or longer. If you are interested in a particular language,
just check the examples and test-suite for that language. For example, the Python tests:
$ make check-python-examples
$ make check-python-test-suite
More details on the SWIG test-suite are available.
Here are some guidelines should you be experiencing problems building SWIG from Git.
If you are still having problems, send an email to the swig-devel mailing list.
- Check that you have a complete update from the SWIG Git repository.
A fresh checkout from Git often solves build problems.
Make sure you have run ./autogen.sh and ./configure.
Both these steps will be necessary if you have a fresh Git checkout or if the build files in the repository have changed since a previous update.
Check that the appropriate versions of your autotools (Autoconf and Automake) are installed properly.
The autotools are in a state of flux and there are backward compatibility issues which are solved in different ways on different operating systems.
Check that all the autotool bootstrap programs which are executed when running ./autogen.sh are up to date and match your installed autotool versions.
For example aclocal --version should report a matching version of Automake or Autoconf, something like "aclocal (GNU automake) 1.7.6".
Feedback and questions concerning this site should be posted to the swig-devel mailing list.
Last modified : Thu Dec 17 01:39:04 2015