diff options
author | cookedm <cookedm@localhost> | 2006-03-21 04:14:29 +0000 |
---|---|---|
committer | cookedm <cookedm@localhost> | 2006-03-21 04:14:29 +0000 |
commit | cd5f36dc87fd462bc0391a3f7e13036bf1ad3c40 (patch) | |
tree | b8ee3d1e510600bdc405c38421e08e7f350be0ed | |
parent | 8f28c43e00c6622e6ca654be1652d5a5a77fd28b (diff) | |
download | numpy-cd5f36dc87fd462bc0391a3f7e13036bf1ad3c40.tar.gz |
Better version matching for Sun Fortran, and don't panic when we can't match the version number
-rw-r--r-- | numpy/distutils/ccompiler.py | 5 | ||||
-rw-r--r-- | numpy/distutils/fcompiler/sun.py | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/numpy/distutils/ccompiler.py b/numpy/distutils/ccompiler.py index f10109df5..815a197a1 100644 --- a/numpy/distutils/ccompiler.py +++ b/numpy/distutils/ccompiler.py @@ -253,8 +253,9 @@ def CCompiler_get_version(self, force=0, ok_status=[0]): if status in ok_status: version = matcher(output) if not version: - raise ValueError("compiler version not matched (%r)" % (version,)) - version = LooseVersion(version) + log.warn("Couldn't match compiler version for %r" % (output,)) + else: + version = LooseVersion(version) self.version = version return version diff --git a/numpy/distutils/fcompiler/sun.py b/numpy/distutils/fcompiler/sun.py index 7bfd805ad..a0eaa3da0 100644 --- a/numpy/distutils/fcompiler/sun.py +++ b/numpy/distutils/fcompiler/sun.py @@ -2,12 +2,16 @@ import os import sys from numpy.distutils.cpuinfo import cpu +from numpy.distutils.ccompiler import simple_version_match from numpy.distutils.fcompiler import FCompiler class SunFCompiler(FCompiler): compiler_type = 'sun' - version_pattern = r'(f90|f95): (Sun|Forte Developer 7|WorkShop 6 update \d+) Fortran 95 (?P<version>[^\s]+).*' + # ex: + # f90: Sun WorkShop 6 update 2 Fortran 95 6.2 Patch 111690-10 2003/08/28 + version_match = simple_version_match( + start=r'f9[05]: (Sun|Forte|WorkShop).*Fortran 95') executables = { 'version_cmd' : ["f90", "-V"], |