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 dependencices are summarized thereafter.

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 not 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 .

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 for using 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 the corresponding library.

CGAL

The Computational Geometry Algorithms Library (CGAL) provides various central 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 (Third party)

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, and no installation nor setting is necessary. However, if you want to use your own version of the ESBTL library, you can set the environment variable ESBTL_DIR to the root directory of your own version.

MPFI (optional)

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. If MPFI is installed in a non standard location, the <LIBRARY_NAME>_DIR environment variable needs to point to the root directory of the library.

Eigen (optional)

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.

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 tests 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 

Note that in order to have purely static programs, all the libraries must also be available in static mode. 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 is possible to automatically install the VMD plugins by using cmake variable SBL_VMD_PLUGINS :

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

The previous command looks for a folder sblvmdplugins one's home directory, creates it if necessary, and installs the plugins. In addition, it manages an initialization file for VMD called ".vmdrc" indicating where the plugins are installed. This .vmdrc file is located in one's home directory, and created if necessary.

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 .