Skip to content

Commit af294ef

Browse files
Don't check for SSE2/AVX2 for AArch64
1 parent 3a64536 commit af294ef

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

setup.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@
1313
# determine CPU support for SSE2 and AVX2
1414
cpu_info = cpuinfo.get_cpu_info()
1515
flags = cpu_info.get('flags', [])
16-
have_sse2 = 'sse2' in flags
17-
have_avx2 = 'avx2' in flags
16+
machine = cpuinfo.platform.machine()
17+
18+
# only check for x86 features on x86_64 arch
19+
have_sse2 = False
20+
have_avx2 = False
21+
if machine == 'x86_64':
22+
have_sse2 = 'sse2' in flags
23+
have_avx2 = 'avx2' in flags
24+
1825
disable_sse2 = 'DISABLE_NUMCODECS_SSE2' in os.environ
1926
disable_avx2 = 'DISABLE_NUMCODECS_AVX2' in os.environ
2027

@@ -24,7 +31,7 @@
2431
if have_cflags:
2532
# respect compiler options set by user
2633
pass
27-
elif os.name == 'posix':
34+
elif os.name == 'posix' and machine == 'x86_64':
2835
if disable_sse2:
2936
base_compile_args.append('-mno-sse2')
3037
elif have_sse2:

0 commit comments

Comments
 (0)