Building from Source

Unless you really need to build Seq for whatever reason, we strongly recommend using pre-built binaries.



Platform-independent notes

Ideally, you should build Seq with LLVM-Tapir 6.0.

However, there are no pre-compiled binaries for LLVM-Tapir 6.0, and you need to build it yourself. In order to do so, please consult the before_install section of our Travis script.

Building LLVM takes a lot of time (expect one hour at least). If you are in a rush, just use a system-provided LLVM distribution. However, please be advised that in that case:

  1. multi-threading will not work, and

  2. performance might be negatively affected for versions other than LLVM 6.0 due to a coroutine regression bug (also discussed here).

OPAM can also be problematic: if you get into any trouble with OCaml/OPAM, get the latest version of OPAM through:

sh <(curl -sL


Install the dependencies via:

brew install cmake pkg-config llvm@6 opam libffi zlib bzip2 python git xz


Install the dependencies via:

apt install cmake pkg-config llvm-6.0 zlib1g-dev libbz2-dev libffi-dev python3 git liblzma-dev m4 unzip

To install OPAM, do

sh <(curl -sL


Install the dependencies via:

yum install cmake pkg-config llvm-toolset llvm-devel llvm-static zlib-devel bzip2-devel libffi-devel python3 git bubblewrap unzip xz-devel

To install OPAM, do

sh <(curl -sL

You might need to enable the devtools repository to be able to install LLVM. As instructions depend on your CentOS/RHEL version, please consult the distribution manual.

OPAM setup

To set up OPAM, do:

opam init --bare
opam switch install 4.08.1
eval $(opam env)
opam install core dune menhir ctypes ctypes-foreign ppx_deriving

If OPAM keeps complaining about missing bwrap or bubblewrap and your distribution does not contain such packages, run:

opam init --bare --disable-sandboxing


First prepare the environment:

mkdir seq/build
cd seq/build

Then build the necessary dependencies:

# Build bdw-gc
curl -L | tar zxvf -
cd gc-8.0.4
mkdir -p release
./configure --prefix=`pwd`/release --enable-threads=posix --enable-cplusplus --enable-thread-local-alloc --enable-large-config
make LDFLAGS="-static"
make install
cd ..

# Build HTSlib
curl -L | tar jxvf -
cd htslib-1.9
./configure CFLAGS="-fPIC" --disable-libcurl
cd ..

Then build Seq via:

cmake .. -DLLVM_DIR=`llvm-config --cmakedir` -DHTS_LIB=htslib-1.9/libhts.a -DGC_LIB=gc-8.0.4/release/lib/libgc.a
CPATH=gc-8.0.4/release/include:htslib-1.9 cmake --build .

This will produce a seqc executable for compiling/running Seq programs, and a seqtest executable for running the test suite.


Sphinx (with the RTD theme), Breathe and Exhale are required to compile the documentation. Once these are installed, just:

cd seq/docs/sphinx
make html

You can then open _build/html/index.html with your browser.