From 2bf55dd714292bbf7c12023a28153a6443a52ec6 Mon Sep 17 00:00:00 2001 From: Oliver Beckstein Date: Wed, 2 Aug 2023 13:40:55 -0700 Subject: [PATCH] Remove -ffast-math compiler flag (#4220) * Fix AtomGroup.center_of_charge(..., unwrap=True) giving inconsistent (but scientifically correct) results on Intel macOS (Issue #4211) * Removed `-ffast-math` compiler flag to avoid potentially incorrect floating point results in MDAnalysis *and* other codes when MDAnalysis shared libraries are loaded --- see https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html (Issues #3821, #4211) --- package/CHANGELOG | 12 +++++++++++- package/setup.py | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package/CHANGELOG b/package/CHANGELOG index 87bcbd87531..b405b1bd796 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -14,11 +14,16 @@ The rules for this file: ------------------------------------------------------------------------------ -??/??/?? IAlibay, jaclark5, MohitKumar020291, orionarcher, xhgchen, ztimol +??/??/?? IAlibay, jaclark5, MohitKumar020291, orionarcher, xhgchen, + ztimol, orbeckst + * 2.6.0 Fixes + * Fix AtomGroup.center_of_charge(..., unwrap=True) giving + inconsistent (but scientifically correct) results on Intel macOS + (Issue #4211) * Fix Boltzmann typo in `units.py` (PR #4214, Issue #4213) * Fix deletion of bond/angle/dihedral types (PR #4003, Issue #4001) * CRD, PQR, and PDBQT writers now write BZ2 and GZ files if requested @@ -30,6 +35,11 @@ Enhancements (Issue #3546) Changes + * Removed `-ffast-math` compiler flag to avoid potentially incorrect + floating point results in MDAnalysis *and* other codes when + MDAnalysis shared libraries are loaded --- see + https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html + (Issues #3821, #4211) * Atom ID representation order updated to match that of associated AtomGroup indices. (PR #4191, Issue #4181) diff --git a/package/setup.py b/package/setup.py index 898ab5b3b92..f6467bc4bc3 100755 --- a/package/setup.py +++ b/package/setup.py @@ -268,7 +268,7 @@ def extensions(config): use_openmp = config.get('use_openmp', default=True) annotate_cython = config.get('annotate_cython', default=False) - extra_compile_args = ['-std=c99', '-ffast-math', '-O3', '-funroll-loops', + extra_compile_args = ['-std=c99', '-O3', '-funroll-loops', '-fsigned-zeros'] # see #2722 define_macros = [] if config.get('debug_cflags', default=False):