libAntimony  2.8
Compiling and Installing libAntimony

Windows Binaries

The Windows installer

The Windows version of Antimony comes with an installer that will copy QTAntimony and the various converters to your machine, and make QTAntimony available from the 'Start' menu. You can use 'QTAntimony' to create, edit, and view Antimony, SBML, and CellML documents. If you choose to install the 2.1-beta version, you will additionally be able to work with SBML documents with the 'Hierarchichal Model Composition' package constructs enabled ( To use QTAntimony, simply open a file in one of the accepted formats, or create a new one. To view, edit, and save versions of your model in other formats, click on the tab for that format. Do note that if you edit your model in one tab, that tab becomes the 'canonical' version of the model, and the other tabs will be automatically generated when you switch back to them by translating the version you are currently editing. In any tab, you can always hit 'undo' (control-Z) to revert the model to what it was before.

The various command-line translators are hopefully self-explanatory; running them with no arguments at all will produce information on how to run them. As several different formats were becoming available, a single new translator 'sbtranslate' is now provided that can read models in any format, and produce them in any format as well. Run 'sbtranslate -h' for more information.

Programming with the .dll files

To use the libAntimony libraries, include the file antimony_api.h in your source for access to the commands, and then link in the libraries, either the provided pre-compiled versions for Windows, or the ones you have created yourself. The resulting executables will need access to the libAntimony dll as well as its dependencies: libSBML (which comes statically linked to expat) and the various CellML dlls (all provided). At the current time, in order for both CellML and libSBML to work together nicely, they must use different XML-parsing libraries, which means, since CellML only uses libxml, that libSBML must be compiled using expat or xerces–the one that uses expat is provided. These libraries were all compiled with Visual Studio 2010; using some other version of Visual Studio will probably not work with the provided binaries.

Compiling From Source

To compile libAntimony from source, use CMake ( For most systems, 'cmake-gui' is your best bet, but if you are trying to compile remotely via a terminal program, 'ccmake' will also work, and has a similar interface. Antimony, libSBML, and the CellML API all now use CMake as their core build system, so once you learn the basics for one, your knowledge should transfer to the others.

To start, create a new subdirectory in the 'antimony/' directory, and cd into it:

mkdir build; cd build

Next, run 'cmake-gui' (or 'ccmake', if you are trying to build remotely and need a text-based interface) with '..' (the parent directory) as the argument:

cmake-gui ..

The first thing to set is what you want to compile to. On Linux and MacOSX, 'Native Makefiles' is probably your best bet. For Windows, you can set the compiler to whatever version of Visual Studio you have installed, or to Cygwin if you have that.

From here, select what options you want on and off. In particular, here are what some of the options do:

  • WITH_SBML Incorporates libSBML, allowing translation to and from SBML. Requires libSBML v5.0.0 or later.
  • WITH_COMP_SBML Turns on functionality to produce and consume models with Hierarchical Model Composition package constructs. Requires libSBML with the latest version of the 'comp' package API integrated. (This option being on is the only difference between antimony v2.0 and antimony v2.1-beta.)
  • WITH_CELLML Incorporates the CellML API, allowing translation to and from CellML. Requires the CellML SDK to work.
  • WITH_QTANTIMONY Produces the QTAntimony editor. Requires QT (
  • WITH_SBW Incorporates functionality in QTAntimony to import and export models to other SBW-enabled programs. Requires SBW (and has had problems; if you need this functionality and it doesn't work, let us know).
  • WITH_SBW_TRANSLATOR Produces an SBW translator written by Frank Bergmann to translate models to and from the Antimony format. May not work with other options enabled.

These options come with the following dependencies:

  • If WITH_SBML is turned on, CMake will need to know where libSBML was installed; both LIBSBML_INCLUDE_DIR and LIBSBML_LIBRARY need to be set.
  • If WITH_COMP_SBML is turned on, the version of libSBML pointed to by LIBSBML_INCLUDE_DIR and LIBSBML_LIBRARY will need to point to the version of libsbml (5.1 or greater) with the 'comp' package integrated.
  • If WITH_CELLML is turned on, CMake will need to know where the CellML API was installed: you need only set 'CELLML_API_INSTALL_DIR' and it will find the include directories and the various libraries automatically (if it can't, you may need to track down those libraries yourself). Note that using the CellML API will trigger a flurry of warnings from the compiler, particularly in Windows. They may all be safely ignored.
  • If WITH_QTANTIMONY is turned on, CMake will need to know where qmake was installed; QT_QMAKE_EXECUTABLE will need to be set.
  • If WITH_SBW is turned on, CMake will need to know where SBW was installed; both SBW_INCLUDE_DIR and SBW_LIBRARY will need to be set.
  • To set whether to make a release or debug version by default, set the CMAKE_BUILD_TYPE variable to 'Debug', 'Release', 'RelWithDebInfo', or 'MinSizeRel'. (The last has not been tested extensively with this project, but is a standard CMake option.)
  • To set where to install the antimony library and executables, use CMAKE_INSTALL_PREFIX. I often use '../install/' for a local install.

If CMake does not work for you, you may be able to get things working on your own–libAntimony is not a complicated program, with only a handful of .cpp files in a single directory, which you may be able to get working yourself. The core Antimony parser (antimony.ypp) is compiled with bison to antimony_tab.cpp, which is already included. The main complications are its various dependencies, but these can be turned off: in particular, setting NSBML and/or NCELLML will not attempt to compile anything with SBML or CellML dependencies, respectively. QTAntimony is a bit more complicated in that it requires QT, but if you have compiled QT programs before, getting QTAntimony up and running is probably not very difficult. The old Makefile is still available as well, and may be instructive.