From 55d5cf92526823a61b9e1687e293f4c118a9be7a Mon Sep 17 00:00:00 2001 From: Keiran Raine Date: Tue, 6 Oct 2020 18:15:08 +0000 Subject: [PATCH 1/2] htslib with installed libdeflate, issues with cgpbigwig compile to resolve --- Dockerfile | 1 + build/opt-build.sh | 18 +++++++++++++++++- setup.sh | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d560cc9..ecef110 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/build/opt-build.sh b/build/opt-build.sh index a4b0325..ada5730 100755 --- a/build/opt-build.sh +++ b/build/opt-build.sh @@ -52,6 +52,19 @@ 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 @@ -59,7 +72,10 @@ if [ ! -e $SETUP_DIR/htslib.success ]; then 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 diff --git a/setup.sh b/setup.sh index 7024d29..cbe646d 100755 --- a/setup.sh +++ b/setup.sh @@ -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." From 6205fdeb6a3b855501179151c8a94c3e4cff6bdc Mon Sep 17 00:00:00 2001 From: Keiran Raine Date: Wed, 7 Oct 2020 08:57:20 +0000 Subject: [PATCH 2/2] Now builds correctly with some extra flags --- build/opt-build-local.sh | 1 + c/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/opt-build-local.sh b/build/opt-build-local.sh index 028cae3..209b2a9 100755 --- a/build/opt-build-local.sh +++ b/build/opt-build-local.sh @@ -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/. diff --git a/c/Makefile b/c/Makefile index a877fc1..a9f628b 100644 --- a/c/Makefile +++ b/c/Makefile @@ -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