FLAGS += -DSCIP_ROUNDING_FE OFLAGS += -O0 -g CFLAGS += $(GCCWARN) -funit-at-a-time CXXFLAGS += $(GXXWARN) -funit-at-a-time # enable sanitizers if GCC >= 5.0 # the default is to only enable the UndefinedBehaviorSanitizer (SANITIZE=true) # if user specifies SANITIZE=full, then also other sanitizers are enabled GCCVERSION := $(shell $(CC) -dumpversion | cut -f1 -d.) SANITIZE = $(word $(shell expr \( $(GCCVERSION) \>= 5 \) + 1), false, true) ifeq ($(SANITIZE),full) # -fsanitize=address does not work together with -fsanitize=thread # -fsanitize=leak is included in -fsanitize=address, but works together with -fsanitize=thread ifeq ($(PARASCIP),true) # enable ThreadSanitizer (https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual) SANITIZERFLAGS = -fsanitize=thread # enable LeakSanitizer (https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer) SANITIZERFLAGS += -fsanitize=leak else # enable AddressSanitizer (https://github.com/google/sanitizers/wiki/AddressSanitizer) SANITIZERFLAGS = -fsanitize=address endif # enable UndefinedBehaviorSanitizer SANITIZERFLAGS += -fsanitize=undefined -fsanitize=float-cast-overflow -fsanitize=float-divide-by-zero endif ifeq ($(SANITIZE),true) # enable UndefinedBehaviorSanitizer SANITIZERFLAGS = -fsanitize=undefined -fsanitize=float-cast-overflow -fsanitize=float-divide-by-zero # do not enable LeakSanitizer (https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer) # this does not seem to work well together with Criterion # also it may prevents usage of valgrind while also not replacing it #SANITIZERFLAGS += -fsanitize=leak endif CFLAGS += $(SANITIZERFLAGS) CXXFLAGS += $(SANITIZERFLAGS) LDFLAGS += $(SANITIZERFLAGS) ifeq ($(SHARED),true) LIBBUILDFLAGS += $(SANITIZERFLAGS) endif # deprecated SANITZERFLAGS = $(SANITIZERFLAGS)