How to install Bio++.
See also Bio++ Versions
See also Installation (old page).
- 1 Lastest release : Bio++ 2.0
- 2 Development version
- 3 Older versions
Lastest release : Bio++ 2.0
Bio++ 2.0 packages (libbpp-core, libbpp-seq, etc.) are available in the Ubuntu and Debian standard repositories. They can be installed using your usual package/program manager.
Warning: as of June 30, 2012, there is an issue with the Ubuntu popgen package. If you want to use this part of the library, please use the package from the custom repository instead, or compile from source, or switch to the development version.
Ubuntu/Debian packages (custom repository)
A local repository is available for architectures i386 and amd64, containing additional programs built against the libraries.
Use your favorite apt manager to add the following line to your sources.list :
deb http://biopp.univ-montp2.fr/repos/apt/debian Squeeze main
You will also need to add the key that was used to sign the packages : <source lang="bash"> wget http://biopp.univ-montp2.fr/repos/apt/conf/biopp.gpg.key sudo apt-key add biopp.gpg.key </source>
Reload the packages list and then look for "Bio++" packages. That's all!
RPM packages are available at http://download.opensuse.org/repositories/home:/jdutheil:/Bio++/.
DMG packages are available at http://biopp.univ-montp2.fr/repos/dmg/ (compiled with a MacIntel computer).
Compiling from source
Compiling from source is necessary when superuser rights are not available or to install Bio++ to a non-standard location (useful when several Bio++ versions coexist on a system).
The easiest way to compile from source is to download the Bio++ 2.0 automatic installer, edit the script header to match your system, and run it.
For instance, to download the sources in $HOME/local/bpp/2.0/sources and install the libraries in $HOME/local/bpp/2.0/lib and $HOME/local/bpp/2.0/include, one would enter : <source lang="bash"> bpp_dir=$HOME/local/bpp/2.0 mkdir -p $bpp_dir/sources cd $bpp_dir/sources wget http://biopp.univ-montp2.fr/Download/bpp-setup.sh chmod +x bpp-setup.sh gedit bpp-setup.sh # set PATH_INSTALL to $bpp_dir, on line 16 ./bpp-setup.sh </source>
Download the source archives individually. The compilation and installation procedure is then the same as for compiling the development version.
<source lang="bash"> wget http://biopp.univ-montp2.fr/repos/sources/bpp-core-2.0.3.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-seq-2.0.3.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-phyl-2.0.3.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-popgen-2.0.3.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-raa-2.0.3.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-qt-2.0.2.tar.gz </source>
git and CMake are needed to retrieve and compile the source files. They can be installed through the git and cmake packages in Ubuntu/Debian repositories, and should be present on most servers. You can check whether they are installed on your system simply by typing : <source lang="bash"> git cmake </source>
Installing Bio++ in a custom location greatly helps in compiling and running different programs depending on different Bio++ versions. This section therefore demonstrates how to download the sources in $HOME/local/bpp/dev/sources and install the libraries in $HOME/local/bpp/dev/lib and $HOME/local/bpp/dev/include.
We start by creating the directory : <source lang="bash"> bpp_dir=$HOME/local/bpp/dev/ mkdir -p $bpp_dir/sources </source>
Getting the source files
This is done with git.
You need to download only the components of the library that you want to use. The bpp-core and bpp-seq components are required by all others, which are otherwise independent. (Example is given for bpp-popgen.)
<source lang="bash"> cd $bpp_dir/sources git clone http://biopp.univ-montp2.fr/git/bpp-core git clone http://biopp.univ-montp2.fr/git/bpp-seq git clone http://biopp.univ-montp2.fr/git/bpp-popgen </source>
At this point the sources directory should contain three subdirectories.
Compiling and installing
All desired components must be compiled and installed successively, starting with bpp-core and bpp-seq. Repeat the following steps (example given for bpp-core) : <source lang="bash"> cd bpp-core cmake -D CMAKE_INSTALL_PREFIX=$bpp_dir -D CMAKE_LIBRARY_PATH=$bpp_dir/lib -D CMAKE_INCLUDE_PATH=$bpp_dir/include -D BUILD_TESTING=FALSE ./ # prepare compilation make # compile make install # move files to the installation directory </source>
That's it ! The libraries are now installed. For more information on how to compile and run Bio++ dependent programs, see the Usage pages.
Explanation : CMake can be given internal variables using the -D option. The install directory is specified by the CMake CMAKE_INSTALL_PREFIX variable. Because our install directories are non-standard (eg. not /usr/local/lib), the CMake CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH variables must also be provided (this is actually dispensable for bpp-core given that it does not depend on the other components).
- Environment. If you install lour libraries in a non standard directory, you should tell where the dynamic libraries are. For example, with bash shell, you can add in your .bashrc:
<source lang="bash"> export CPATH=path_to_the_library/include # for compilation export LIBRARY_PATH=path_to_the_library/lib # for compilation export LD_LIBRARY_PATH=path_to_the_library # for execution </source>
- Testing executables. By default, testing executables are compiled in order to be able to be able to check that the libraries function correctly with command make test. However, if Bio++ libraries are not already present on your system, CMake will issue an error because they need the lib to be installed. So the option -D BUILD_TESTING=FALSE is set to skip the compilation of these executables. If you want test programs to be compiled, remove CMakeCache.txt file and remove this option in cmake command.
- Debugging symbols. Usage of a debugger is possible if the option -D CMAKE_BUILD_TYPE=Debug is added to the cmake command line.
- On some systems, 64-bits libraries have to be installed in lib64/ directories instead of just lib/. This can be achieved by passing the -D LIB_SUFFIX=64 option to cmake.
To update the libraries the basic procedure is : <source lang="bash"> cd bpp-core git pull # retrieve changes cmake ./ # update files list make make install </source>
Alternatively, the following script can be used : <source lang="bash">
cd $HOME/local/bpp/dev/sources for d in bpp-core bpp-seq bpp-phyl bpp-popgen bpp-raa bpp-qt; do
if ! -e $d ; then echo -e "Skip $d (does not exist).\n" continue fi echo "Updating $d..." cd $d/ git pull cmake . if make; then echo "Installing..." make install >/dev/null else echo "Compilation error in '$d/'. Abort" cd .. break fi cd ..
Installing a previous version of the libraries is necessary when maintaining or modifying programs that depend on those libraries.
The prefered procedure is to compile from sources. From version 1.9, the installation procedure is the same as for the development version. Source files can be found at http://biopp.univ-montp2.fr/repos/sources/.
<source lang="bash"> wget http://biopp.univ-montp2.fr/repos/sources/bpp-utils-1.5.0.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-numcalc-1.8.0.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-seq-1.7.0.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-phyl-1.9.0.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-popgen-1.5.0.tar.gz </source>
<source lang="bash"> wget http://biopp.univ-montp2.fr/repos/sources/bpp-utils-1.4.0.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-numcalc-1.7.0.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-seq-1.6.0.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-phyl-1.8.0.tar.gz wget http://biopp.univ-montp2.fr/repos/sources/bpp-popgen-1.4.0.tar.gz </source>
Note that version 1.8 uses autotools.