File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ ifndef TOPDIR
9
9
TOPDIR = .
10
10
endif
11
11
12
+ # If ARCH is not set, we use the host system's architecture.
13
+ ifndef ARCH
14
+ ARCH := $(shell uname -m)
15
+ endif
16
+
12
17
# Catch conflicting usage of ARCH in some BSD environments
13
18
ifeq ($(ARCH), amd64)
14
19
override ARCH=x86_64
@@ -137,6 +142,10 @@ endif
137
142
endif
138
143
139
144
145
+ # On x86_64 build getarch with march=native. This is required to detect AVX512 support in getarch.
146
+ ifeq ($(ARCH), x86_64)
147
+ GETARCH_FLAGS += -march=native
148
+ endif
140
149
141
150
142
151
ifdef INTERFACE64
Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ if (($architecture eq "x86") || ($architecture eq "x86_64")) {
240
240
} else {
241
241
$no_avx512 = 0;
242
242
}
243
- unlink (" tmpf.o" );
243
+ unlink (" $ tmpf .o" );
244
244
}
245
245
}
246
246
Original file line number Diff line number Diff line change @@ -65,6 +65,11 @@ if (DEFINED TARGET)
65
65
set (GETARCH_FLAGS "-DFORCE_${TARGET} " )
66
66
endif ()
67
67
68
+ # On x86_64 build getarch with march=native. This is required to detect AVX512 support in getarch.
69
+ if (X86_64 )
70
+ set (GETARCH_FLAGS "${GETARCH_FLAGS} -march=native" )
71
+ endif ()
72
+
68
73
if (INTERFACE64 )
69
74
message (STATUS "Using 64-bit integers." )
70
75
set (GETARCH_FLAGS "${GETARCH_FLAGS} -DUSE64BITINT" )
You can’t perform that action at this time.
0 commit comments