Skip to content

Commit

Permalink
Merge tag '1.5.1' into develop
Browse files Browse the repository at this point in the history
Install and use libdeflate with htslib
  • Loading branch information
keiranmraine committed Oct 7, 2020
2 parents 8835fcb + 808b073 commit a70e9fb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ USER root
# need to keep in sync with setup.sh
ARG VER_HTSLIB="1.11"
ARG VER_LIBBW="0.4.4"
ARG VER_LIBDEFLATE="v1.6"

ENV OPT /opt/wtsi-cgp
ENV PATH $OPT/bin:$PATH
Expand Down
1 change: 1 addition & 0 deletions build/opt-build-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export MANPATH=`echo $INST_PATH/man:$INST_PATH/share/man:$MANPATH | perl -pe 's/
set -u

##### cgpBigWig installation
export LFLAGS="-L${INST_PATH}/lib"
make -C c clean
make -C c -j$CPU prefix=$INST_PATH HTSLIB=$INST_PATH/lib
cp bin/bam2bedgraph $INST_PATH/bin/.
Expand Down
18 changes: 17 additions & 1 deletion build/opt-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,30 @@ set -u

##### DEPS for cgpBigWig #####

## libdeflate
if [ ! -e $SETUP_DIR/libdeflate.success ]; then
rm -rf tmp_deflate
mkdir -p tmp_deflate
curl -sSL --retry 10 https://github.com/ebiggers/libdeflate/archive/${VER_LIBDEFLATE}.tar.gz > distro.tar.gz
tar --strip-components 1 -C tmp_deflate -zxf distro.tar.gz
cd tmp_deflate
PREFIX=$INST_PATH make -j$CPU CFLAGS="-fPIC -O3" install
cd ../
rm -rf distro.* tmp_deflate
touch $SETUP_DIR/libdeflate.success
fi

## HTSLIB (tar.bz2)
if [ ! -e $SETUP_DIR/htslib.success ]; then
rm -rf htslib
mkdir -p htslib
curl -sSL --retry 10 https://github.com/samtools/htslib/releases/download/${VER_HTSLIB}/htslib-${VER_HTSLIB}.tar.bz2 > distro.tar.bz2
tar --strip-components 1 -C htslib -jxf distro.tar.bz2
cd htslib
./configure --enable-plugins --enable-libcurl --prefix=$INST_PATH
./configure --enable-plugins --enable-libcurl --prefix=$INST_PATH \
--with-libdeflate \
CPPFLAGS="-I$INST_PATH/include" \
LDFLAGS="-L${INST_PATH}/lib -Wl,-R${INST_PATH}/lib"
make clean
make -j$CPU
make install
Expand Down
4 changes: 2 additions & 2 deletions c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ LFLAGS?= -L$(HTSTMP)
# define any libraries to link into executable:
# if I want to link in libraries (libx.so or libx.a) I use the -llibname
# option, something like (this will link in libmylib.so and libm.so:
LIBS =-lhts -lpthread -lz -lbz2 -llzma -lm -ldl
LIBBWLIBS=-lBigWig -lz -lbz2 -llzma -lcurl -lm -lgnutls -ltasn1 -lhogweed -lnettle -lgmp -lp11-kit
LIBS =-lhts -lpthread -lz -lbz2 -llzma -lm -ldl -ldeflate
LIBBWLIBS=-lBigWig -lz -lbz2 -llzma -lcurl -lm -lgnutls -ltasn1 -lhogweed -lnettle -lgmp -lp11-kit -ldeflate

# define the C source files
#SRCS = ./bam_access.c ./bam_stats_output.c ./bam_stats_calcs.c
Expand Down
1 change: 1 addition & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
# need to keep in sync with Dockerfile
export VER_HTSLIB="1.11"
export VER_LIBBW="0.4.4"
export VER_LIBDEFLATE="v1.6"

if [[ ($# -ne 1 && $# -ne 2) ]] ; then
echo "Please provide an installation path and optionally perl lib paths to allow, e.g."
Expand Down

0 comments on commit a70e9fb

Please sign in to comment.