MCPcopy Create free account
hub / github.com/numpy/numpy / new_fcompiler

Function new_fcompiler

numpy/distutils/fcompiler/__init__.py:873–910  ·  view source on GitHub ↗

Generate an instance of some FCompiler subclass for the supplied platform/compiler combination.

(plat=None,
                  compiler=None,
                  verbose=0,
                  dry_run=0,
                  force=0,
                  requiref90=False,
                  c_compiler = None)

Source from the content-addressed store, hash-verified

871failed_fcompilers = set()
872
873def new_fcompiler(plat=None,
874 compiler=None,
875 verbose=0,
876 dry_run=0,
877 force=0,
878 requiref90=False,
879 c_compiler = None):
880 """Generate an instance of some FCompiler subclass for the supplied
881 platform/compiler combination.
882 """
883 global failed_fcompilers
884 fcompiler_key = (plat, compiler)
885 if fcompiler_key in failed_fcompilers:
886 return None
887
888 load_all_fcompiler_classes()
889 if plat is None:
890 plat = os.name
891 if compiler is None:
892 compiler = get_default_fcompiler(plat, requiref90=requiref90,
893 c_compiler=c_compiler)
894 if compiler in fcompiler_class:
895 module_name, klass, long_description = fcompiler_class[compiler]
896 elif compiler in fcompiler_aliases:
897 module_name, klass, long_description = fcompiler_aliases[compiler]
898 else:
899 msg = "don't know how to compile Fortran code on platform '%s'" % plat
900 if compiler is not None:
901 msg = msg + " with '%s' compiler." % compiler
902 msg = msg + " Supported compilers are: %s)" \
903 % (','.join(fcompiler_class.keys()))
904 log.warn(msg)
905 failed_fcompilers.add(fcompiler_key)
906 return None
907
908 compiler = klass(verbose=verbose, dry_run=dry_run, force=force)
909 compiler.c_compiler = c_compiler
910 return compiler
911
912def show_fcompilers(dist=None):
913 """Print list of available compilers (used by the "--help-fcompiler"

Callers 8

customized_fcompilerFunction · 0.90
_calc_infoMethod · 0.90
_check_compilerMethod · 0.90
runMethod · 0.90
runMethod · 0.90
build_a_libraryMethod · 0.90
_find_existing_fcompilerFunction · 0.85
show_fcompilersFunction · 0.85

Calls 6

get_default_fcompilerFunction · 0.85
keysMethod · 0.80
warnMethod · 0.80
joinMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected