Skip to content

Commit

Permalink
release 1.3.0-14-ga43013f4
Browse files Browse the repository at this point in the history
  • Loading branch information
grizk-illumina committed May 4, 2022
1 parent c87d93a commit 2e0ec68
Show file tree
Hide file tree
Showing 106 changed files with 5,665 additions and 4,722 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Prerequisites
-------------

* CentOS Linux release = 7.6.1810
* gcc-c++ >= 4.8.5-36.el7_6.2
* gcc-c++ >= 7.1
* boost169-devel >= 1.69.0-1.el7
* imake >= 1:3.82-23.el7

Expand Down
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,23 @@

include config.mk

all: $(programs:%=$(BUILD)/%)
all: $(programs:%=$(DRAGEN_OS_BUILD)/%)

.PHONY: clean
clean:
$(RMDIR) $(DRAGEN_OS_BUILD_DIR_BASE)

.PHONY: help
clean:
help: $(DRAGEN_OS_ROOT_DIR)/README.md
cat $<

.PHONY: help-targets
help-targets:
@$(ECHO) 'Default: all'
@$(ECHO) 'Help: help help-targets'
@$(ECHO) 'Cleanup: clean'
@$(ECHO) 'Install: install'
@$(ECHO) 'Libraries: $(library_targets)'

############################################################
##
Expand All @@ -50,7 +57,7 @@ POSTCOMPILE ?= mv -f $(@:%.o=%.Td) $(@:%.o=%.d)
%/.sentinel:
@mkdir -p $* && touch $@

include $(wildcard $(BUILD)/testRunner.d)
include $(wildcard $(DRAGEN_OS_BUILD)/testRunner.d)

# side effects:
# - builds 'libraries' variable required for linking programs, integration and system tests
Expand All @@ -68,7 +75,9 @@ programs_aux:=$(programs)
include $(foreach program, $(programs), $(DRAGEN_OS_MAKE_DIR)/program.mk)

# programs for system tests
ifeq (1,${HAS_GTEST})
include $(DRAGEN_OS_MAKE_DIR)/tests.mk
endif

include $(DRAGEN_OS_MAKE_DIR)/install.mk
endif
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Once you have bioconda installed, you should be able to install Dragmap with `c

Compilation was tested on CentOS 7

* C++11 compatible compiler (e.g gcc-c++ >= 4.8.5-36.el7_6.2)
* C++17 compatible compiler (e.g gcc-c++ >= 7.1)
* GNU make >= 3.82
* Boost library : boost169-devel >= 1.69.0-1.el7
* For unit tests : googletest (>= v1.6)
Expand Down
58 changes: 39 additions & 19 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ endif
#CC=$(GCC_BASE)/bin/gcc
#CXX=$(GCC_BASE)/bin/g++

CC=gcc
CXX=g++
CC?=gcc
CXX?=g++

############################################################
##
Expand Down Expand Up @@ -84,7 +84,8 @@ endif # ifneq(,$(GTEST_ROOT))
##
############################################################

SILENT?=$(if $(VERBOSE),,@)
SILENT?=$(if $(VERBOSE),,@ $(ECHO) making $@; )
SILENT_SE?=$(if $(VERBOSE),,@ $(ECHO) making $$@; )
CAT?=cat
ECHO?=echo
EVAL?=eval
Expand All @@ -105,6 +106,7 @@ endif
DRAGEN_THIRDPARTY?=$(DRAGEN_OS_ROOT_DIR)/thirdparty
DRAGEN_SRC_DIR?=$(DRAGEN_OS_ROOT_DIR)/thirdparty/dragen/src
DRAGEN_STUBS_DIR?=$(DRAGEN_OS_ROOT_DIR)/stubs/dragen/src
BAMTOOLS_STUBS_DIR?=$(DRAGEN_OS_ROOT_DIR)/stubs/bamtools/bamtools-2.4.1
SSW_SRC_DIR?=$(DRAGEN_OS_ROOT_DIR)/thirdparty/sswlib
DRAGEN_OS_SRC_DIR?=$(DRAGEN_OS_ROOT_DIR)/src
DRAGEN_OS_MAKE_DIR?=$(DRAGEN_OS_ROOT_DIR)/make
Expand All @@ -118,13 +120,13 @@ BUILD_TYPE=release
endif
# TODO: add support for differentiating by toolset
DRAGEN_OS_BUILD_DIR?=$(DRAGEN_OS_BUILD_DIR_BASE)/$(BUILD_TYPE)
BUILD:=$(DRAGEN_OS_BUILD_DIR)
DRAGEN_OS_BUILD:=$(DRAGEN_OS_BUILD_DIR)

## List the libraries in the order where they should be statically linked
DRAGEN_OS_LIBS := common options bam fastq sequences io reference map align workflow

## List the libraries from dragen source tree in the order where they should be statically linked
DRAGEN_LIBS := common/hash_generation host/dragen_api/sampling common host/metrics
DRAGEN_LIBS := common/hash_generation host/dragen_api/sampling common host/metrics host/infra/crypto

## List the libraries that pretend the dragen source tree libraries are being linked with rest of dragen source tree
DRAGEN_STUB_LIBS := host/dragen_api host/metrics host/infra/linux
Expand All @@ -145,13 +147,18 @@ endif
# version must be tagged in the git repo
VERSION_STRING?=$(shell git describe --tags --always --abbrev=8 2> /dev/null || echo "UNKNOWN")

CXXWARNINGS=-Werror -Wno-unused-variable -Wno-free-nonheap-object -Wno-parentheses
CWARNINGS?=-Werror -Wno-unused-variable -Wno-unused-function -Wno-format-truncation
CXXSTD?=-std=c++17


CPPFLAGS?=-Wall -ggdb3
#some dragen sources need this
CPPFLAGS += -DLOCAL_BUILD
CPPFLAGS += -D'DRAGEN_OS_VERSION="$(DRAGEN_OS_VERSION)"'
CPPFLAGS += -DVERSION_STRING="$(VERSION_STRING)"
CXXFLAGS?=-std=c++11
CFLAGS?=-std=c99
CXXFLAGS+=$(CXXWARNINGS) $(CXXSTD)
CFLAGS+=$(CWARNINGS)
LDFLAGS?=

ifneq (,$(BOOST_INCLUDEDIR))
Expand All @@ -160,44 +167,57 @@ endif
#CPPFLAGS += -I $(BAMTOOLS_INCLUDEDIR)
CPPFLAGS += -I $(DRAGEN_THIRDPARTY)
CPPFLAGS += -I $(DRAGEN_OS_SRC_DIR)/include
CPPFLAGS += -I $(DRAGEN_SRC_DIR) -I $(DRAGEN_SRC_DIR)/common/public -I $(DRAGEN_SRC_DIR)/host/metrics/public
CPPFLAGS += -I $(DRAGEN_SRC_DIR) -I $(DRAGEN_SRC_DIR)/common/public -I $(DRAGEN_SRC_DIR)/host/dragen_api/sampling
CPPFLAGS += -I $(DRAGEN_SRC_DIR)/host/infra/public -I $(DRAGEN_SRC_DIR)/host/metrics/public
CPPFLAGS += -I $(SSW_SRC_DIR)
CPPFLAGS += -I $(DRAGEN_STUBS_DIR)/host/dragen_api -I $(DRAGEN_STUBS_DIR)/host/dragen_api/dbam
CPPFLAGS += -I $(DRAGEN_STUBS_DIR)/host/dragen_api -I $(DRAGEN_STUBS_DIR)/host/dragen_api/dbam
CPPFLAGS += -I $(DRAGEN_STUBS_DIR)/host/infra/public -I $(DRAGEN_STUBS_DIR)/host/metrics/public
CPPFLAGS += -I $(BAMTOOLS_STUBS_DIR)/include

ifneq (,$(BOOST_LIBRARYDIR))
LDFLAGS += -L $(BOOST_LIBRARYDIR)
endif
LDFLAGS += $(BOOST_LIBRARIES:%=-lboost_%)

CPPFLAGS += -msse4.2 -mavx2
ifdef DEBUG
CPPFLAGS += -O1 -ggdb3 -femit-class-debug-always -fno-omit-frame-pointer
CPPFLAGS += -O0 -ggdb3 -femit-class-debug-always -fno-omit-frame-pointer
ifeq ($(DEBUG),glibc)
ifeq (,$(BOOST_LIBRARYDIR))
$(error BOOST_LIBRARYDIR is not set. make sure that LD_LIBRARY_PATH and BOOST_LIBRARYDIR point to boost built with _GLIBCXX_DEBUG)
endif #ifeq (,$(BOOST_LIBRARYDIR))
CPPFLAGS += -D_GLIBCXX_DEBUG
endif #ifeq ($(DEBUG),glibc)
ifdef ASAN
CPPFLAGS += -fsanitize=address
ifeq ($(ASAN),all)
CPPFLAGS += -fsanitize=leak -fsanitize=undefined # Not supported by g++ 4.8
endif # ifeq ($(ASAN,all)
endif # ASAN
#CPPFLAGS += -pg -fstack-usage -fprofile-arcs -ftest-coverage
LDFLAGS += -lgcov -Wl,--exclude-libs=ALL
else # non DEBUG
#CPPFLAGS += -O3 -march=native # Not particularly great
#CPPFLAGS += -O3 -march=skylake-avx512 # same as above

# this seems to be fastest for fastq parsing. mainly because it manages to put proper PSUBB instruction for subtracing q0 from qscore chars
CPPFLAGS += -Wfatal-errors -g -msse4.2 -O2 -ftree-vectorize -finline-functions -fpredictive-commoning -fgcse-after-reload -funswitch-loops -ftree-slp-vectorize -fvect-cost-model -fipa-cp-clone -ftree-phiprop
CPPFLAGS += -g -O2 -ftree-vectorize -finline-functions -fpredictive-commoning -fgcse-after-reload -funswitch-loops -ftree-slp-vectorize -fvect-cost-model -fipa-cp-clone -ftree-phiprop

# this seems slightly slower than above
#CXXFLAGS += -g -mavx2 -O2 -ftree-vectorize -finline-functions -fpredictive-commoning -fgcse-after-reload -funswitch-loops -ftree-slp-vectorize -fvect-cost-model -fipa-cp-clone -ftree-phiprop
endif # if DEBUG

LDFLAGS+= -lz -lstdc++ -lrt -lgomp -lpthread
ifdef ASAN
CPPFLAGS += -fsanitize=address
ifeq ($(ASAN),all)
CPPFLAGS += -fsanitize=leak -fsanitize=undefined # Not supported by g++ 4.8
endif # ifeq ($(ASAN,all)
endif # ASAN


LDFLAGS+= -lz -lrt -lgomp -lpthread

ifdef STATIC_LIBCPP
LDFLAGS+= -static-libstdc++
else
LDFLAGS+= -lstdc++
endif

#LDFLAGS+= -lz -lstdc++ -lrt -lgomp -lpthread

ifneq (,$(GTEST_INCLUDEDIR))
GTEST_CPPFLAGS+= -I $(GTEST_INCLUDEDIR)
Expand Down Expand Up @@ -233,7 +253,7 @@ all_lib_sources := $(wildcard $(DRAGEN_OS_SRC_DIR)/lib/*/*.cpp)
#all_lib_sources += $(wildcard $(DRAGEN_OS_SRC_DIR)/lib/*/*.c)
found_lib_dirs := $(sort $(patsubst %/, %, $(dir $(all_lib_sources:$(DRAGEN_OS_SRC_DIR)/lib/%=%))))
all_dragen_lib_sources += $(wildcard $(DRAGEN_SRC_DIR)/*/*/*.cpp) $(wildcard $(DRAGEN_SRC_DIR)/*/*/*/*.cpp)
all_dragen_lib_sources += $(wildcard $(DRAGEN_SRC_DIR)/*/*/*.c)
all_dragen_lib_sources += $(wildcard $(DRAGEN_SRC_DIR)/*/*/*.c) $(wildcard $(DRAGEN_SRC_DIR)/*/*/*/*.c)
found_dragen_lib_dirs := $(sort $(patsubst %/, %, $(dir $(all_dragen_lib_sources:$(DRAGEN_SRC_DIR)/%=%))))
ifneq ($(sort $(DRAGEN_OS_LIBS) $(DRAGEN_LIBS)),$(sort $(found_lib_dirs) $(found_dragen_lib_dirs)))
$(error found libraries: $(sort $(found_dragen_lib_dirs) $(found_lib_dirs)): expected libraries: $(sort $(DRAGEN_OS_LIBS) $(DRAGEN_LIBS)): verify that the DRAGEN_OS_LIBS and DRAGEN_LIBS variables in config.mk lists the correct libraries)
Expand Down
35 changes: 0 additions & 35 deletions make/compare.mk

This file was deleted.

30 changes: 12 additions & 18 deletions make/dragen_lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ endif

lib_sources := $(wildcard $(DRAGEN_SRC_DIR)/$(lib_dir)/*.cpp)
lib_c_sources := $(wildcard $(DRAGEN_SRC_DIR)/$(lib_dir)/*.c)
lib_objects := $(lib_sources:$(DRAGEN_SRC_DIR)/$(lib_dir)/%.cpp=$(BUILD)/drgn_$(lib_dir)/%.o)
lib_objects += $(lib_c_sources:$(DRAGEN_SRC_DIR)/$(lib_dir)/%.c=$(BUILD)/drgn_$(lib_dir)/%.o)
lib_objects := $(lib_sources:$(DRAGEN_SRC_DIR)/$(lib_dir)/%.cpp=$(DRAGEN_OS_BUILD)/drgn_$(lib_dir)/%.o)
lib_objects += $(lib_c_sources:$(DRAGEN_SRC_DIR)/$(lib_dir)/%.c=$(DRAGEN_OS_BUILD)/drgn_$(lib_dir)/%.o)

include $(wildcard $(lib_objects:%.o=%.d))

Expand All @@ -24,28 +24,22 @@ include $(wildcard $(lib_objects:%.o=%.d))
#
#
###
$(BUILD)/drgn_$(lib_dir).a: lib_objects:=$(lib_objects)
$(BUILD)/drgn_$(lib_dir).a: $(lib_objects)
$(AR) crfs $@ $(lib_objects)

#$(BUILD)/$(lib_dir)/%.o: $(DRAGEN_OS_SRC_DIR)/lib/$(lib_dir)/%.cpp $(BUILD)/$(lib_dir)/%.d $(BUILD)/$(lib_dir)/.sentinel
# $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
# $(POSTCOMPILE)
$(DRAGEN_OS_BUILD)/drgn_$(lib_dir).a: lib_objects:=$(lib_objects)
$(DRAGEN_OS_BUILD)/drgn_$(lib_dir).a: $(lib_objects)
$(SILENT) $(AR) crfs $@ $(lib_objects)

# Note: the dependency on $(libraries) is to force the order of compilation to be the same as the order of declaration of the libraries
$(BUILD)/drgn_$(lib_dir)/%.o: lib_dir:=$(lib_dir)
$(BUILD)/drgn_$(lib_dir)/%.o: $(DRAGEN_SRC_DIR)/$(lib_dir)/%.cpp $(BUILD)/drgn_$(lib_dir)/%.d $(BUILD)/drgn_$(lib_dir)/.sentinel $(libraries)
$(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(DRAGEN_OS_FLAGS) -c -o $@ $<
$(POSTCOMPILE)
$(DRAGEN_OS_BUILD)/drgn_$(lib_dir)/%.o: lib_dir:=$(lib_dir)
$(DRAGEN_OS_BUILD)/drgn_$(lib_dir)/%.o: $(DRAGEN_SRC_DIR)/$(lib_dir)/%.cpp $(DRAGEN_OS_BUILD)/drgn_$(lib_dir)/%.d $(DRAGEN_OS_BUILD)/drgn_$(lib_dir)/.sentinel
$(SILENT) $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(DRAGEN_OS_FLAGS) -c -o $@ $< && $(POSTCOMPILE)

$(BUILD)/drgn_$(lib_dir)/%.o: $(DRAGEN_SRC_DIR)/$(lib_dir)/%.c $(BUILD)/drgn_$(lib_dir)/%.d $(BUILD)/drgn_$(lib_dir)/.sentinel $(libraries)
$(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $(DRAGEN_OS_FLAGS) -c -o $@ $<
$(POSTCOMPILE)
$(DRAGEN_OS_BUILD)/drgn_$(lib_dir)/%.o: $(DRAGEN_SRC_DIR)/$(lib_dir)/%.c $(DRAGEN_OS_BUILD)/drgn_$(lib_dir)/%.d $(DRAGEN_OS_BUILD)/drgn_$(lib_dir)/.sentinel
$(SILENT) $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) $(DRAGEN_OS_FLAGS) -c -o $@ $< && $(POSTCOMPILE)

#$(BUILD)/$(lib_dir)/%.d: ;
#$(DRAGEN_OS_BUILD)/$(lib_dir)/%.d: ;


###
# must be built in reverse order for linking
###
libraries := $(BUILD)/drgn_$(lib_dir).a $(libraries)
libraries := $(DRAGEN_OS_BUILD)/drgn_$(lib_dir).a $(libraries)
28 changes: 13 additions & 15 deletions make/dragen_stub_lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ endif

lib_sources := $(wildcard $(DRAGEN_STUBS_DIR)/$(lib_dir)/*.cpp)
lib_c_sources := $(wildcard $(DRAGEN_STUBS_DIR)/$(lib_dir)/*.c)
lib_objects := $(lib_sources:$(DRAGEN_STUBS_DIR)/$(lib_dir)/%.cpp=$(BUILD)/stub_$(lib_dir)/%.o)
lib_objects += $(lib_c_sources:$(DRAGEN_STUBS_DIR)/$(lib_dir)/%.c=$(BUILD)/stub_$(lib_dir)/%.o)
lib_objects := $(lib_sources:$(DRAGEN_STUBS_DIR)/$(lib_dir)/%.cpp=$(DRAGEN_OS_BUILD)/stub_$(lib_dir)/%.o)
lib_objects += $(lib_c_sources:$(DRAGEN_STUBS_DIR)/$(lib_dir)/%.c=$(DRAGEN_OS_BUILD)/stub_$(lib_dir)/%.o)

include $(wildcard $(lib_objects:%.o=%.d))

Expand All @@ -22,28 +22,26 @@ include $(wildcard $(lib_objects:%.o=%.d))
#
#
###
$(BUILD)/stub_$(lib_dir).a: lib_objects:=$(lib_objects)
$(BUILD)/stub_$(lib_dir).a: $(lib_objects)
$(AR) crfs $@ $(lib_objects)
$(DRAGEN_OS_BUILD)/stub_$(lib_dir).a: lib_objects:=$(lib_objects)
$(DRAGEN_OS_BUILD)/stub_$(lib_dir).a: $(lib_objects)
$(SILENT) $(AR) crfs $@ $(lib_objects)

#$(BUILD)/$(lib_dir)/%.o: $(DRAGEN_OS_SRC_DIR)/lib/$(lib_dir)/%.cpp $(BUILD)/$(lib_dir)/%.d $(BUILD)/$(lib_dir)/.sentinel
#$(DRAGEN_OS_BUILD)/$(lib_dir)/%.o: $(DRAGEN_OS_SRC_DIR)/lib/$(lib_dir)/%.cpp $(DRAGEN_OS_BUILD)/$(lib_dir)/%.d $(DRAGEN_OS_BUILD)/$(lib_dir)/.sentinel
# $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
# $(POSTCOMPILE)

# Note: the dependency on $(libraries) is to force the order of compilation to be the same as the order of declaration of the libraries
$(BUILD)/stub_$(lib_dir)/%.o: lib_dir:=$(lib_dir)
$(BUILD)/stub_$(lib_dir)/%.o: $(DRAGEN_STUBS_DIR)/$(lib_dir)/%.cpp $(BUILD)/stub_$(lib_dir)/%.d $(BUILD)/stub_$(lib_dir)/.sentinel $(libraries)
$(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
$(POSTCOMPILE)
$(DRAGEN_OS_BUILD)/stub_$(lib_dir)/%.o: lib_dir:=$(lib_dir)
$(DRAGEN_OS_BUILD)/stub_$(lib_dir)/%.o: $(DRAGEN_STUBS_DIR)/$(lib_dir)/%.cpp $(DRAGEN_OS_BUILD)/stub_$(lib_dir)/%.d $(DRAGEN_OS_BUILD)/stub_$(lib_dir)/.sentinel
$(SILENT) $(CXX) $(DEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $< && $(POSTCOMPILE)

$(BUILD)/stub_$(lib_dir)/%.o: $(DRAGEN_STUBS_DIR)/stub_$(lib_dir)/%.c $(BUILD)/$(lib_dir)/%.d $(BUILD)/stub_$(lib_dir)/.sentinel $(libraries)
$(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
$(POSTCOMPILE)
$(DRAGEN_OS_BUILD)/stub_$(lib_dir)/%.o: $(DRAGEN_STUBS_DIR)/stub_$(lib_dir)/%.c $(DRAGEN_OS_BUILD)/$(lib_dir)/%.d $(DRAGEN_OS_BUILD)/stub_$(lib_dir)/.sentinel
$(SILENT) $(CC) $(DEPFLAGS) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< && $(POSTCOMPILE)

#$(BUILD)/$(lib_dir)/%.d: ;
#$(DRAGEN_OS_BUILD)/$(lib_dir)/%.d: ;


###
# must be built in reverse order for linking
###
libraries := $(BUILD)/stub_$(lib_dir).a $(libraries)
libraries := $(DRAGEN_OS_BUILD)/stub_$(lib_dir).a $(libraries)
2 changes: 1 addition & 1 deletion make/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ bindir?=/bin

install: $(programs:%=install_%)

install_%: $(BUILD)/%
install_%: $(DRAGEN_OS_BUILD)/%
$(INSTALL) $< $(DESTDIR)$(bindir)/$*

Loading

0 comments on commit 2e0ec68

Please sign in to comment.