Skip to content

Building from source

Hannes Hauswedell edited this page Nov 22, 2017 · 23 revisions

Versions

This is a overview of the main versions of Lambda:

Repository Branch Description Versions Build state
github.com/seqan/lambda master stable (recommended) 0.9.* - 1.0.*
github.com/seqan/lambda lambda-next experimental 1.9.* - 2.0.*
github.com/h-2/seqan/ feature/lambda initially published 0.4.*

Getting the source

Either download the source from the releases page as lambda-lambda-vX.Y.Z.tar.gz and unzip the file:

% tar xzf lambda-lambda-vX.Y.Z.tar.gz

Or check out the desired branch with git:

% git clone --recursive [-b BRANCHNAME] https://github.com/seqan/lambda.git

Before you checkout the branch, make sure that it is in a buildable state [green indicator in the table above]. If not use the latest release!

If you want to use a locally installed version of the SeqAn library, remove the --recursive from the call.

Build requirements

  • platforms: Linux, FreeBSD, MacOS X or OpenBSD (only 64bit tested for each)
  • compilers: gcc ≥ 4.9.1, clang ≥ 3.8.0 or icc ≥ 16.0.2 (GCC is recommended)
  • cmake ≥ 3.0.0

Other platforms are currently not a priority, but I do accept patches if they don't break anything else.

Build instructions

% mkdir -p lambda-build/release
% cd lambda-build/release
% cmake ../../lambda              # or in the case of a release ../../lambda-lambda-vX.Y.Z
% make -j2

Please be aware that due to excessive use of templating and compile-time optimizations the build might take well over 10min around 5min. macOS builds are slower and can take more than 15min.

If your most recent version of GCC is not the default, you have to specify the path. In many setups you then also need to adjust the paths to standard libraries, e.g.

% cmake ../../lambda \
-DCMAKE_CXX_COMPILER="/path/to/gcc_install/bin/g++" \
-DCMAKE_CXX_FLAGS="-L/path/to/gcc_install/lib64/" \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath=/path/to/gcc_install/lib64/"

Build options

NAME description default since
LAMBDA_FASTBUILD Setting this is useful for debugging, because the build will be faster. Only BLASTP and BLASTX support will be built. off 0.9.0
LAMBDA_MMAPPED_DB Use memory-mapped IO to access the database. on 0.9.1
LAMBDA_LINGAPS_OPT This activates optimized codepaths for linear gaps costs (i.e. additional gap open cost == 0). It has no drawbacks other than increased compile time and binary size. off 1.0.0
LAMBDA_LONG_PROTEIN_SUBJ_SEQS Make max protein sequence length == 4.3billion instead of 65,535. If you set this all previously built indexes will be incompatible! off 1.9.2
LAMBDA_NATIVE_BUILD Deactivating this will disable CPU-specific optimization, but in return your binary will work on different hardware than the one you are building from. on 0.9.0
LAMBDA_STATIC_BUILD Activate to include all libs in the binary. This will result in a bigger binary but in return work on different software than the one you are building from (e.g. compiler and OS version). off 0.9.0

To build portable binaries of Lambda, deactivate native builds and activate static builds, i.e. pass -DLAMBDA_NATIVE_BUILD=0 -DLAMBDA_STATIC_BUILD=1 to cmake.

Please note that it is not possible to build completely static binaries on Mac OS X, but the the flag at least packages the compiler specific bits into the binary.