summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormwtoews <mwtoews@gmail.com>2013-05-26 23:28:50 +1200
committerCharles Harris <charlesr.harris@gmail.com>2013-05-29 08:45:13 -0600
commitd3a7c893439c31ef287daf817dbd0cbe9c5ac16b (patch)
tree05caa339667225e5f1aaecef9e790b81137445ae
parente50475a64050bdea104d39ad2c487e847fe4b031 (diff)
downloadnumpy-d3a7c893439c31ef287daf817dbd0cbe9c5ac16b.tar.gz
BUG: Handle a version string from a custom-built mingw64.
The custom build compiler "GNU Fortran (rubenvb-4.8.0) 4.8.0" was incorrectly parsed as version '-4.8.0' and the flag "-mno-cygwin" was added to the compilation. See http://cens.ioc.ee/pipermail/f2py-users/2010-October/002092.html.
-rw-r--r--numpy/distutils/fcompiler/gnu.py2
-rw-r--r--numpy/distutils/tests/test_fcompiler_gnu.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index 9b4096899..3402319e0 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -41,7 +41,7 @@ class GnuFCompiler(FCompiler):
m = re.match(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.match(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'):
diff --git a/numpy/distutils/tests/test_fcompiler_gnu.py b/numpy/distutils/tests/test_fcompiler_gnu.py
index 5c47edcb9..a0d191819 100644
--- a/numpy/distutils/tests/test_fcompiler_gnu.py
+++ b/numpy/distutils/tests/test_fcompiler_gnu.py
@@ -19,6 +19,7 @@ gfortran_version_strings = [
('GNU Fortran 95 (GCC) 4.1.0', '4.1.0'),
('GNU Fortran 95 (GCC) 4.2.0 20060218 (experimental)', '4.2.0'),
('GNU Fortran (GCC) 4.3.0 20070316 (experimental)', '4.3.0'),
+ ('GNU Fortran (rubenvb-4.8.0) 4.8.0', '4.8.0'),
]
class TestG77Versions(TestCase):