diff options
author | Aron Ahmadia <aron@ahmadia.net> | 2014-02-04 16:04:48 -0500 |
---|---|---|
committer | Aron Ahmadia <aron@ahmadia.net> | 2014-02-04 16:04:48 -0500 |
commit | ed569bfa689a3f58425af2c5007a6779a7f4c4a7 (patch) | |
tree | 6cd025702e5ac6b15cbd94a3dfc8da5adbfaf33e /numpy/distutils/fcompiler/gnu.py | |
parent | b7850701a31127cad8c7399cea6be9cd5f71bec5 (diff) | |
download | numpy-ed569bfa689a3f58425af2c5007a6779a7f4c4a7.tar.gz |
Detect vendor versions of GNU Compilers
Cray and other HPC vendors provide patched versions of the GNU compilers
with modified version strings. Use re.search instead of re.match in the
version detection scripts to account for modified version strings.
Ref: https://github.com/numpy/numpy/issues/4259
Diffstat (limited to 'numpy/distutils/fcompiler/gnu.py')
-rw-r--r-- | numpy/distutils/fcompiler/gnu.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py index 5ee3df2dc..b786c0a46 100644 --- a/numpy/distutils/fcompiler/gnu.py +++ b/numpy/distutils/fcompiler/gnu.py @@ -35,13 +35,13 @@ class GnuFCompiler(FCompiler): def gnu_version_match(self, version_string): """Handle the different versions of GNU fortran compilers""" - m = re.match(r'GNU Fortran', version_string) + m = re.search(r'GNU Fortran', version_string) if not m: return None - m = re.match(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string) + m = re.search(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string) if m: return ('gfortran', m.group(1)) - m = re.match(r'GNU Fortran.*?\-?([0-9-.]+)', version_string) + m = re.search(r'GNU Fortran.*?\-?([0-9-.]+)', version_string) if m: v = m.group(1) if v.startswith('0') or v.startswith('2') or v.startswith('3'): |