From 567e316a090ea3def969b5edd2ac2ce822e21e5d Mon Sep 17 00:00:00 2001 From: Glenn Hickey Date: Mon, 5 Jul 2021 15:26:48 -0400 Subject: [PATCH] revert to upstream master --- Makefile | 13 ++++--------- include/simd_instruction.h | 2 +- src/simd_instruction.h | 2 +- src/utils.c | 10 +++------- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 9fff7ba..132fb0c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ #CC = gcc EXTRA_FLAGS = -Wno-unused-function -Wno-misleading-indentation -CFLAGS += -Wall -O3 $(EXTRA_FLAGS) +CFLAGS = -Wall -O3 $(EXTRA_FLAGS) # for debug ifneq ($(debug),) @@ -8,9 +8,9 @@ ifneq ($(debug),) endif # for gdb ifneq ($(gdb),) - CFLAGS += -Wall -g ${DFLAGS} $(EXTRA_FLAGS) + CFLAGS = -Wall -g ${DFLAGS} $(EXTRA_FLAGS) else - CFLAGS += -Wall -O3 ${DFLAGS} $(EXTRA_FLAGS) + CFLAGS = -Wall -O3 ${DFLAGS} $(EXTRA_FLAGS) endif # for gprof @@ -62,11 +62,6 @@ else ifneq ($(avx512bw),) py_SIMD_FLAG = AVX512BW=1 endif -# Let CACTUS_ARCH override this (it'll add -march to CFLAGS) in order to avoid -march native for more portable binaries -ifneq ($(CACTUS_ARCH),) - SIMD_FLAG = -endif - .c.o: $(CC) -c $(CFLAGS) $< -o $@ @@ -107,7 +102,7 @@ $(SRC_DIR)/simd_abpoa_align.o:$(SRC_DIR)/simd_abpoa_align.c $(SRC_DIR)/abpoa_gra install_py: python/cabpoa.pxd python/pyabpoa.pyx python/README.md ${py_SIMD_FLAG} python setup.py install - + sdist: install_py ${py_SIMD_FLAG} python setup.py sdist #bdist_wheel diff --git a/include/simd_instruction.h b/include/simd_instruction.h index 8395621..202c521 100644 --- a/include/simd_instruction.h +++ b/include/simd_instruction.h @@ -574,7 +574,7 @@ extern "C" { int simd_check(void); -static inline void *SIMDMalloc(size_t size, size_t align) { +static void *SIMDMalloc(size_t size, size_t align) { void *ret = (void*)_mm_malloc(size, align); if (ret == NULL) { fprintf(stderr, "[%s] mm_Malloc fail!\nSize: %ld\n", __func__, size); diff --git a/src/simd_instruction.h b/src/simd_instruction.h index 8395621..202c521 100644 --- a/src/simd_instruction.h +++ b/src/simd_instruction.h @@ -574,7 +574,7 @@ extern "C" { int simd_check(void); -static inline void *SIMDMalloc(size_t size, size_t align) { +static void *SIMDMalloc(size_t size, size_t align) { void *ret = (void*)_mm_malloc(size, align); if (ret == NULL) { fprintf(stderr, "[%s] mm_Malloc fail!\nSize: %ld\n", __func__, size); diff --git a/src/utils.c b/src/utils.c index 83a8595..a5d7f42 100644 --- a/src/utils.c +++ b/src/utils.c @@ -354,9 +354,9 @@ double cputime() double realtime() { struct timeval tp; - //struct timezone tzp; - gettimeofday(&tp, NULL); - return tp.tv_sec*1e6 + tp.tv_usec * 1e-6; + struct timezone tzp; + gettimeofday(&tp, &tzp); + return tp.tv_sec + tp.tv_usec * 1e-6; } long peakrss(void) @@ -393,7 +393,6 @@ void print_format_time(FILE *out) int err_func_format_printf(const char *func, const char *format, ...) { -#ifdef ENABLE_ABPOA_LOG print_format_time(stderr); fprintf(stderr, "[%s] ", func); va_list arg; @@ -405,7 +404,4 @@ int err_func_format_printf(const char *func, const char *format, ...) va_end(arg); if (done < 0) _err_fatal_simple("vfprintf(stderr)", strerror(saveErrno)); return done; -#else - return 0; -#endif }