Installation (Linux & MacOS) - Pa-Tou/stoat GitHub Wiki
Installation
This page describes how to install STOAT and its dependencies on Linux and macOS.
Dependencies
Linux
On Debian/Ubuntu-based systems, install the required dependencies with:
sudo apt-get update
sudo apt-get install build-essential cmake pkg-config \
libjansson-dev protobuf-compiler libprotoc-dev libprotobuf-dev \
libboost-all-dev libhts-dev valgrind
macOS [intel chips]
STOAT uses Homebrew for some of its dependencies.
Install the required Homebrew packages:
brew install libomp htslib boost pkg-config
Protobuf
STOAT requires Protobuf v29.0. Install it locally with:
cd ~/local
git clone --branch v29.0 https://github.com/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-Dprotobuf_BUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX="$HOME/local/protobuf"
cmake --build build --parallel
cmake --install build
Jansson
STOAT requires Jansson v2.14. Install it locally with:
cd ~/local
git clone --branch v2.14 https://github.com/akheron/jansson.git
cd jansson
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$HOME/local/jansson" \
-DJANSSON_BUILD_DOCS=OFF \
-DJANSSON_BUILD_TESTS=OFF
cmake --build build --parallel
cmake --install build
Environment variables
Add the locally installed libraries and Homebrew dependencies to the environment:
export PKG_CONFIG_PATH="$HOME/local/jansson/lib/pkgconfig:$(brew --prefix htslib)/lib/pkgconfig:$PKG_CONFIG_PATH"
export CMAKE_PREFIX_PATH="$HOME/local/protobuf:$HOME/local/jansson:$(brew --prefix htslib):$(brew --prefix boost):$CMAKE_PREFIX_PATH"
These variables must be set before configuring STOAT.
Optional dependencies
- vg — optional
STOAT uses libbdsg and libvgio, both of which depend on libhandlegraph.
STOAT uses its own copies of these libraries. However, if compatible libraries are already installed on your system, version conflicts may occur. In general, the latest versions of these tools should work.
Docker
STOAT can also be built and run using Docker.
- Dockerfile
- Docker image on Quay.io:
quay.io/patou/stoat
Build
Clone the repository with its submodules:
git clone --recursive https://github.com/Pa-Tou/stoat.git
cd stoat
Configure and build STOAT:
cmake -S . -B build
cmake --build build --parallel
The stoat binary will be created in stoat/bin.
From the main STOAT directory, run:
./bin/stoat
Note: STOAT currently uses dynamic compilation on both Linux and macOS.