SWIG is being used in an increasing number of applications. Applications cover the broad spectrum of
open source projects, inhouse projects within corporations or organisations as well as commercial software projects.
Open source projects using SWIG
The following are some of the large number of open source projects which use SWIG.
These can be a useful reference for seeing how SWIG is used in real projects as the source is available.
Subversion Version control system.
PyOgre 3D graphics engine.
GDAL Geospatial Data Abstraction library.
Weave Scientific tools library.
Xapian Search Engine library.
PyOpenGL OpenGL graphics.
wxPython: A Python extension
module that encapsulates the wxWidgets GUI framework.
Tcl3D 3D libraries for use with Tcl/Tk.
Trilinos Parallel, matrix OO solver packages.
VSCP Very Simple Control Protocol - Automation software suite for TCP/IP, CAN, PLC and more.
OpenBabel Chemistry package, used in molecular modeling, computational chemistry, and many related areas
Python Ascend Python Interface for ASCEND.
ASCEND is both a large-scale object-oriented mathematical modeling environment and a strongly typed mathematical modeling language
library for quantitative finance with ports for C#, Guile, Java, MzScheme, Perl, Python, and Ruby.
GEOS: GEOS (Geometry Engine - Open Source) is a C++ port of the
Topology Suite with ports for Python and Ruby.
Ruby-VTK is an one-to-one wrapper of The Visualization ToolKit (VTK) for Ruby.
GNURadio: GNU Radio - The GNU Software Radio.
GNUCash: Personal and small-business financial-accounting software.
- X11::Wcl: A
Perl interface to the Widget Creation Library (Joe Buehler).
XML::Xerces is the Perl API to the Apache project's Xerces XML parser.
The main goal of Gramofile is putting the sound of for example
gramophone records on CDs, and includes a Perl port.
- Pivy:Coin3D (a high-level
3D graphics toolkit) binding for Python.
- Crystal Space 3D:
Crystal Space is a free (LGPL) and portable 3D Game Development Kit written in C++.
PKIF is a full-featured, standards compliant Public Key Infrastructure enablement library. Its goal is to make it easy for your applications to take advantage of your PKI.
- Open Cascade:
3D modeling & numerical simulation
Computational steering project - Python, Perl and Java wrappers.
Environment for building spatially-enabled internet applications - PHP, Python, Perl, Ruby, Java, and C# wrappers.
Toolkit for developing mapping applications for the desktop and web.
SHOGUN is a large scale machine learning toolbox with focus on especially Support Vector Machines.
Large image processing, computer vision, and machine learning library.
Contains SWIG-based bindings for mysql, postgres,
and ann bindings.
Embedded open source OS portable persistent Topic Maps engine
pureImage is a plug-in development framework that provides a common
plug-in interface, generic data structures, and a uniform workflow
managed by a runtime environment.
pureImage is specialized in image processing under C++. However,
pureImage can be used in different areas (due to its generic data types,
such as vectors, matrices, etc.), and in any programming language which
is supported by SWIG.
Open source implementation of the Web Services Management Specification (WS-Management).
CasADi is a minimalistic computer algebra system for numerical optimization implementing automatic differentiation in forward and adjoint modes by means of a hybrid symbolic/numeric approach.
- Kerberos GSS-API Java Interface and Kerberos Android NDK Sample Application:
Java GSS-API wrapper for the MIT Kerberos GSS-API (Computer network authentication protocol) library.
SWIG was used to help generate the Java GSS-API wrapper around the native MIT Kerberos libraries. Up to this point, the Android platform had lacked support for Kerberos.
Extensible feature-rich IRC bouncer.
Support for Perl and Python modules is done using SWIG.
- FEniCS (DOLFIN component):
The FEniCS Project is a collaborative project for the development of innovative concepts and tools for automated scientific computing, with a particular focus on automated solution of differential equations by finite element methods.
a suite of libraries for gravitational-wave data analysis, used by the LIGO Scientific Collaboration.
- GrammaTech blog about language bindings for CodeSonar: CodeSonar is a source code and binary code analysis tool that performs a whole-program, interprocedural analysis on C, C++, Java, and binary executables. It identifies programming bugs and security vulnerabilities in software.
- LORD MicroStrain Communication Library:
Communications library to to interact with LORD Microstrain's wireless and wired sensors.
A Graphical Universal Modeler library designed for easily building applications using graphical models such as Bayesian networks, influence diagrams, decision trees, GAI networks or Markov decision processes.
Other projects using SWIG
Below are some comments received on usage of SWIG by various organisations.
(Note : the
opinions expressed here do not necessarily reflect those of any
given employer or organization).
I am using SWIG to integrate four stand alone software packages into a
unified system controlled by Tcl/Tk scripts. The unified software
system is used to design and test defibrillation electrodes via
computer simulations of a human subject. The individual software
pieces include: a visualization package written in C++ using
OpenInventor and Motif, an unstructured mesh generator written in C, a
Finite Element Solver written in C, and a segmentation software
written in C++ using OpenGL and Motif. SWIG has been crucial to the
development of this project. With SWIG, the integration of the
individual pieces was trivial.
We are using swig with python to retrieve, analyze, and visualize very
large data sets from ocean model simulations on parallel computers.
We have written C routines that access our data. Graphics libraries
and Matlab are used to visualize the data. We are very happy with the
flexible, programmable, powerful tool that results.
Paradigm sells modular C toolkits for developing visual
simulation/virtual reality graphics applications called Vega and another
for spatial audio simulation called AudioWorks. I've used SWIG to wrap
Vega's and AW's APIs with Silicon Graphics' "sgitcl" to create "vgTcl"
and "awTcl". Exploiting the power of interactive scripting languages,
they provide the full power of the APIs at runtime, without an
application developer having to anticipate flexibility a priori. SWIG
has enabled our customers to interact with our toolkits in fundamentally
Several years ago (I believe we discussed this stuff way back in 1994
;-), I created a set of C preprocessor macros that did SWIG-like
things. It was a very tedious process, making it difficult to follow
changes to an evolving API, but it was useful for proof-of-concept.
When SWIG 1.1B1 came out in October, I was generously given a R&D budget
to reimplement my project in SWIG. The project has been a resounding
[We're using SWIG for] wrapping up engineering applications using
finite element method including pre- and post-processing. My program
is somewhat general and is used to solve problems for engineering
materials--metals, polymers and ice-- undergoing plastic (permanent)
deformations. It's mainly used for rapid prototyping, development and
testing. The code runs on workstations, Cray Y-MPs and Cray T3E (when
I get there... that is).
I have used SWIG to wrap an API that controlled two stepper motors and
a CCD camera on a Linux system that gathered real time image data. In
Windows, I wrapped an application's C++ API and used SWIG to embed a
Python (pywin) interpreter into the C++ application. I also used SWIG
to wrap a FORTRAN API that was used to read and write data into a
custom data base.
SWIG has allowed me to move the time critical code into C, C++, or
FORTRAN while having the application being controlled by Python. I
can quickly embed an interpreter into an application.
I'm using [SWIG] for a Perl scriptable version of Van Jacobson's libpcap
packet capture library. I can now use Perl regular expressions to
process packets on the fly. My main reason is to extract information
from ARP packets and automatically maintain our database of IP/MAC
address mappings directly from perl rather than hacking the output of
arpwatch or tcpdump.
[We are using SWIG for] wrapping C libraries to Python for speech recognition research
at ATR Interpreting Telecommunications Laboratories.
We are working in a multi-vendor environment (HP-UX, OSF1, Linux,
SunOS, Solaris) and writing new applications has become very tedious.
Therefore, we decided to employ python, but at the same time we would
like to have access to our signal processing libraries etc. that were
and are still written in C.
The advantages of using Python become more evident every day. For
example, it was fairly easy to write a GUI using python/tk. We are
using this now for interactive error analysis. A typical scenario is
- audio data is collected via microphone/AD (in Python) and sent to the
recognizer frame by frame.
- the recognizer (C code) makes a decision about speech endpointing and
once it has discovered end of utterance does a callback to the
application (python/tk) with a word lattice as result.
- this word lattice is now displayed for the user in python/tk.
- the user can now interactively rescore part of the lattices, look at
the detailed acoustic and language model scores, listen to parts of
the utterance, etc.
SWIG helps us in taking away part of the error-prone task of making
the C routines accessible from python and has considerably improved
I'm using SWIG to generate a perl5 API on top of HP's OpenCall TCAP
API. TCAP is the top protocol layer of HP's SS7 stack of telecom
protocol. The perl5 API development effort is a part of the systematic
testing approach we're implementing in the division.
The usual way was to write test programs
in C. The main drawback being that developing and running the tests
consumes a lot of time.
Now the goal is to write all (or at least most of) the test in perl
allowing a faster cycle time between modifying the API and testing
it. (We'll also be able to debug faster the test programs).
Perl's power also enables us to write test using oo methodology
(although the API is strictly procedural), thus we can easily develop
complex test scenarios.
Hopefully (i.e. if we have some spare time), the next step will be to
combine Tk with Perl and SWIG so we'll be able to monitor with a user
friendly interface the progress of the test suite.
Daniel Michelson (Daniel.Michelson@smhi.se)
A colleague and I are using SWIG for two purposes, both of which
centre around the creation of a Python-based environment for analysis
and visualization of data from the Swedish national weather radar
- interfacing old code
- interfacing new, performance critical, code.
We have a couple of other colleagues, also at SMHI R&D, who are working
in satellite-based remote sensing activities and who will be starting to
use SWIG in the near future for their purposes.
Thanks again for SWIG... Its fun, allows great productivity while
avoiding much tedium...
The current application (there will be many spin-offs/variations) is
in polarization microscopy. We manufacture electronically
controllable retarder plates, and along with a scientist at the
Marine Biological Lab in Woods Hole have developed an algo/method
that allows us to visualize a sample's retardance (direction and
magnitude) over the whole image. Conventional methods allow you to
see this structure only along one axis at a time... The main tools
I'm using are Python/Tkinter/PIL/NumPy/SWIG.
So, I've use SWIG to:
Our apps are running under Win95. I thought it was pretty cool to be
able to control a frame grabber, display live/acquired images, all
from within Python, within the same day I received the frame grabber
SDK, never having dealt with such hardware before!
- Wrap a commercial serial communications DLL.
- Wrap a commercial frame grabber interface
- After prototyping in Python, I move compute intensive routines
I have been using SWIG to create a Python interface for our
prototype implementation of GSSAPI. This is being done so
that we can incorporate security into the Hector project here
at DSTC. It also means that I can write Python application
programmes. Also now we have a standard interface to GSSAPI
and any implementation should be able to be plugged in.
Hector is described in an article in the January/February
1997 - Distributed Objects Dr. Dobb's Sourcebook.
Mark Hammond (MHammond@skippinet.com.au)
I'm using [SWIG] to write a commercial application, which runs as an NT
service. It uses the COM extensions to talk native MAPI to exchange
server, the service extensions to run unattended on NT, and the pipe, file
and event modules to manage the service control messages and named pipe
connections from clients. All modules named above were generated by SWIG.
The COM extensions will allow (once the .i file is up to it :-) any native
COM interface (ie, not IDispatch (eg, VB/Word/Excel) based) to be supported
I've used SWIG on a Linux platform to create Python modules for
graphing and database access.
The PGPLOT Graphics Subroutine Library is a Fortran library by Tim
Pearson. I understand it is often used by
astronomers. It may also be built into a C library.
I used SWIG to wrap the C library wrapping the Fortran library (!)
into a Python module, using some straightforward typemaps to convert
one and two dimensional Python Numeric arrays into the appropriate
pointers. I haven't methodically tested the full functionality, but
everything I tried works just fine.
I've also used SWIG to wrap up a library of Fortran subroutines
developed within the Western Australian Department of Environmental
Protection to manage databases of time series meteorological and air
quality data. I used SWIG to generate a simple shadow class which I
then extended further to make the interface nicer.
The original library provided, for instance, subroutines opendb(),
writdb(), readdb() and closdb(). My module, epadb.py, provides a
database class, epadb.DB, which is instantiated, d=epadb.DB(). The
database instance then provides methods d.open(), d.read(), d.write()
and d.close(), returning data as Python lists and arrays.
I'm particularly pleased that I managed to do these things with my
reading only knowledge of C, and lots of cutting and pasting.
We are currently in the process of redeveloping OOPUS, a system for
modeling plant systems and generate plant control software from a model.
(Don't ask what OOPUS stands for -it's a German acronym.) We decided to
reimplement its user interface using Tcl/Tk. OOPUS puts its models
into an OODBMS, namely POET. So we needed an integration of POET
(which is tightly coupled to C++) with Tcl/Tk, and we've successfully
done that with SWIG.
Peter A. Tinker
We're using SWIG to "glue" Tcl/Tk to custom and third-party libraries. In
particular, SWIG provides an elegant means for controlling Sense8
Corporation's WorldToolKit (WTK) virtual environment development system from a
Tk GUI. The result is highly portable code that is
independent of WTK's proprietary GUI yet allows access to virtually all WTK
functions from a Tcl script and/or a Tk GUI. This approach is
being used in a variety of projects involving advanced 3D visualization
on a variety of incompatible systems.
I have been using SWIG for several projects, mostly to streamline
working with OpenGL under Tcl/Tk. Examples are a time-critical
framework for viewing Lumigraphs (basically a digital hologram) and a
proof of concept application for optimizing texture coordinates based
on relative importance (determined by analyzing the existing texture
and user specification.) Using SWIG has dramatically reduced my
development time allowing me to develop code and debug state in an
interpreted environment (currently Tcl, but I think I am going to move
We at Beam Technologies, Inc. have used SWIG to begin developing an
interpreted Python interface to our PDESolve library. PDESolve is a
C++ class library for formulating and solving partial differential
equations (using either finite difference methods or finite element
methods), and makes use of OO technology to present a high-level
symbolic interface to the programmer. This makes the description of
PDE-based problems concise, and enables the embedding of PDE-based
models in larger computational frameworks (e.g., to do PDE-based
design optimization or coupled PDE-based systems). SWIG has allowed
us very quickly to develop a prototype Python interface to that
library. Such an interface holds the promise of: (1) allowing even
more rapid prototyping of models, (2) dynamic formulation of models
and solution methods, and (3) a method for conveniently integrating
PDESolve with other packages (i.e., through the Python substrate).
My hope is to make a Python-enabled PDESolve a tool for PDEs something
like what Matlab provides for linear algebra, i.e., a high-level,
interpreted environment for rapid prototyping and interactive
exploration, with an embedded programming language for scripting
And while I have been looking for a while for a powerful and
extensible interpreted language for use as a front-end to compile codes
(which Python is), SWIG has made the interfacing of that code vastly
easier than it would have been otherwise. While we are still in the
prototyping stages of this overall approach, SWIG enabled us to get up
and running quickly with a Python interface to PDESolve, and
demonstrate the utility of such an approach for a complex C++ library
(something that SWIG was not originally designed to really tackle).
SWIG is being used to create a Python interface to CLIPS expert system shell
inside my general research job under OODBMS DNET. This extension module
provide full control from Python environment to expert system: Change a
global variables, register a fact, manipulation with agenda, fact lists,
modules, functions, classes and instances. You can dynamically create and
execute CLIPS commands using clips.RouteCommand function call. Module
interface are similar to CLIPS Advanced API, who described into CLIPS
documentation. All additional documentation, Python classes are distributed
too. Module was be tested on Windows/NT and SUN Solaris 2.4 host platforms,
CLIPS version: 6.04, Python version 1.4. This module consist about 270
functions. This job took 3 days of my job at october 1997.
I got a page for
Minidx file management and search engine
Other Application Areas
These are some of the application areas that I've heard about SWIG being
used (but don't have many details).
- Semiconductor CAD.
- Remote sensing.
- Scientific visualization and simulation.
- Financial Modeling.
- Distributed and parallel computing.
- Distributed objects (use with CORBA).
- Software testing.
How are you using SWIG?
If you would like to list your project here, please
send e-mail to the swig-devel mailing list.
Feedback and questions concerning this site should be posted to the swig-devel mailing list.
Last modified : Sat Jul 15 15:05:19 2017