|
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.
Read the contributing guide before opening a pull request.
It covers building from Git, testing, CI etiquette and contributions made with the help of AI tools, which are welcome.
Send email to the swig-devel (SWIG Developers) mailing list
if you are interested in getting involved in development.
We'd love to hear some background knowledge and information about yourself and we can help you getting started.
SWIG Source
Development versions of SWIG are available through a Git repository hosted
at Github.
Disclaimer
The Git release represents work in progress and is not guaranteed to compile on your machine or be functional in any
manner.
However, it is often in better shape than the last official release!
Required Tools
To compile SWIG from the raw source available from Git, you will need the following tools:
- Git
- Autoconf 2.64 or higher
- Automake 1.7.2 or higher
- A working C and C++ compiler.
- Bison 3.5.0 or higher (to generate the SWIG parser).
- PCRE2 (regular expressions library dependency, not needed when configured with --without-pcre)
The Getting Started page on the SWIG wiki lists the
packages to install on popular operating systems.
It is important to note that the Git repository does not include the C code
generated by Bison 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
There is
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.
The latest development (master) version of SWIG can be retrieved using:
$ git clone https://github.com/swig/swig.git
If you would like to contribute, fork the repository on Github first and clone your fork instead.
To build SWIG, follow the steps below and replace /some/directory with a directory that you have permission to write to:
$ cd swig
$ ./autogen.sh
$ ./configure --prefix=/some/directory
$ make
$ 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.
Note: If you would like to see your modifications in the official SWIG distribution,
send a pull request from your fork
as described in the contributing guide.
Please run the test suite locally first and then on your own fork's GitHub Actions, as each push to a pull request runs
about 200 CI jobs that the whole project shares.
Build Issues
Here are some guidelines should you be experiencing problems building SWIG from Git.
- 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".
If you are still having problems, send an email to the swig-devel mailing list.
Feedback and questions regarding this website as well as patches for improvement should be raised on the SWIG www Github project.
Last modified : Wed Oct 28 18:55:33 2026
|