summaryrefslogtreecommitdiff
path: root/numpy/distutils
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2012-01-22 00:27:49 -0800
committerMark Wiebe <mwwiebe@gmail.com>2012-02-19 14:19:04 -0800
commitad2ce5946fd27f525cf3ff912e2b19b35f28b676 (patch)
treeebba3f7ed3e4ca7cbdd823ad7e1b65f4ca6c5fb1 /numpy/distutils
parentae3dd3304bc76dfe9f9514c922669feeb50e3073 (diff)
downloadnumpy-ad2ce5946fd27f525cf3ff912e2b19b35f28b676.tar.gz
BLD: Avoid repeatedly testing for the Fortran compiler when it is missing
Diffstat (limited to 'numpy/distutils')
-rw-r--r--numpy/distutils/fcompiler/__init__.py8
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)