SBML.org — the global portal for all things SBML

Downloading libSBML

We offer ready-to-use installers for many operating systems and programming languages, so most users don't need to build libSBML themselves (though that's an option.) Use this table to find the appropriate instructions for your case:

Contents

MATLAB

For the stable release, we provide a single-archive installation for all versions of MATLAB and all operating systems. The files are ready to run; they require no compilation, only informing MATLAB about where you unpacked the archive:

  1. Download the distribution archive from SourceForge.
  2. Extract the archive somewhere on your local computer.
  3. Start your copy of MATLAB, then:
    1. Add the 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.

Note that the MATLAB installer contains only the core libSBML ilbrary and the MATLAB interface; it does not contain language libSBML API interfaces for other programming languages.

Python

We provide four ways to obtain the libSBML Python interface: (1) via Anaconda Cloud; (2) via the Python Package Index (PyPI) with pip; (3) for Linux only, installers for use with the standard operating system tools such as yum and apt-get; and (4) for Windows only, standalone Windows installers. The following paragraphs provide more information.

Using conda

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

  • To get the stable version of libSBML:
 conda install -c SBMLTeam python-libsbml
  • To get the experimental version of libSBML:
 conda install -c SBMLTeam 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.

Using pip from 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 command pip on your system 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.4):
    sudo pythonversion get-pip.py

    An example of the command line above is the following: sudo python3.4 get-pip.py.

To get libSBML with PyPi for Python 3.x

To get the stable release of libSBML, execute the following command:

sudo pipversion install python-libsbml

where version is a string that identifies the correct version of pip for Python 3.x. Unfortunately, this string differs for different systems, but is typically either of the form pip3.4 or pip-3.4 (to use 3.4 as a concrete example).

Alternatively, for the experimental release of libSBML, use the following command instead:

sudo pipversion install python-libsbml-experimental

To get libSBML with PyPi for Python 2.x

To get the stable release of libSBML, execute the following command:

  sudo pip install python-libsbml

Alternatively, for the experimental release of libSBML, use the following command instead:

  sudo pip install python-libsbml-experimental

In all cases

The process will take a long time because it must install and build dependent libraries. If all goes well, the steps above should result in pip eventually printing the following message to tell you has it finished successfully:

Successfully installed python-libsbml
Cleaning up...

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.

Using Linux's apt-get or yum

If you are running Linux, and you prefer to use the standard over-the-air installation tools provided by your operating system (e.g., yum and apt-get), you can take advantage of online repositories of installers we provide using the OpenSUSE Build System (OBS). You can find instructions for many different flavors of Linux including CentOS, Fedora, Ubuntu, and others, at the following URLs:

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.

Using the Windows libSBML installer for Python

You can take advantage of executable installers that we make available for Windows. They can be found in a subdirectory named python within each of the Windows subdirectories (stable and experimental) on SourceForge. There are different installers for different versions of Python. The following screenshot shows an example.


After you download an appropriate .exe file for your system, run the installer. The installer will lead you through the installation process.

C, C++, C#, Java, JavaScript, Perl, PHP, or Ruby

The installation packages in the libSBML SourceForge download site contain interfaces for C, C++, C#, Java, JavaScript, Perl, PHP, Python, and Ruby in the same package. (However, there are better ways to get the Python interface, as explained above.) The download area has two subdirectories: one for stable releases of libSBML, and one for experimental releases. The stable releases contain support for only the accepted parts of SBML, experimental releases contain code for SBML Level 3 packages still in development.


Click on either stable or experimental, and then navigate to a subdirectory matching your operating system platform. Download the appropriate installer or package file for your platform, and use the appropriate platform-specific approach to install the software. (E.g., if you downloaded a Mac .dmg file, double-click the file in the Mac Finder to mount the disk image, open the image contents in the Finder, and finally, double-click the .pkg file contained inside.)

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.

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.

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.

Building from sources

If you need Octave, or no installation package is available for your platform, or you have special requirements for libSBML's configuration, you can always build libSBML from sources.

  1. Download libSBML from our SourceForge distribution site.
  2. Follow the instructions for configuring, compiling and installing libSBML manually.

Retrieved from "http://sbml.org/Software/libSBML/Downloading_libSBML"

This page was last modified 02:37, 13 April 2016.



Please use our issue tracking system for any questions or suggestions about this website. This page was last modified 02:37, 13 April 2016.