From ad2ce5946fd27f525cf3ff912e2b19b35f28b676 Mon Sep 17 00:00:00 2001 From: Mark Wiebe Date: Sun, 22 Jan 2012 00:27:49 -0800 Subject: BLD: Avoid repeatedly testing for the Fortran compiler when it is missing --- numpy/distutils/fcompiler/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'numpy') 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) -- cgit v1.2.1