diff options
author | h6197627 <44726212+h6197627@users.noreply.github.com> | 2021-04-12 01:02:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-12 01:02:36 +0300 |
commit | 0d3e433862105579a80b791d76f921dcc261928b (patch) | |
tree | 121625f9b7faca3c4849f4d15e37a844314a4ad7 | |
parent | a06bac0c9da0c6fe0a5d03073ff777066f4f63eb (diff) | |
download | numpy-0d3e433862105579a80b791d76f921dcc261928b.tar.gz |
BLD: Negative zero handling with ifort
Fixes https://github.com/scipy/scipy/issues/11339
**What does this implement/fix?**
NumPy/SciPy compiled with Intel Fortran compiler using default flags treats both -0.0 and +0.0 as 0.0, however it is not IEEE 754 compliant and some SciPy logic relies on this -0.0 and +0.0 differentiation.
-rw-r--r-- | numpy/distutils/fcompiler/intel.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/numpy/distutils/fcompiler/intel.py b/numpy/distutils/fcompiler/intel.py index c7b3c2340..e97cadbb1 100644 --- a/numpy/distutils/fcompiler/intel.py +++ b/numpy/distutils/fcompiler/intel.py @@ -59,7 +59,7 @@ class IntelFCompiler(BaseIntelFCompiler): def get_flags_opt(self): # Scipy test failures with -O2 v = self.get_version() mpopt = 'openmp' if v and v < '15' else 'qopenmp' - return ['-fp-model', 'strict', '-O1', '-{}'.format(mpopt)] + return ['-fp-model', 'strict', '-O1', '-assume', 'minus0', '-{}'.format(mpopt)] def get_flags_arch(self): return [] @@ -119,17 +119,6 @@ class IntelEM64TFCompiler(IntelFCompiler): 'ranlib' : ["ranlib"] } - def get_flags(self): - return ['-fPIC'] - - def get_flags_opt(self): # Scipy test failures with -O2 - v = self.get_version() - mpopt = 'openmp' if v and v < '15' else 'qopenmp' - return ['-fp-model', 'strict', '-O1', '-{}'.format(mpopt)] - - def get_flags_arch(self): - return [] - # Is there no difference in the version string between the above compilers # and the Visual compilers? @@ -174,7 +163,7 @@ class IntelVisualFCompiler(BaseIntelFCompiler): return ['/4Yb', '/d2'] def get_flags_opt(self): - return ['/O1'] # Scipy test failures with /O2 + return ['/O1', '/assume:minus0'] # Scipy test failures with /O2 def get_flags_arch(self): return ["/arch:IA32", "/QaxSSE3"] |