From 329d9b216cc30413b5cd74d635466f9d5626fc28 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Wed, 14 Oct 2015 23:13:49 +0200 Subject: [PATCH] Only set '-O2' as opt flags on non-windows The current flags include '-march=x86-64', which causes build failures if e.g. scipy is built on ARM. It would be better to rely on the default CFLAGS of the linux distributions instead of adding more flags other than '-O2'. --- numpy/distutils/fcompiler/gnu.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py index 9acbe537d9e6..8f3f8d6add20 100644 --- a/numpy/distutils/fcompiler/gnu.py +++ b/numpy/distutils/fcompiler/gnu.py @@ -217,9 +217,13 @@ def get_flags_opt(self): opt = ['-O2 -march=pentium4 -mtune=generic -mfpmath=sse -msse2' ' -mlong-double-64 -mincoming-stack-boundary=2' ' -ffpe-summary=invalid,zero'] - else: + elif is_win64(): opt = ['-O2 -march=x86-64 -DMS_WIN64 -mtune=generic -msse2' ' -mlong-double-64 -ffpe-summary=invalid,zero'] + else: + # Don't set opt on Linux and rely on CFLAGS of the + # distributions + opt = ['-O2'] else: opt = ['-O2']