diff options
author | Mark <mwwiebe@gmail.com> | 2012-02-20 12:47:25 -0800 |
---|---|---|
committer | Mark <mwwiebe@gmail.com> | 2012-02-20 12:47:25 -0800 |
commit | d5962f411fb924c2f818ae9df71effb68642f6f2 (patch) | |
tree | 8630950a674c01c8c80c48c71d2db115a9cd9757 | |
parent | 16d49fda2516d5a76f973302db96c751bba8a7ca (diff) | |
parent | ad2ce5946fd27f525cf3ff912e2b19b35f28b676 (diff) | |
download | numpy-d5962f411fb924c2f818ae9df71effb68642f6f2.tar.gz |
Merge pull request #212 from mwiebe/cache-fortran-detect
BLD: Avoid repeatedly testing for the Fortran compiler when it is missing
-rw-r--r-- | numpy/distutils/fcompiler/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/distutils/fcompiler/__init__.py b/numpy/distutils/fcompiler/__init__.py index 550ae208a..d56ea0cd4 100644 --- a/numpy/distutils/fcompiler/__init__.py +++ b/numpy/distutils/fcompiler/__init__.py @@ -814,6 +814,9 @@ def get_default_fcompiler(osname=None, platform=None, requiref90=False, c_compiler=c_compiler) return compiler_type +# Flag to avoid rechecking for Fortran compiler every time +failed_fcompiler = False + def new_fcompiler(plat=None, compiler=None, verbose=0, @@ -824,6 +827,10 @@ def new_fcompiler(plat=None, """Generate an instance of some FCompiler subclass for the supplied platform/compiler combination. """ + global failed_fcompiler + if failed_fcompiler: + return None + load_all_fcompiler_classes() if plat is None: plat = os.name @@ -841,6 +848,7 @@ def new_fcompiler(plat=None, msg = msg + " Supported compilers are: %s)" \ % (','.join(fcompiler_class.keys())) log.warn(msg) + failed_fcompiler = True return None compiler = klass(verbose=verbose, dry_run=dry_run, force=force) |