Compilation walkthrough on a fresh Ubuntu 20.04.1 Desktop distribution

This will guide you through compiling and installing QTLtools and all it's dependencies.

1. Install packages that are required to compile HTSlib, R math standalone library, and QTLtools:

sudo apt install g++ gcc gfortran make autoconf automake libtool zlib1g-dev liblzma-dev libbz2-dev lbzip2 libgsl-dev libblas-dev libx11-dev libboost1.71-all-dev git libreadline-dev libxt-dev libpcre2-dev libcurl4-openssl-dev

2. Create a directory for downloads and change to it:

mkdir ~/Tools
cd ~/Tools

3. Download and extract R and HTSlib:

wget https://cran.r-project.org/src/base/R-4/R-4.0.2.tar.gz
wget https://github.com/samtools/htslib/releases/download/1.10.2/htslib-1.10.2.tar.bz2
tar zxvf R-4.0.2.tar.gz
tar jxvf htslib-1.10.2.tar.bz2

4. Compile R standalone math library:

cd ~/Tools/R-4.0.2/
./configure
cd src/nmath/standalone/
make

5. Compile HTSlib:

cd ~/Tools/htslib-1.10.2/
./configure
make

6. Get QTLtools, here using git but you can also download and extract the source code:

cd ~/Tools/
git clone https://github.com/qtltools/qtltools.git
cd qtltools

7. Edit QTLtools Makefile to set the necessary variables:

########################################################
# YOU NEED TO UPDATE THESE 6 PATHS TO COMPILE QTLTOOLS #
########################################################
BOOST_INC=/usr/include
BOOST_LIB=/usr/lib/x86_64-linux-gnu
RMATH_INC=$(HOME)/Tools/R-4.0.2/src/include
RMATH_LIB=$(HOME)/Tools/R-4.0.2/src/nmath/standalone
HTSLD_INC=$(HOME)/Tools/htslib-1.10.2
HTSLD_LIB=$(HOME)/Tools/htslib-1.10.2

8. Compile and install QTLtools

make

# If you do not have root privileges, append ./bin/ & ./scripts/ to $PATH and ./man/ to $MANPATH
# Also add ". ~/Tools/doc/QTLtools_bash_autocomplete.bash" to your .bashrc
# If you are root you can install:

sudo make install
exec bash # necessary to immediately enable autocompletion

9. If you want to clean or uninstall you can:

make clean
sudo make uninstall
Thursday 27th August 2020

Compilation walkthrough on a fresh CentOS 8.2.2004 distribution

This will guide you through compiling and installing QTLtools and all it's dependencies.

1. Install packages that are required to compile HTSlib, R math standalone library, and QTLtools:

sudo dnf config-manager --enable PowerTools
sudo yum install gcc-c++.x86_64 gcc-gfortran.x86_64 autoconf automake libtool zlib-devel.x86_64 xz-devel.x86_64 bzip2-devel.x86_64 gsl-devel.x86_64 blas64.x86_64 libX11-devel.x86_64 libXt-devel-1.1.5-12.el8.x86_64 pcre2-devel.x86_64 libcurl-devel.x86_64 readline-devel.x86_64 boost-devel.x86_64 boost-static.x86_64 git

2. Create a directory for downloads and change to it:

mkdir ~/Tools
cd ~/Tools

3. Download and extract R and HTSlib:

wget https://cran.r-project.org/src/base/R-4/R-4.0.2.tar.gz
wget https://github.com/samtools/htslib/releases/download/1.10.2/htslib-1.10.2.tar.bz2
tar zxvf R-4.0.2.tar.gz
tar jxvf htslib-1.10.2.tar.bz2

4. Compile R standalone math library:

cd ~/Tools/R-4.0.2/
./configure
cd src/nmath/standalone/
make

5. Compile HTSlib:

cd ~/Tools/htslib-1.10.2/
./configure
make

6. Get QTLtools, here using git but you can also download and extract the source code:

cd ~/Tools/
git clone https://github.com/qtltools/qtltools.git
cd qtltools

7. Edit QTLtools Makefile to set the necessary variables:

########################################################
# YOU NEED TO UPDATE THESE 6 PATHS TO COMPILE QTLTOOLS #
########################################################
BOOST_INC=/usr/include
BOOST_LIB=/usr/lib64
RMATH_INC=$(HOME)/Tools/R-4.0.2/src/include
RMATH_LIB=$(HOME)/Tools/R-4.0.2/src/nmath/standalone
HTSLD_INC=$(HOME)/Tools/htslib-1.10.2
HTSLD_LIB=$(HOME)/Tools/htslib-1.10.2

8. Compile and install QTLtools

make

# If you do not have root privileges, append ./bin/ & ./scripts/ to $PATH and ./man/ to $MANPATH
# Also add ". ~/Tools/doc/QTLtools_bash_autocomplete.bash" to your .bashrc
# If you are root you can install:

sudo make install
exec bash # necessary to immediately enable autocompletion

9. If you want to clean or uninstall you can:

make clean
sudo make uninstall
Thursday 27th August 2020

Compilation walkthrough on a fresh MacOS Catalina

This will guide you through compiling and installing QTLtools and all it's dependencies.

1. Install brew package manager:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

2. Install QTLtools dependencies:

brew install R boost gsl htslib groff #groff is optional but is necessary to correctly display the man pages

3. (Optional) Edit the /etc/man.conf file to modify the TBL line to the following:

TBL /usr/local/Cellar/groff/1.22.4/bin/tbl #This is necessary since the tbl in catalina is ancient. Also the groff version 1.22.4 may have changed so modify accordingly.

4. Get QTLtools, here using git but you can also download and extract the source code:

mkdir ~/Tools/
cd ~/Tools/
git clone https://github.com/qtltools/qtltools.git
cd qtltools

5. Edit QTLtools Makefile to set the necessary variables:

########################################################
# YOU NEED TO UPDATE THESE 6 PATHS TO COMPILE QTLTOOLS #
########################################################
BOOST_INC=/usr/local/include
BOOST_LIB=/usr/local/lib
RMATH_INC=/usr/local/include
RMATH_LIB=/usr/local/lib
HTSLD_INC=/usr/local/include
HTSLD_LIB=/usr/local/lib

6. Compile and install QTLtools

make

# If you do not have root privileges, append ./bin/ & ./scripts/ to $PATH and ./man/ to $MANPATH
# Also add ". ~/Tools/doc/QTLtools_bash_autocomplete.bash" to your .bashrc
# If you are root you can install:

sudo make install
exec bash # necessary to immediately enable autocompletion

7. If you want to clean or uninstall you can:

make clean
sudo make uninstall
Thursday 27th August 2020