Skip to main content Link Search Menu Expand Document (external link)

Required libraries

Table of contents

  1. Required libraries
    1. HTSlib
    2. Boost
    3. Additional libraries

Required libraries

SHAPEIT5 requires several libraries installed on the system. Here we assume most of the libraries are available, and we focus on two main libraries:

  • HTSlib version >= 1.7: A C library for reading/writing high-throughput sequencing data.
  • BOOST version >= 1.65: A set of peer-reviewed portable C++ source libraries. SHAPEIT5 uses two specific BOOST libraries: iostreams and program_options.


Building HTSlib is straightforward and does not require root privileges. Please refer to the HTSlib documentation for complete details. Here we provide a basic script to install HTSlib v1.16:

tar -xf htslib-1.16.tar.bz2
mv htslib-1.16 htslib
cd htslib
autoheader; autoconf; ./configure; #optional

After this, you’ll find the libhts.a inside your current directory and the include files inside subdirectory: ./include/


As SHAPEIT5 only requires few of the boost libraries, we’ll build the smallest possible boost build, without requiring root privileges. Please refer to the Boost installation instructions for complete details. Here we provide a basic script to the minimal build of Boost v1.73.0 required to run SHAPEIT5:

tar --bzip2 -xf boost_1_73_0.tar.bz2
cd boost_1_73_0
./ --with-libraries=iostreams,program_options --prefix=../boost #where ../boost is your custom boost installation prefix
./b2 install
cd ../boost #change this to the folder you used as --prefix for the bootstrap script

After this, you will also find a copy of the Boost headers in the include/ subdirectory of the installation prefix (our current directory). The Boost static libraries (libboost_iostreams.a and libboost_program_options.a) are found in the subfolder ./lib/ of your installation prefix.

Additional libraries

Make sure that the following standard library flags can be used by g++ on your system:

  • -lz,-lbz2 and -llzma for reading/writing compressed files.
  • -lm for basic math operations.
  • -lpthread for multi-threading

You can do so by checking the outcome of the following commands:

locate -b '\'
locate -b '\'
locate -b '\'
locate -b '\'
locate -b '\'
locate -b '\'

Back to top

Copyright © 2022-2023 Olivier Delaneau | All Rights Reserved | SHAPEIT5 executables and source code are distributed under the MIT license.