Skip to content

Commit

Permalink
Removing CRAM support
Browse files Browse the repository at this point in the history
  • Loading branch information
pjotrp committed Nov 30, 2020
1 parent 844d899 commit ec78eab
Show file tree
Hide file tree
Showing 28 changed files with 71 additions and 2,755 deletions.
3 changes: 3 additions & 0 deletions .guix-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This command creates a build container for Sambamba using GNU Guix

guix environment -C guix --ad-hoc gcc-toolchain gdb bash ld-wrapper ldc which python git binutils-gold vim zlib
2 changes: 1 addition & 1 deletion BioD
Submodule BioD updated 3 files
+0 −4 Makefile
+179 −0 meson.build
+2 −0 meson_options.txt
25 changes: 14 additions & 11 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
## Sambamba dependencies

* D compiler (ldc)
* BioD (git submodule)
* gcc tool chain (for htslib and lz4)
* htslib (git submodule)
* undeaD (git submodule)
* gcc tool chain (for lz4)
* libz
* liblz4

## Install Sambamba from source

Expand All @@ -22,13 +18,20 @@ and run our development setup (gold was added lately by ldc)

guix environment -C guix --ad-hoc gcc-toolchain gdb bash ld-wrapper ldc which python git binutils-gold vim
make clean
make -j 4
make check
make -f Makefile.guix -j 4
make -f Makefile.guix check

this way all dependencies are isolated.
this way all dependencies are isolated. To create a static release use

## Build Sambamba with Debian
make static

Make sure the environment is minimal with something like
## Development

env -i /bin/bash --login --noprofile --norc
We use GNU Guix containers for development. Install Guix and run a build
container with

. .guix-build
make -f Makefile.guix
make -f Makefile.guix check

Note that this also works in the emacs shell.
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ DFLAGS = -wi -I. -IBioD -g -J.

DLIBS = $(LIBRARY_PATH)/libphobos2-ldc.a $(LIBRARY_PATH)/libdruntime-ldc.a
DLIBS_DEBUG = $(LIBRARY_PATH)/libphobos2-ldc-debug.a $(LIBRARY_PATH)/libdruntime-ldc-debug.a
LIBS = htslib/libhts.a lz4/lib/liblz4.a -L-L$(LIBRARY_PATH) -L-lpthread -L-lm -L-lz
LIBS_STATIC = $(LIBRARY_PATH)/libc.a $(DLIBS) htslib/libhts.a $(LIBRARY_PATH)/liblz4.a -L-lz
SRC = utils/ldc_version_info_.d utils/lz4.d utils/strip_bcf_header.d $(sort $(wildcard BioD/contrib/undead/*.d BioD/contrib/undead/*/*.d)) utils/version_.d $(sort $(wildcard thirdparty/*.d cram/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d BioD/bio/*/*/*/*.d BioD/bio/*/*/*/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d))
LIBS = lz4/lib/liblz4.a -L-L$(LIBRARY_PATH) -L-lpthread -L-lm -L-lz
LIBS_STATIC = $(LIBRARY_PATH)/libc.a $(DLIBS) $(LIBRARY_PATH)/liblz4.a -L-lz
SRC = utils/ldc_version_info_.d utils/lz4.d utils/strip_bcf_header.d $(sort $(wildcard BioD/contrib/undead/*.d BioD/contrib/undead/*/*.d)) utils/version_.d $(sort $(wildcard thirdparty/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d BioD/bio/*/*/*/*.d BioD/bio/*/*/*/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d))
OBJ = $(SRC:.d=.o)
OUT = bin/sambamba-$(shell cat VERSION)

STATIC_LIB_PATH=-Lhtslib -Llz4
STATIC_LIB_PATH=-Llz4

.PHONY: all debug release static clean test

Expand All @@ -61,16 +61,13 @@ lz4-static: lz4/lib/liblz4.a
lz4/lib/liblz4.a: lz4/lib/lz4.c lz4/lib/lz4hc.c lz4/lib/lz4frame.c lz4/lib/xxhash.c
cd lz4/lib && gcc -O3 -c lz4.c lz4hc.c lz4frame.c xxhash.c && $(AR) rcs liblz4.a lz4.o lz4hc.o lz4frame.o xxhash.o

htslib-static:
cd htslib && $(MAKE) -j8

utils/ldc_version_info_.d:
python3 ./gen_ldc_version_info.py $(shell which ldmd2) > utils/ldc_version_info_.d
cat utils/ldc_version_info_.d

ldc_version_info: utils/ldc_version_info_.d

build-setup: ldc_version_info lz4-static htslib-static
build-setup: ldc_version_info lz4-static
mkdir -p bin/

default debug release static: $(OUT)
Expand Down Expand Up @@ -115,7 +112,6 @@ install:
install -m 0755 bin/sambamba $(prefix)/bin

clean: clean-d
cd htslib ; $(MAKE) clean
rm lz4/lib/*.[oa]
rm -f profile.data
rm -f profile.raw
Expand Down
79 changes: 0 additions & 79 deletions Makefile.docker

This file was deleted.

11 changes: 4 additions & 7 deletions Makefile.guix
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ DFLAGS = -wi -I. -I$(BIOD_PATH) -J.
# DLIBS_DEBUG = -debuglib=phobos2-ldc-debug-shared,druntime-ldc-debug-shared -link-debuglib -L-lphobos2-ldc-debug-shared -L-ldruntime-ldc-debug-shared
# RPATH = -L--rpath=$(dir $(realpath $(LDC_LIB_PATH)/libz.so)):$(dir $(realpath $(LDC_LIB_PATH)/liblz4.so))
RPATH = -L--rpath=$(LIBRARY_PATH)
LIBS = htslib/libhts.a -L-L$(LDC_LIB_PATH) -L-lrt -L-lpthread -L-lm -L-lz lz4/lib/liblz4.a
LIBS = -L-L$(LDC_LIB_PATH) -L-lrt -L-lpthread -L-lm -L-lz lz4/lib/liblz4.a

# LIBS = htslib/libhts.a -L-lrt -L-lpthread -L-lm -L-lz -L-llz4
LIBS_STATIC = $(DLIBS) htslib/libhts.a lz4/lib/liblz4.a
SRC = $(wildcard main.d utils/*.d thirdparty/*.d cram/*.d) $(wildcard BioD/contrib/undead/*.d BioD/contrib/undead/*/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d BioD/bio/*/*/*/*.d BioD/bio/*/*/*/*/*.d BioD/bio/*/*/*/*/*/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d)
LIBS_STATIC = $(DLIBS) lz4/lib/liblz4.a
SRC = $(wildcard main.d utils/*.d thirdparty/*.d) $(wildcard BioD/contrib/undead/*.d BioD/contrib/undead/*/*.d) $(wildcard BioD/bio/*/*.d BioD/bio/*/*/*.d BioD/bio/*/*/*/*.d BioD/bio/*/*/*/*/*.d BioD/bio/*/*/*/*/*/*/*.d) $(wildcard sambamba/*.d sambamba/*/*.d sambamba/*/*/*.d)
OBJ = $(SRC:.d=.o) utils/ldc_version_info_.o
OUT = bin/sambamba-$(shell cat VERSION)
static: OUT += -static
Expand Down Expand Up @@ -77,7 +76,7 @@ lz4/lib/liblz4.a: lz4/lib/lz4.c lz4/lib/lz4hc.c lz4/lib/lz4frame.c lz4/lib/xxhas

lz4-static: lz4/lib/liblz4.a

build-setup: ldc_version_info lz4-static htslib-static
build-setup: ldc_version_info lz4-static
mkdir -p bin/

# utils/ldc_version_info_.o: utils/ldc_version_info_.d
Expand All @@ -93,7 +92,6 @@ debug profile release: lz4-static

# ---- Link step
$(OUT): $(OBJ)
cd htslib && $(MAKE) -j 4
mkdir -p bin/
$(D_COMPILER) $(DFLAGS) -of=$(OUT) $(OBJ) $(LIBS)

Expand All @@ -115,7 +113,6 @@ install:
install -m 0755 bin/sambamba $(prefix)/bin

clean-c:
cd htslib ; make clean
rm -v lz4/lib/*.[oa]

clean-d:
Expand Down
107 changes: 0 additions & 107 deletions Makefile.old

This file was deleted.

11 changes: 11 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@

## ChangeLog v0.8.0 (2020??)

Maintainance release and bug fixes: this is a special release where we
removed all CRAM support. The added value of CRAM in sambamba was
limited because it was using essentially the same htslib backend as
samtools. Removing the htslib dependency removes one maintenance
headache. See also https://github.com/biod/sambamba/issues/425

+ Removed CRAM support and htslib dependency

## ChangeLog v0.7.1 (20191128)

+ Fixed major segfault problem that got introduced after ldc 1.10, see https://github.com/biod/sambamba/issues/393
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.1
0.8.0
7 changes: 0 additions & 7 deletions cram/exception.d

This file was deleted.

Loading

0 comments on commit ec78eab

Please sign in to comment.