Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Building OpenMS on GNU/Linux

This document describes how to build OpenMS on a GNU/Linux system from source.

We are working on adding OpenMS to the repositories of the most popular distributions, but for now the toolkit needs to be manually compiled on your system.

Checkout OpenMS

You can find the links to the release and development versions on the Downloads page of the OpenMS project.

From here on the instructions assume you have an extracted tar.gz of the Release and are inside its root, or checked out the development (git) version by:

# Assuming you are in ~/Development
git clone https://github.com/OpenMS/OpenMS.git

Dependencies obtainable in binary form

Before building from source, OpenMS requires several other libraries to be present on your system. Most of these should be available in the repositories of your GNU/Linux distribution.

For the libraries/versions often not found in those repositories, we provide sources and build scripts. The Release tar.gz archive contains the libraries in the contrib/ folder, if you build the Development (git) version, you'll have to check them out separately (see below in Building remaining dependencies).

Required packages and libraries

Essential are GCC > 4.0 or other ANSI C++ compiler, CMake > 2.8.3, Qt4 > 4.6 (> 4.7 for the GUI), patch, autoconf > 2.60, automake > 1.9, libtool (libtoolize/glibtoolize).

For the complete feature set to be enabled, OpenMS needs recent versions of Boost (1.46 or higher works), Eigen3, WildMagic5 libSVM (2.91 or higher and 3.x for x <= 14 works), SeqAn (1.4.0 or higher needed), glpk (4.45 or higher works), zlib, libbz2, and Xerces-C (3.1.1 or higher works).

Building the documentation from the development version requires doxygen > 1.5.4 and pdflatex/texlive/texlive-full.

Building the Python extensions pyOpenMS requires Python (> 2.6), Cython (> 0.19), nose testing and numpy.

For the most common distributions, these commands will install most of the libraries:

Fedora also look here
    sudo yum install cmake gcc gcc-g++ autoconf autoconf-2.6 qt-devel
    
OpenSuse 11.1
    sudo zypper install cmake gcc-g++ autoconf libqt4-devel
    
Ubuntu/Debian
(10.04/6.0 or later recommended)
    sudo apt-get install cmake g++ autoconf qt4-dev-tools patch libtool make git
    sudo apt-get install libboost-regex-dev libboost-iostreams-dev libboost-date-time-dev libboost-math-dev \
      libsvm-dev libglpk-dev libzip-dev zlib1g-dev libxerces-c-dev libbz2-dev
    

Building remaining dependencies

Note
In most cases, the only dependencies left unresolved (e.g. not easily available through your distribution) at this point are SeqAn and WildMagic. You can check which dependencies you still need by attempting to configure OpenMS (see the next section), it will complain about anything unusual. Contact us if you still have trouble with the dependencies after these instructions.

OpenMS conveniently provides its dependencies for download. The OpenMS Release package (https://sourceforge.net/projects/open-ms/files/OpenMS/) contains the sources of all dependencies in the contrib/ folder. For the Development (git) version, this folder is not included, it has to be checked out separately (and referred to later). We generally recommend to keep the contrib separate from the OpenMS source code. Assuming you have extracted the the OpenMS source code in a folder ~/Development (i.e., ~/Development/OpenMS) we suggest to also put the contrib there (i.e., ~/Development/contrib). For the contrib as well as for OpenMS we suggest to use out-of-source builds.

Note
Generally all files generated while building OpenMS have to go somewhere. In case of in-source-builds all files will be generated alongside the source code. While this is easy and a well known practice from the regular ./configure + make approach it also changes your build tree. It also prohibits building multiple configurations (e.g., Debug and Release or different compiler versions). As an alternative CMake offers the possibility to perform so called out-of-source builds. Here all build files, binaries, libraries, etc. are generated in a separate directory.
# Assuming you are in ~/Development
git clone https://github.com/OpenMS/contrib.git
mkdir contrib-build
cd contrib-build

From the ./contrib-build/ folder, execute the following command to show the available build types and then build SeqAn (the other build scripts may be executed if your distribution does not provide a package for the dependency):

cmake -DBUILD_TYPE=LIST ../contrib
cmake -DBUILD_TYPE=SEQAN ../contrib
cmake -DBUILD_TYPE=WILDMAGIC ../contrib
cmake -DBUILD_TYPE=EIGEN ../contrib

To avoid problems while building the libraries contained in the contrib package, the path to your contrib-build directory should not have any spaces in it.

Configuring and building OpenMS/TOPP

It is assumed that you have successfully built and installed all dependencies and are in the root folder of the OpenMS tree (see above in Checkout OpenMS for instructions how to obtain OpenMS sources either from a release version or from the most recent development branch).

The next step is to create a build directory beside the OpenMS root directory e.g., OpenMS-build (see above note on out-of-source builds).

# Assuming you are in ~/Development and OpenMS is also located in
# ~/Development
mkdir OpenMS-build
cd OpenMS-build

In the OpenMS build directory we execute CMake to configure OpenMS. You should substitute /PATH/TO/contrib/ with the above path to the build contrib. Make sure you use the absolute (and not relative) path for the contrib to avoid any potential issues.

cmake -DCMAKE_PREFIX_PATH="/PATH/TO/contrib;/usr;/usr/local" -DBOOST_USE_STATIC=OFF ../OpenMS

In order to build the OpenMS library, the TOPP tools, tests, and this documentation execute the following command:

make

Getting your environment ready to use OpenMS

The previous step takes the most time, in the meanwhile you can prepare your environment for easy OpenMS usage:

Make sure to add /PATH/TO/OpenMS/lib/ (e.g. /home/smith/OpenMS/lib/) to the environment variable LD_LIBRARY_PATH. The best way is to edit $HOME/.bashrc and add the following

export LD_LIBRARY_PATH="/PATH/TO/OpenMS/lib:$LD_LIBRARY_PATH"

The TOPP tools will be built in the /PATH/TO/OpenMS/bin/ folder. Add this path to the environment variable PATH to use the commands anywhere on your system.

This is necessary to use the TOPP tools from TOPPView.

You can do this by appending the following also to your $HOME/.bashrc (Do not use the tilde character ~ to abbreviate your home folder)

export PATH=$PATH:/PATH/TO/OpenMS/bin

Apply both changes by executing

. ~/.bashrc

Running OpenMS

If the build from Configuring and building OpenMS/TOPP is ready, you can now run a GNU/Linux OpenMS tool by e.g. executing

FileInfo

From here on you should be good to go! See below for advanced installation and configuration options.




Advanced Options

Advanced users can list the separate make targets by calling:

make targets

You can set more CMake variables adding -DVARIABLE=VALUE options in step Configuring and building OpenMS/TOPP.

The most important CMake variables are:

CMAKE_INSTALL_PREFIX

the path where the bin/ and lib/ directories should be installed to (when

sudo make install

is wished for a system-wide install: e.g. -DCMAKE_INSTALL_PREFIX=/usr/local/)
Note: Moving these directories after installing is not supported.

For development, install prefixes are not supported. In this case OpenMS must be built in place!

CMAKE_PREFIX_PATH Additional search path for the contrib libraries. If not set the location is assumed to be
contrib/
as packaged in the Release tar.gz.
QT_QMAKE_EXECUTABLE Defines the Qt 'qmake' application. The corresponding Qt installation is used.
CMAKE_BUILD_TYPE Should be either 'Release' (optimization enabled) or 'Debug' (debug info and precondition/postcondition checks enabled).
The default is 'Release'.
CMAKE_CXX_COMPILER Defines the C++ compiler to use.
CMAKE_C_COMPILER Defines the C compiler to use. This should match the C++ compiler. Mixing compilers (e.g., clang++ for C++ and gcc for C) can lead to undefined behaviour as some internal settings (e.g., OpenMP support) are determined using the C compiler and are assumed to be the same for the C++ compiler.
HAS_XSERVER Defines if a running X Server is available when building OpenMS. As building parts of the documentation and running certain tests requires a running X Server, this flag can be used to disable those parts of the documentation and the tests that need an X Server. (Default: On)
WITH_GUI Defines if the OpenMS GUI tools (TOPPView, TOPPAS) should be built or not. These components need Qt > 4.7 which may not be available on some systems (specifically older CentOS / RHEL servers). If you plan to use OpenMS without a GUI, set this flag to "Off" (Default: On)
ENABLE_TUTORIALS Defines if a OpenMS should build and install the pdf tutorials. (Default: On)
SEARCH_ENGINES_DIRECTORY (optional)

The location where the ID search engines (X!Tandem, OMMSA, MyriMatch) are located. This directory should have the same structure as the example in the search engine repository at https://open-ms.svn.sourceforge.net/svnroot/open-ms/THIRDPARTY/SEARCHENGINES/.

This directory is needed to build the installer for OpenMS.

PYOPENMS Use ON to also build the Python bindings, see also pyOpenMS (Python bindings).

A full list of the CMake variables is shown when you execute

ccmake .

This works only after having executed cmake once (see Configuring and building OpenMS/TOPP)




Testing your OpenMS/TOPP installation

After you have installed OpenMS and TOPP, you should test your installation by executing the following command:

make test

or

ctest

Using ctest you can also execute only single tests by using the -R switch or run tests in parallel using the -j switch.

ctest -R TOPP_ -j 4

Will run all TOPP test using 4 jobs. Make sure that you have build all tests beforehand by executing.

make

OpenMS / TOPP release 2.0.0 Documentation generated on Tue Aug 25 2015 05:53:56 using doxygen 1.8.9.1