From 94468fe01bb5236608dabb2c88833f2796cd7e5f Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Thu, 30 Apr 2020 20:32:15 +0100 Subject: [PATCH] fix compiler detection code --- Reducibility_Multiplex/Makefile | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/Reducibility_Multiplex/Makefile b/Reducibility_Multiplex/Makefile index 011cbd7..8a7d111 100644 --- a/Reducibility_Multiplex/Makefile +++ b/Reducibility_Multiplex/Makefile @@ -3,26 +3,33 @@ CFLAGS=-O2 LDFLAGS=-lm -lgmp -lz -IS_CC_GCC=$(shell $(CC) --version 2>/dev/null | grep -Eic 'gcc') -IS_CC_CLANG=$(shell $(CC) --version | grep -Eic '(llvm|clang)') -IS_CC_ICC=$(shell $(CC) --version | grep -Eic 'Intel') +CC_RUNS=$(shell \$($(CC) --version >/dev/null )) +##$(info $$CC_RUNS is [${CC_RUNS}]) +#ifeq ($(CC_RUNS), "") +ifdef CC_RUNS +IS_CC_GCC=$(shell $(CC) --version 2>/dev/null | grep -Eic '(GCC)') +##$(info $$IS_CC_GCC is [${IS_CC_GCC}]) ifneq ($(IS_CC_GCC), 0) # compiler is GCC - CFLAGS+=-fopenmp +CFLAGS+=-fopenmp else -ifneq ($(IS_CC_CLANG), 0) -# compiler is CLANG - LDFLAGS+=-lomp -else -ifneq($(IS_CC_ICC), 0) +IS_CC_ICC=$(shell $(CC) --version 2>/dev/null | grep -Eic 'Intel') +##$(info $$IS_CC_ICC is [${IS_CC_ICC}]) +ifneq ($(IS_CC_ICC), 0) # compiler is Intel icc - CFLAGS+=-qopenmp +CFLAGS+=-qopenmp +else +IS_CC_CLANG=$(shell $(CC) --version 2>/dev/null | grep -Eic '(llvm|clang)') +##$(info $$IS_CC_CLANG is [${IS_CC_CLANG}]) +ifeq ($(IS_CC_CLANG), 1) +# compiler is CLANG +LDFLAGS+=-lomp +endif +endif endif endif - - all: reducibility_complexity clean: