libSBML C++ API  5.20.2
Downloading libSBML

Please use the following table to find the appropriate instructions for your situation:

1. MATLAB

For stable releases of libSBML, we provide a unified installer for all versions of MATLAB and all operating systems. The result is ready to run after installation; it does not need compilation, and only requires you tell MATLAB where you placed the files. Here are the steps:

  1. Download the distribution archive from GitHub.
  2. Extract the archive somewhere on your local computer.
  3. Start your copy of MATLAB, then either:
      1. Add that folder to your MATLAB path using MATLAB's addPath command.
      2. Verify it works: change into that folder within your running MATLAB environment and issue the command TranslateSBML('test.xml'). If all is well, the output will be a MATLAB data structure.
      3. Save the changes to your MATLAB path for future use. You can use MATLAB's standard savepath command.
    or
    1. Navigate to the directory where you extracted the archive.
    2. Run installSBML, which performs the above steps.

Note that the MATLAB installation archive contains only the MATLAB interface; it does not contain the core libSBML library or language libSBML API interfaces for other programming languages.

2. Python

We provide four ways to obtain the libSBML Python interface. Please use whichever one you prefer.

2.1 Using Conda

We provide a distribution of the libSBML Python interface through Conda Forge, making it accessible through conda. To install it this way, follow these instructions:

  • To get the stable version of libSBML:
    conda install -c conda-forge python-libsbml
    
  • To get the experimental version of libSBML:
    conda install -c conda-forge python-libsbml-experimental
    

After this, you should be able to access the Python language interface for libSBML directly from your Python interpreter by importing it like any other Python module. In other words, import libsbml should work in your Python interpreter.

2.2 Using PyPI

Important: the default version of pip on your system may not be appropriate for the version of Python you want to use. (For example, the default pip may be for Python 2.7, which will not work if you want to use Python 3.x.) If you do not have pip installed for a given version of Python, a reliable way to install it is the following:

  1. Download get-pip.py.
  2. Run the following command in a shell terminal, where version is your version of Python (e.g., 3):
    sudo pythonversion get-pip.py
    
    An example of the command line above is the following: sudo python3 get-pip.py.
Assuming you have either pip2 or pip3 on your system, then to get the stable release of libSBML, execute the following command:
sudo pipversion install python-libsbml

where version is either 2 or 3 depending on whether you want to use Python 2 or Python 3. Alternatively, for the experimental release of libSBML, use the following command instead:

sudo pipversion install python-libsbml-experimental

After this, you should be able to access the Python language interface for libSBML on your computer directly from your Python interpreter by importing it like any other Python module. In other words, import libsbml should work when typed into your Python interpreter.

3. R

We provide installers for the stable version of the libSBML R language interface for Linux, Mac OS X and Windows. Download the version that is appropriate for your situation:

Once you have downloaded the appropriate version, one more step is required to install the libSBML R interface. You can do this step in one of two ways: either using the R graphical interface, or using a terminal/shell command. These approaches are explained below.

3.1 Using the R GUI

From the R menu "Packages" or "Packages & Data" (depending on your operating system), select the "Package Installer" item. You will be presented with an interface that lets you install a local binary package. Use that interface to navigate to the directory where you copied the libSBML archive file, and select the archive file for installation.

3.2 Using a shell command

Suppose that the path to the libSBML R archive on your computer is archive. Execute the following command in a terminal/shell window (note: not in the R command line interpreter!):

R CMD INSTALL archive

If all goes well, you should see R print messages. If you're using the source package, it will be something such as the following (the paths on your computer may differ):

* installing to library '/Library/Frameworks/R.framework/Versions/3.1/Resources/library'
* installing *binary* package 'libSBML' ...
* DONE (libSBML) 

whereas if you are using a binary package, the messages will be something like the following instead:

> utils:::menuInstallLocal()
  package ‘libSBML’ successfully unpacked and MD5 sums checked
>

From this point forward, you should be able to call on libSBML functions from within your copy of R. You can test whether the installation was successful by trying the following command in R:

library('libSBML')

If R does not report an error when you execute this command, then the libSBML R interface is probably installed correctly.

4. Other languages

If no installation package is available for your particular platform, or you have special requirements for libSBML's configuration, you can always build libSBML from sources. The process for doing that is the topic a separate section, Building and installing libSBML .