How to install a newer version of SWIG

SWIG (the Simplified Wrapper and Interface Generator) is used by some packages to easily generate bindings to programming languages (e.g., Python).

These instructions are for installing SWIG version 3.0.5 from source:

[server]$ mkdir ${HOME}/soft
[server]$ cd ${HOME}/soft

Download and extract the package

[server]$ wget
[server]$ tar xvzf swig-3.0.5.tar.gz
[server]$ cd swig-3.0.5

If you're using the Unix Groups setup, configure using:

[server]$ ./configure --prefix=${RUN}

Otherwise, and assuming you've followed the virtualenv directions, configure using:

[server]$ ./configure --prefix=$HOME --with-perl5=/usr/local/bin/perl --with-python=$HOME/opt/python-2.7.7/bin/python  --with-ruby=/usr/bin/ruby

Compile and verify

[server]$ make
[server]$ make check

You might get some errors about ocaml. These don't matter (unless you intend to use this version of SWIG to generate ocaml bindings too.

[server]$ make install

See also