How to: Build ANGSD

ANGSD can be built using modules provided by CARC but it does take a bit of wrestling with Makefiles. This guide is based on http://www.popgen.dk/angsd/index.php/Installation

Download the source code

wget https://github.com/ANGSD/angsd/archive/0.933.tar.gz
tar xf angsd0.933.tar.gz
cd angsd-0.933

Set environment

module load htslib
module load bzip2
module load zlib
module load curl

Modify Makefile and misc/Makefile

LIBS = -L$(ZLIB_ROOT)/lib  -L$(BZIP2_ROOT)/lib -L$(CURL_ROOT)/lib -lz -lm -lbz2 -llzma -lpthread -lcurl

# Adjust $(HTSSRC) to point to your top-level htslib directory
ifdef HTSSRC
$(info HTSSRC defined)
CPPFLAGS += -I$(ZLIB_ROOT)/include  -I$(BZIP2_ROOT)/include -I$(CURL_ROOT)/include -I$(realpath $(HTSSRC)/include)
LIBS := -L$(realpath $(HTSSRC)/lib) $(LIBS) -lhts
else
$(info HTSSRC not defined, assuming systemwide installation)
LIBS += -lhts
endif

Also modify install prefix on both Makefile and misc/Makefile

prefix = /project/ttrojan_412/software/angsd/0.930

Build

CC=gcc CXX=g++ HTSSRC=$HTSLIB_ROOT make

Install

CC=gcc CXX=g++ HTSSRC=$HTSLIB_ROOT make install
2 Likes