Skip to content

Commit abea977

Browse files
authored
Merge pull request #2162 from martin-frbg/pgi
Fixes for PGI compiler
2 parents 6b6c9b1 + 7684c4f commit abea977

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

Makefile.system

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ endif
144144

145145
# On x86_64 build getarch with march=native. This is required to detect AVX512 support in getarch.
146146
ifeq ($(ARCH), x86_64)
147+
ifneq ($(C_COMPILER), PGI)
147148
GETARCH_FLAGS += -march=native
148149
endif
149-
150+
endif
150151

151152
ifdef INTERFACE64
152153
ifneq ($(INTERFACE64), 0)

Makefile.x86_64

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ endif
2828
ifeq ($(CORE), HASWELL)
2929
ifndef DYNAMIC_ARCH
3030
ifndef NO_AVX2
31+
ifeq ($(C_COMPILER), GCC)
3132
CCOMMON_OPT += -mavx2
33+
endif
34+
ifeq ($(F_COMPILER), GFORTRAN)
3235
FCOMMON_OPT += -mavx2
3336
endif
3437
endif
3538
endif
39+
endif
3640

3741

3842

common_x86_64.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,13 @@ static __inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx){
129129
*ecx=cpuinfo[2];
130130
*edx=cpuinfo[3];
131131
#else
132-
__asm__ __volatile__("cpuid"
132+
__asm__ __volatile__("mov $0, %%ecx;"
133+
"cpuid"
133134
: "=a" (*eax),
134135
"=b" (*ebx),
135136
"=c" (*ecx),
136137
"=d" (*edx)
137-
: "0" (op), "c"(0));
138+
: "0" (op));
138139
#endif
139140
}
140141

0 commit comments

Comments
 (0)