SWIG image
Home Github Development Mailing Lists Bugs and Patches
Information
What is SWIG?
Compatibility
Features
Tutorial
Documentation
News
The Bleeding Edge
History
Guilty Parties
Projects
Legal Department
Links
Download
SwigWiki
Survey
Donate
Affiliations
Software Freedom Conservancy logo
Our Generous Host
Get SWIG at SourceForge.net. Fast, secure and Free Open Source software downloads
Exits
C# - Mono
C# - MS .NET
D
Go language
Guile
Java
Javascript - Node.js
Javascript - Node-API
Javascript - V8
Javascript - WebKit
Lua
MzScheme/Racket
OCaml
Octave
Perl
PHP
Python
R
Ruby
Scilab
Tcl/Tk

Bleeding Edge

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.
  • 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. There is also a Subversion (SVN) interface provided by 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:
  • Either Git or Subversion
  • Autoconf 2.58 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).
  • libpcre (regular expressions library dependency)

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.
  1. 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
    
  2. 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
    
  3. 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: 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.

Build Issues

Here are some guidelines should you be experiencing problems building SWIG from Git.
  1. Check that you have a complete update from the SWIG Git repository. A fresh checkout from Git often solves build problems.
  2. 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.
  3. 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.
  4. 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 concerning this site should be posted to the swig-devel mailing list.

Last modified : Sun Dec 31 00:03:27 2023