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-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/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/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 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."