From d9ff2cd90df9a114701dcd6298ae8439d6648e04 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 13 Jun 2019 23:01:35 +0200 Subject: [PATCH 1/5] Do not force gcc options on non-gcc compilers fixes compile failure with pgi 18.10 as reported on OpenBLAS-users --- Makefile.x86_64 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.x86_64 b/Makefile.x86_64 index 1b7fe3ef4..d23645058 100644 --- a/Makefile.x86_64 +++ b/Makefile.x86_64 @@ -28,11 +28,15 @@ endif ifeq ($(CORE), HASWELL) ifndef DYNAMIC_ARCH ifndef NO_AVX2 +ifeq ($(C_COMPILER), GCC) CCOMMON_OPT += -mavx2 +endif +ifeq $(F_COMPILER), GFORTRAN) FCOMMON_OPT += -mavx2 endif endif endif +endif From 6d3efb2b5829d78926f818496de5572dbd34e64f Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Fri, 14 Jun 2019 08:08:11 +0200 Subject: [PATCH 2/5] Update Makefile.x86_64 --- Makefile.x86_64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.x86_64 b/Makefile.x86_64 index d23645058..99364752f 100644 --- a/Makefile.x86_64 +++ b/Makefile.x86_64 @@ -31,7 +31,7 @@ ifndef NO_AVX2 ifeq ($(C_COMPILER), GCC) CCOMMON_OPT += -mavx2 endif -ifeq $(F_COMPILER), GFORTRAN) +ifeq ($(F_COMPILER), GFORTRAN) FCOMMON_OPT += -mavx2 endif endif From bbd4bb0154b6c4bfc561dce07b71eba7c7fa9013 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 16 Jun 2019 15:04:10 +0200 Subject: [PATCH 3/5] Zero ecx with a mov instruction PGI assembler does not like the initialization in the constraints. --- common_x86_64.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common_x86_64.h b/common_x86_64.h index f59ff6627..9db66b545 100644 --- a/common_x86_64.h +++ b/common_x86_64.h @@ -129,12 +129,13 @@ static __inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx){ *ecx=cpuinfo[2]; *edx=cpuinfo[3]; #else - __asm__ __volatile__("cpuid" + __asm__ __volatile__("mov %%ecx, 0;" + "cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) - : "0" (op), "c"(0)); + : "0" (op)); #endif } From 280552b988e4377d95bc2f77bc07d2c00bb544e2 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sun, 16 Jun 2019 18:35:43 +0200 Subject: [PATCH 4/5] Fix mov syntax --- common_x86_64.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common_x86_64.h b/common_x86_64.h index 9db66b545..c05998d58 100644 --- a/common_x86_64.h +++ b/common_x86_64.h @@ -129,7 +129,7 @@ static __inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx){ *ecx=cpuinfo[2]; *edx=cpuinfo[3]; #else - __asm__ __volatile__("mov %%ecx, 0;" + __asm__ __volatile__("mov $0, %%ecx;" "cpuid" : "=a" (*eax), "=b" (*ebx), From 7684c4f8f8f979ec4d8a563e9b9cb442d9b04a80 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 20 Jun 2019 19:56:01 +0200 Subject: [PATCH 5/5] PGI compiler does not like -march=native --- Makefile.system | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.system b/Makefile.system index 44eacda4b..fcb3cbe33 100644 --- a/Makefile.system +++ b/Makefile.system @@ -144,9 +144,10 @@ endif # On x86_64 build getarch with march=native. This is required to detect AVX512 support in getarch. ifeq ($(ARCH), x86_64) +ifneq ($(C_COMPILER), PGI) GETARCH_FLAGS += -march=native endif - +endif ifdef INTERFACE64 ifneq ($(INTERFACE64), 0)