Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
Installation Guide

Tutorial guiding the installation of the library.

Introduction

This installation guide provides the information for compiling and installing the SBL library and its documentation. To download the SBL, you may get the tarball from Download page or clone the Git repository.

In the following:

  • The section Dependencies shows all the common dependencies of the SBL library, with references to the main pages of the corresponding libraries.
  • The section Quick Start shows three simple ways to use the SBL library, namely (i) without compilation, (ii) with static programs installation, and (iii) with compilation from source code.

Dependencies

A number of generic C++ packages from the SBL rely on external dependencies, which have to be installed prior to using the SBL. For a specific package, the optional dependencies are listed at the end of the implementation section of the user manual of that package. For the sake of a synthetic view, all dependencies are summarized thereafter. We segragate three dependencies : mandatory, specific and optional dependencies.

Mandatory Dependencies

The following libraries are used in almost all applications, so that it is better to install them whatever the use of the SBL :

Note that all these libraries are either provided with the SBL (like the ESBTL), or are directly available on most Unix systems using native package installers (apt-get, dnf, yum, port, etc.)

GMP and MPFR

These libraries provide classes implementing number types and the accompanying operations, allowing the development of algorithms with specific arithmetic requirements:

  • GMP is a library for arbitrary precision arithmetic,
  • MPFR is a library for multiple-precision floating-point computations with correct rounding,

Note that GMP and MPFR are mandatory to use CGAL . For each library, if one of them is installed in a non standard location, the <LIBRARY_NAME>_DIR environment variable needs to point to the root directory of that library.

Boost

The reference C++ Boost libraries provide various tools used throughout the library — see Boost home page for more details.

While the generic components of Boost are directly integrated in Core, the following non generic Boost packages are used in the applications:

  • Boost Serialization : provides tools for serializing data structures, i.e to store them in an archive such that it is possible to reconstruct them from this archive. In Applications, an archive is a XML file, allowing to use PALSE for analyzing the output data of an application (see PALSE).
  • Boost Program Options : provides tools to handle (generating and parse) the command line options of applications. (Note that program options are used together with the workflows and the Modules, allowing one to assign the options to the modules used to define the workflow of an application.)
  • Boost Regex : provides tools to manipulate regular expressions.
  • Boost Thread : provides classes and functions to manage multiple threads.
  • Boost System : provides simple and light-weight tools to manage errors.

If Boost is installed in a non standard location, the BOOST_ROOT environment variable needs to point to the root directory of Boost .

CGAL

The Computational Geometry Algorithms Library (CGAL) provides various core geometric constructions. In particular, CGAL is used in large number of packages in Core. A number of libraries are provided with the CGAL library, as the GMP and MPFR libraries. A detailed explanation on how to install the CGAL library is provided on the CGAL installation guide.

Note that if the CGAL library is installed in a non standard location, the CGAL_DIR environment variable must point to the root directory of CGAL.

ESBTL

The Easy Structural Biology Template Library (ESBTL) library is a generic C++ library (header-only) for parsing and managing data in a PDB file. It also provides geometric representations of molecules using CGAL.

The ESBTL library is provided with the SBL library as third party–no installation required. To use one's version of ESBTL, just set the environment variable ESBTL_DIR to the root directory of the custom ESBTL.

Eigen

The Eigen library is used for linear algebra, in particular to represent matrices and compute eigenvalues.

If the Eigen is installed in a non standard location, the EIGEN_DIR environment variable needs to point to the root directory of the Eigen library.

Specific Dependencies

The following dependencies are specific, meaning that they are used in a specific file that will not be compiled without the necessary library :

Note that most packages can be used even if the library is missing, since the specific dependency is restrained to a file. For instance, Spatial_search and MolecularGeometryLoader can be used without the dependencies. The package Alignment_engines will rely on Seqan only if using sequence alignments. The package Real_value_function_minimizer requires at least one of the two libraries Ipopt or LBFGS++ . The package Molecular_potential_energy relies heavily on rapidxml and cannot be used without it.

FLANN

FLANN (Fast Library for Approximate Nearest Neighbors) is a library offering a collection of approximate nearest neighbor algorithms and methods for peaking the best algorithm to use ependening on the input dataset. It is wrapped in the class SBL::GT::T_ANN_FLANN_wrapper of the package Spatial_search for comparing / replacing the other algorithms implemented in the package. If the library is installed in a non-standard location, the FLANN_DIR environment variable needs to point to the root directory of the library.

Ipopt

Ipopt (Interior Point OPTimizer) is a library for non-linear optimization. It is used in the package Real_value_function_minimizer for finding local minima of real value functions. If the library is installed in a non-standard location, the IPOPT_ROOT environment variable needs to point to the root directory of the library.

LBFGS++

LBFGS++ (Limited-memory BFGS) is a header-only C++ library that implements the eponym algorithm–see the Download or clone page. It is used in the package Real_value_function_minimizer for finding local minima of real value functions. Since it is header-only, it is easy to install and to use, making an easy alternative to the Ipopt library. If the library is installed in a non-standard location, the LBFGSPP_DIR environment variable needs to point to the include directory of the library.

rapidxml

rapidxml is a header only C++ XML parser used in the SBL for loading force field parameters from XML files in the package Molecular_potential_energy . If the library is installed in a non-standard location, the RAPIDXML_DIR environment variable needs to point to the root directory of the library.

Seqan

Seqan is a C++ header-only library providing a collection of sequence alignment algorithms. It is used in the package Alignment_engines. If the library is installed in a non-standard location, the SEQAN_DIR environment variable needs to point to the include directory of the library.

Gromacs

Gromacs is used for loading trajectories of conformations from XTC files in the package MolecularGeometryLoader. If the library is installed in a non-standard location, the GROMACS_DIR environment variable needs to point to the root directory of the library.

Optional Dependencies

Dependencies are optional when applications can be compiled without the corresponding library :

OpenMP

OpenMP is used to parallelize loops in the SBL. It is particularly used for parallelizing the run of collections of modules within workflows – see Modules when using workflows. When OpenMP is used for the compilation of a program, the C++ macro SBL_WITH_OPENMP is automatically defined, enforcing the use of OpenMP for parallelizing the for loops.

MPFI

In the SBL, interval arithmetics is managed using the Boost library. However, in order to use multi-precision interval arithmetic, the library MPFI has to be installed. It is used in particular to compute the volume of unions of balls in SBL. When MPFI is used for the compilation of a program, the C++ macro SBL_WITH_MPFI is automatically defined, enforcing the use of MPFI rather than Boost for managing multi-precision interval arithmetic. If MPFI is installed in a non standard location, the MPFI_DIR environment variable needs to point to the root directory of the library.

Quick Start

Using the SBL without compilation

The SBL provides generic C++ code. This code may be referenced directly, and used to develop applications. The location of the .hpp files is specified below–see Compiling the library from the source code .

Installation from pre-compiled static programs

It is also possible to install the library using the script sbl-plugins-installer-unix.py (works for linux and macos), available from the website Applications page.

This script:

  • (i) clones the SBL,

  • (ii) downloads the pre-compiled static programs,

  • (iii) performs installations in local directories the VMD (in ~/sblvmdplugins) and PyMOL (in ~/.pymol/startup/SBL) plugins, allowing one to use the SBL programs through a GUI.

    The option –help prints all available options for this script. If the SBL is not already installed, the following command performs the tasks (i), (ii) and (iii) for a Linux platform :

    > python sbl-plugins-installer-unix.py --sbl-dir=</path/to/target/install/dir> --sbl-install=clone --platform=linux
    

    If the SBL is already installed, then the following command will perform the tasks (ii) and (iii) for a Linux platform :

    > python sbl-plugins-installer-unix.py --sbl-dir=</path/to/target/install/dir> --sbl-install=pull --platform=linux
    

    On MacOS, just replace linux by macos. For PyMOL, if the local plugins directory has never been used, it should be parametrized within the GUI : Plugin > Settings > Add new directory, then select the directory ~/.pymol/startup, and then restarts PyMOL.

Getting the source code

The source code is available from the following tarball.

It may also be obtained by cloning the read-only git repository as follows:

> git clone git://sbl.inria.fr/git/sbl.git

In the sequel, we assume that the environment variable SBL_DIR points to the directory containing the source code.

Compiling the library from the source code

To compile and install the library from this source code, CMake is used. The version 2.6 or latter of CMake is recommended. Note that the following installation requires root privileges: if you do not have them, refer to section Non standard installation directory.

The installation runs through four steps:

  • 1) Creating the build directory. From the directory containing the source code:
> mkdir build_sbl; cd build_sbl
  • 2) Running cmake. To compile the programs during the installation, you can set the SBL_APPLICATIONS tag to ON. It is also possible to compile only part of the programs by specifying a value for SBL_APPLICATIONS (Core for all applications in Core, SFM for all Space Filling Model applications, CA for Conformational Analysis applications, DM for Data Managment applications)
> cmake \<path/to/your/sbl/git/directory\> -DSBL_APPLICATIONS=ON
  • 3) Running the compilation and the installation (note that the compilation of the programs may take up to about twenty minutes) :
> make; make install

This last step will compile the programs (if SBL_APPLICATIONS is set to ON). It will also copy files around, into the standard locations indicated below (or into the directory pointed at by the CMAKE_INSTALL_PREFIX, see below):

  • the include directory of each package is copied in the /usr/include directory,
  • the include directory of the ESBTL library is copied into the /usr/include directory,
  • the Python source code of Python packages is copied into /usr/lib/python,
  • the compiled programs and python scripts are copied into /usr/bin,
  • the cmake files of the library are copied into into /usr/share/cmake,
  • the documentation, the demos of the applications and the source code of the examples are copied into /usr/share/doc.

Note that if a new version of the library is available, the installation must be carried out again upon updating the git repository.

The variable CMAKE_INSTALL_PREFIX calls for one comment. This variable should contain the name of the directory containing all subdirectories to be installed, namely include, doc, bin. Phrased differently, if one set CMAKE_INSTALL_PREFIX to /path/to/my/directory/bin, then, all sub-directories will be found below /bin, which is clearly an undesired ending.


To update one's version of the library, it is sufficient to update one's local git repository. However, note that the examples, tests and programs have to be compiled one by one. Therefore, using the library without installing it is only recommended for those willing to use the SBL library as a header-only library.


To uninstall the library i.e. remove all the installed files, proceed as follows:
> make; make uninstall


Advanced Installation

In this section, we show the various options for compiling the different parts of the library, and installing it.

Non standard installation directory

When installing the SBL library, one may not have the root privileges, may want to install the SBL into a local directory. Doing so merely requires setting the cmake variable CMAKE_INSTALL_PREFIX to your local install directory when running cmake:

> cmake \</path/to/sbl/directory\> -DCMAKE_INSTALL_PREFIX=\</path/to/local/install/directory\>
> make
> make install

Given this target directory, executables are installed in the bin sub-folder of the target install directory while Python modules are installed in the python sub-folder.

Note that executables and Python modules installed in a non standard location will not be directly usable except if the corresponding environment variables have been set :
  • PATH for executables,
  • PYTHONPATH for Python modules.
For example, unix users equipped with a zsh shell should set the environment variables as follows:
> export PATH=$PATH:\</path/to/local/install/directory\>/bin
> export PYTHONPATH=$PYTHONPATH:\</path/to/local/install/directory\>/python


Examples and test compilation

Within a package from Core, examples are short programs showing the basic functionality provided in that package.

In addition, tests can be used in such packages, by compiling and running short test programs checking various functionalities of the packages. For compiling all the examples and the tests of the SBL library while installing it, just turn ON the tags SBL_EXAMPLES and SBL_TESTS when running cmake:

> cmake \</path/to/sbl/directory\> -DSBL_EXAMPLES=ON -DSBL_TESTS=ON
> make

Then, to test all the packages from Core, just run the tests with the following command:

> make test

Note that the previous does not require any installation step since the examples and tests are only compiled locally and only the sources of the examples are installed for documentation (in /usr/share/doc).

Debug vs release

It is possible to compile the programs in Debug or in Release mode using the cmake variable CMAKE_BUILD_TYPE. However, since the SBL library is only made of headers and programs, we recommend the Debug mode only for the developers. For compiling in Debug mode, one can run the following command:

> cmake \</path/to/sbl/directory\> -DCMAKE_BUILD_TYPE=Debug
> make 

Note that by default, the Release mode is used. Note also that to debug symbols from other libraries, if these are not header-only, compiling them in Debug mode is mandatory.

Static programs

It is possible to create static versions of the programs by setting to ON the cmake variable BUILD_STATIC_SBL:

> cmake \</path/to/sbl/directory\> -DBUILD_STATIC_SBL=ON
> make 
In order to enjoy purely static programs, all the dependencies must also be available in static mode :
  • mandatory dependencies :
    • ESBTL and Eigen are header-only libraries; so is CGAL from the version 4.10 onward.
    • GMP and Boost are generally provided by Unix systems with static versions.
    • MPFR (and CGAL before the version 4.10) require a local static compilation if not provided by the OS.
  • specific dependencies :
    • Seqan, LBFGS++ and rapidxml are header-only libraries.
    • FLANN is generally provided by Unix systems with a static version.
    • Ipopt and Gromacs require a local static compilation if not provided by the OS.


Note also that only the programs are compiled in static mode since the examples and tests are not installed. If one wants to compile static examples or static tests, such compilations should be done locally.

Installing VMD plugins

The SBL library provides VMD plugins for visualizing the output of the programs (details in section VMD (Visual Molecular Dynamics)).

It should be recalled that VMD plugins involve three ingredients:

  • The executables from the SBL, which are called by the plugins. In the sequel, we assume that these have been installed in a directory referenced in one's PATH, as explained above.
  • A folder containing the tcl code for the plugins. For the SBL, this folder is called sblvmdplugins, and we create/update it in one's home directory.
  • The so-called .vmdrc file, located in one's home directory, which parameterizes one's VMD. For SBL plugins, it indicates where the plugins are installed.

To automatically install the VMD plugins, i.e. create or update the sblvmdplugins directory and create or update the .vmdrc file, proceed as follows with cmake:

> cmake \</path/to/sbl/directory\> -DSBL_VMD_PLUGINS=ON
> make ; make install
Note that the VMD plugins do not require any compilation. That is, the aforementioned install merely installs .tcl files. These plugins call executables from the SBL, found from one's PATH environment variable.


Installing PyMOL plugins

The SBL library provides also PyMOL plugins (details in section PyMOL (Python Based Molecular Visualization System)). The installation works as for the VMD plugins, but using instead the cmake variable SBL_PYMOL_PLUGINS :

> cmake \</path/to/sbl/directory\> -DSBL_PYMOL_PLUGINS=ON
> make ; make install

The previous command looks for a folder .pymol in one's home directory, creates it if necessary, and installs the plugins. It manages the directory architecture used by PyMOL and creates or updates initialization files if necessary.

Note that the PyMOL plugins do not require any compilation. That is, the aforementioned install merely installs .py files. These plugins call executables from the SBL, found from one's PATH environment variable.


Documentation compilation

The documentation is written in Doxygen format, and can be compiled as follows using the script sbl-doc-manager.py from the scripts directory at the root of the project. This script produces the documentation and prints out the path to the index.html file, to be opened with a web browser:

> sbl-doc-manager.py -w <path/to/sbl/directory> -d <path/to/output/directory>

Note that the option -w can be omitted if the environment variable $SBL_DIR is set.

The documentation being written in Doxygen, it can be directly compiled as follows:
> cd
\</path/to/installed/sbl/directory\>/share/doc/SBL; doxygen;
In doing so, the files are generated in the current directory. The benefits of using the aforementioned script is that it also performs a number of house-keeping tasks (moving pictures, creating symbolic links, etc).


Note that some optional post-processing are done internally on the documentation, in particular for adding logos on the short description of the packages. This is done using an internal python script, see the ref sbl-devel-for-sbl-tutorial .