OpenMS
2.7.0
|
This document describes how to build OpenMS on a GNU/Linux system from source. If you encounter errors during configuring/compiling our software, have a look at our Known Issues section and search in our issue tracker, maybe the error is already known. If not, please write to the mailing list or report the error on our issue tracker.
We are working on adding OpenMS to the repositories of the most popular distributions, but for many platforms the toolkit needs to be manually compiled on your system. The same applies if you want to use the most recent source files from our git repository.
You can find the links to the release and development versions on the Downloads page of the OpenMS project. All source code, including the latest development version, is on github and can be obtained via git:
From here on, the instructions assume you have either an extracted tar.gz of a release and are inside its root, or checked out the development (git) version.
Next, we will care for the dependencies upon which building OpenMS from source relies.
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 those libraries/versions often not found in the distro repositories, we provide sources and build scripts called "Contrib" build scripts. The Release tar.gz archive contains these libraries in the contrib/ folder, if you build the development (git) version, you'll find an empty submodule in that folder that you have to update first with
Despite that, in the following is a list of all required packages and libraries:
For the most common distributions, we have compiled these commands which will install the required compatible libraries. There may be more libraries in your distributions packaging system, but beware of version incompatibilities.
Fedora/RHEL/CentOS packages | # In newer distros change yum to dnf sudo yum groupinstall 'Development Tools' sudo yum install git tar # Especially on older CentOS versions <= 6 add the EPEL repo with additional updated packages sudo yum install epel-release # Update repo list for the thirdparty repository EPEL sudo yum repolist # Get REQUIRED installable contrib libraries sudo yum install cmake3 qt5-qtbase-gui qt5-qtbase-devel qt5-qtsvg-devel python-devel glpk-devel # Get OPTIONAL installable contrib libraries preferably from our Contrib package in the next step. ## sudo yum boost-devel libsvm-devel libzip-devel zlib-devel xerces-c-devel bzip2-devel libhdf5-devel # NOTE that you might need to use cmake3 instead of cmake in the commands of the following steps. |
openSUSE >= 13.2 | # register obs://build.opensuse.org/devel:libraries:c_c++ # tools sudo zypper install cmake gcc-c++ autoconf git patch automake libtool # REQUIRED dependencies sudo zypper install libqt5-qtbase-devel libqt5-qtsvg-devel python-devel glpk-devel # OPTIONAL dependencies, preferably installed with our Contrib package in the next step ## sudo zypper install boost-devel libzip-devel zlib-devel \ # libxerces-c-devel libbz2-devel libsvm-devel libhdf5-10 |
Ubuntu/Debian (16.04) | # include the ubuntu universe repository and update sudo add-apt-repository universe sudo apt update sudo apt-get install build-essential cmake autoconf patch libtool git automake sudo apt-get install qtbase5-dev libqt5svg5-dev libqt5opengl5-dev sudo apt-get install libboost-regex-dev libboost-iostreams-dev \ libboost-date-time-dev libboost-math-dev libboost-random-dev libsvm-dev \ libglpk-dev zlib1g-dev libxerces-c-dev seqan-dev libbz2-dev coinor-libcoinmp-dev libhdf5-dev # Use from contrib: EIGEN; SQLITE; WILDMAGIC (since libwildmagic-dev is buggy) |
Ubuntu/Debian (>= 17.04) | # include the ubuntu universe repository and update sudo add-apt-repository universe sudo apt update sudo apt-get install build-essential cmake autoconf patch libtool git automake sudo apt-get install qtbase5-dev libqt5svg5-dev libqt5opengl5-dev sudo apt-get install libeigen3-dev libsqlite3-dev libwildmagic-dev libboost-random1.62-dev \ libboost-regex1.62-dev libboost-iostreams1.62-dev libboost-date-time1.62-dev libboost-math1.62-dev \ libxerces-c-dev libglpk-dev zlib1g-dev libsvm-dev libbz2-dev seqan-dev coinor-libcoinmp-dev libhdf5-dev # this should eliminate the need for building contrib libraries. |
Ubuntu/Debian (= 19.10) | # include the ubuntu universe repository and update sudo add-apt-repository universe sudo apt update sudo apt-get install build-essential cmake autoconf patch libtool git automake sudo apt-get install qtbase5-dev libqt5svg5-dev libqt5opengl5-dev sudo apt-get install libeigen3-dev libsqlite3-dev libwildmagic-dev libboost-random1.67-dev \ libboost-regex1.67-dev libboost-iostreams1.67-dev libboost-date-time1.67-dev libboost-math1.67-dev \ libxerces-c-dev libglpk-dev zlib1g-dev libsvm-dev libbz2-dev seqan-dev coinor-libcoinmp-dev libhdf5-dev # this should eliminate the need for building contrib libraries. |
You can and should check which dependencies you still need by attempting to configure OpenMS (see the next section), it will complain about anything unusual/missing.
The tar.gz of the Release contains the scripts for building all dependencies in the contrib/ folder. For the development (git) version, this so called submodule folder will be empty and has to be checked out separately.
For the contrib as well as for OpenMS we suggest to use out-of-source builds.
From the ./contrib-build/
folder, execute the following command to show the available build types
and then build Widmagic or Eigen (both lines may or may not be needed to be executed depending on if your distribution does not provide a package for the dependency):
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. In case your distribution does not provide some of the packages (or in different versions than expected), it is sometimes easier to build all dependencies manually which can solve issues with incompatible versions:
If you are on a system without root access (e.g. a shared cluster), there are some additional considerations, especially regarding dependencies. Specifically, some older Red Hat systems have older libraries installed that may interfere with the newer versions that OpenMS requires. The recommended installation procedure is to use the contrib package to compile all dependencies from source:
Alternatively, you can build one package after the other by providing -DBUILD_TYPE=...
with the appropriate argument. In addition, you may have to compile Qt yourself which you can get from http://download.qt.io/official_releases/qt (use version >5.5), if it is not provided on your server or the version on your environment is too old. Then you can use the traditional ./configure –prefix=/path && make && make install
sequence to compile and install Qt (note that you should set the –prefix=/path
to a local directory assuming you don't have root privileges).
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).
In the OpenMS build directory we execute CMake to configure OpenMS. You should substitute /PATH/TO/contrib-build/
with the above path to the built contrib. Make sure you use the absolute (and not relative) path for the contrib to avoid any potential issues.
If CMake has problems finding system libraries, you might consider adding:
to the CMake options.
If CMake has problems finding Qt5 (Qt5SvgConfig.cmake is usually the first to fail), you might consider adding:
to the CMake options, where /PATH/TO/qt/5.9.7/gcc_64
depends on your system settings and Qt version.
When configuring OpenMS, consider setting WITH_GUI=Off
and HAS_XSERVER=Off
, especially as you may not have compiled Qt with OpenGL and you may not have an X server.
You can set more CMake variables adding -DVARIABLE=VALUE
options when calling CMake.The most important CMake variables are:
OPENMS_CONTRIB_LIBS | Separate search path for the contrib libraries from github.com/OpenMS/contrib that is internally considered before CMAKE_PREFIX_PATH for searching, linking and adding include directories. |
CMAKE_PREFIX_PATH | Additional search path for the contrib libraries. [MacOSX only] If you want to use libraries installed via Homebrew or MacPorts you might need to provide the corresponding paths
Please keep in mind that both Homebrew and MacPorts do not provide all libraries so you also need to specify the path to your self-build contrib via -DOPENMS_CONTRIB_LIBS |
Qt5_DIR | Additional search path for the Qt5 CMake files. Use /PATH/TO/QT_INSTALLATION/lib/cmake/Qt5 as value. |
HAS_XSERVER=On/Off | [Linux/MacOS only] 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) |
ADDRESS_SANITIZER=On/Off | [g++/clang only] Enables/Disables Address Sanitizer (ASAN) to find access violations and other bugs. |
WITH_GUI=On/Off | Defines if the OpenMS GUI tools (TOPPView, TOPPAS) should be built or not. If you plan to use OpenMS without a GUI, set this flag to "Off" (Default: On) |
ENABLE_TUTORIALS=On/Off | Enables targets to build and install the pdf tutorials (needs LaTeX). (Default: On) |
ENABLE_DOCS=On/Off | Enables documentation targets, allowing to build the OpenMS documentation. (Default: On) |
GIT_TRACKING=On/Off | Embed Git checksum into the library. (Default: On) |
ENABLE_UPDATE_CHECK=On/Off | Check online for OpenMS Updates upon invocation of any TOPP/UTIL. (Default: On) |
CMAKE_BUILD_TYPE | [makefiles only; does not apply for XCode or VS] 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. |
MY_CXX_FLAGS | Additional custom C++ compile options you would like to add (must fit your chosen compiler). This might be useful, for example, for adding debug symbols to a Release build, or for performance analysis (e.g. for '... -DMY_CXX_FLAGS="-Og;-ggdb;-g3;-fno-omit-frame-pointer" ...') |
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. |
SEARCH_ENGINES_DIRECTORY (optional) | The location where thirdparty search engines (X!Tandem, OMSSA, MyriMatch, MSGF+, Fido) are located. This directory should have the same structure as the example in the search engine repository at https://github.com/OpenMS/THIRDPARTY after flattening for your platform. /. This directory is only needed to include thirdparty tools in the installer for OpenMS. |
PYOPENMS=Off/On | Create Python bindings, see also pyOpenMS (Python bindings) (Default: Off) |
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/) For development, install prefixes are not supported. In this case OpenMS must be built in place! |
A full list of the CMake variables is shown when you execute
This works only after having executed cmake
once (see Configuring and building OpenMS/TOPP)
In order to build the OpenMS library, the TOPP tools, tests, and this documentation, execute the following command:
Advanced users can list the separate make targets by calling:
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
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)
Apply both changes by executing
PATH
. Build them or check out prebuilt executables of the versions supported at the time of the release with If the build from Configuring and building OpenMS/TOPP is ready, you can now run a GNU/Linux OpenMS tool by e.g. executing
From here on you should be good to go! See below for advanced installation and configuration options.
After you have installed OpenMS and TOPP, you should test your installation by executing the following command:
or
Using ctest you can also execute only a subset of tests by using the -R [REGEX] option and run tests in parallel using the -j parameter. For more information, consult ctest man page.
Will run all TOPP test using 4 jobs. Make sure that you have build all tests beforehand by executing