class documentation

Abstract base class to define the interface that must be implemented by real Fortran compiler classes.

Methods that subclasses may redefine:

update_executables(), find_executables(), get_version() get_flags(), get_flags_opt(), get_flags_arch(), get_flags_debug() get_flags_f77(), get_flags_opt_f77(), get_flags_arch_f77(), get_flags_debug_f77(), get_flags_f90(), get_flags_opt_f90(), get_flags_arch_f90(), get_flags_debug_f90(), get_flags_fix(), get_flags_linker_so()

DON'T call these methods (except get_version) after constructing a compiler instance or inside any other method. All methods, except update_executables() and find_executables(), may call the get_version() method.

After constructing a compiler instance, always call customize(dist=None) method that finalizes compiler construction and makes the following attributes available:

compiler_f77 compiler_f90 compiler_fix linker_so archiver ranlib libraries library_dirs
Method __copy__ Undocumented
Method __init__ Undocumented
Method can_ccompiler_link Check if the given C compiler can link objects produced by this compiler.
Method copy Undocumented
Method customize Customize Fortran compiler.
Method dump_properties Print out the attributes of a compiler instance.
Method find_executables Go through the self.executables dictionary, and attempt to find and assign appropriate executables.
Method get_flags List of flags common to all compiler types.
Method get_flags_ar List of archiver flags.
Method get_flags_arch List of architecture dependent compiler flags.
Method get_flags_debug List of compiler flags to compile with debugging information.
Method get_flags_f77 List of Fortran 77 specific flags.
Method get_flags_f90 List of Fortran 90 specific flags.
Method get_flags_fix List of Fortran 90 fixed format specific flags.
Method get_flags_free List of Fortran 90 free format specific flags.
Method get_flags_linker_exe List of linker flags to build an executable.
Method get_flags_linker_so List of linker flags to build a shared library.
Method get_flags_opt List of architecture independent compiler flags.
Method get_libraries List of compiler libraries.
Method get_library_dirs List of compiler library directories.
Method get_version Undocumented
Method library_dir_option Undocumented
Method library_option Undocumented
Method link Undocumented
Method module_options Undocumented
Method set_command Undocumented
Method set_commands Undocumented
Method set_executable Undocumented
Method update_executables Called at the beginning of customisation. Subclasses should override this if they need to set up the executables dictionary.
Method wrap_unlinkable_objects Convert a set of object files that are not compatible with the default linker, to a file that is compatible.
Class Variable archiver Undocumented
Class Variable c_compiler Undocumented
Class Variable compile_switch Undocumented
Class Variable compiler_aliases Undocumented
Class Variable compiler_f77 Undocumented
Class Variable compiler_f90 Undocumented
Class Variable compiler_fix Undocumented
Class Variable compiler_type Undocumented
Class Variable exe_extension Undocumented
Class Variable extra_f77_compile_args Undocumented
Class Variable extra_f90_compile_args Undocumented
Class Variable language_map Undocumented
Class Variable language_order Undocumented
Class Variable library_switch Undocumented
Class Variable linker_exe Undocumented
Class Variable linker_so Undocumented
Class Variable module_dir_switch Undocumented
Class Variable module_include_switch Undocumented
Class Variable obj_extension Undocumented
Class Variable object_switch Undocumented
Class Variable pic_flags Undocumented
Class Variable possible_executables Undocumented
Class Variable ranlib Undocumented
Class Variable shared_lib_extension Undocumented
Class Variable shared_lib_format Undocumented
Class Variable src_extensions Undocumented
Class Variable static_lib_extension Undocumented
Class Variable static_lib_format Undocumented
Class Variable suggested_f90_compiler Undocumented
Class Variable version_cmd Undocumented
Class Variable version_pattern Undocumented
Instance Variable command_vars Undocumented
Instance Variable distutils_vars Undocumented
Instance Variable executables Undocumented
Instance Variable flag_vars Undocumented
Method _command_property Undocumented
Method _compile Compile 'src' to product 'obj'.
Method _environment_hook Undocumented
Method _get_command_flags Undocumented
Class Variable _exe_cache Undocumented
Class Variable _executable_keys Undocumented
Instance Variable _is_customised Undocumented
def __copy__(self): (source)

Undocumented

def __init__(self, *args, **kw): (source)

Undocumented

def can_ccompiler_link(self, ccompiler): (source)

Check if the given C compiler can link objects produced by this compiler.

def copy(self): (source)

Undocumented

def customize(self, dist=None): (source)

Customize Fortran compiler.

This method gets Fortran compiler specific information from (i) class definition, (ii) environment, (iii) distutils config files, and (iv) command line (later overrides earlier).

This method should be always called after constructing a compiler instance. But not in __init__ because Distribution instance is needed for (iii) and (iv).

def dump_properties(self): (source)

Print out the attributes of a compiler instance.

def find_executables(self): (source)

Go through the self.executables dictionary, and attempt to find and assign appropriate executables.

Executable names are looked for in the environment (environment variables, the distutils.cfg, and command line), the 0th-element of the command list, and the self.possible_executables list.

Also, if the 0th element is "<F77>" or "<F90>", the Fortran 77 or the Fortran 90 compiler executable is used, unless overridden by an environment setting.

Subclasses should call this if overridden.

def get_flags_ar(self): (source)

List of archiver flags.

def get_flags_f77(self): (source)
def get_flags_f90(self): (source)

List of Fortran 90 specific flags.

def get_flags_fix(self): (source)

List of Fortran 90 fixed format specific flags.

def get_flags_linker_exe(self): (source)

List of linker flags to build an executable.

def get_version(self, force=False, ok_status=[0]): (source)
def library_dir_option(self, dir): (source)
def library_option(self, lib): (source)
def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): (source)

Undocumented

def module_options(self, module_dirs, module_build_dir): (source)

Undocumented

def set_command(self, key, value): (source)

Undocumented

def set_commands(self, **kw): (source)

Undocumented

def set_executable(self, key, value): (source)

Undocumented

def update_executables(self): (source)

Called at the beginning of customisation. Subclasses should override this if they need to set up the executables dictionary.

Note that self.find_executables() is run afterwards, so the self.executables dictionary values can contain <F77> or <F90> as the command, which will be replaced by the found F77 or F90 compiler.

def wrap_unlinkable_objects(self, objects, output_dir, extra_dll_dir): (source)

Convert a set of object files that are not compatible with the default linker, to a file that is compatible.

Parameters
objects:listList of object files to include.
output_dir:strOutput directory to place generated object files.
extra_dll_dir:strOutput directory to place extra DLL files that need to be included on Windows.
Returns
list of strconverted_objects - List of converted object files. Note that the number of output files is not necessarily the same as inputs.
archiver = (source)

Undocumented

compiler_f77 = (source)

Undocumented

compiler_f90 = (source)

Undocumented

compiler_fix = (source)

Undocumented

exe_extension: str = (source)

Undocumented

extra_f77_compile_args: list = (source)

Undocumented

extra_f90_compile_args: list = (source)

Undocumented

language_map: dict[str, str] = (source)

Undocumented

language_order: list[str] = (source)

Undocumented

linker_exe = (source)

Undocumented

linker_so = (source)

Undocumented

obj_extension: str = (source)

Undocumented

Undocumented

shared_lib_extension = (source)

Undocumented

shared_lib_format: str = (source)

Undocumented

src_extensions: list[str] = (source)

Undocumented

static_lib_extension: str = (source)
suggested_f90_compiler = (source)

Undocumented

version_cmd = (source)

Undocumented

command_vars = (source)

Undocumented

distutils_vars = (source)

Undocumented

flag_vars = (source)

Undocumented

def _command_property(key): (source)

Undocumented

def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): (source)

Compile 'src' to product 'obj'.

def _environment_hook(self, name, hook_name): (source)

Undocumented

def _get_command_flags(self, key): (source)

Undocumented

_exe_cache: dict = (source)

Undocumented

_executable_keys: list[str] = (source)

Undocumented

_is_customised: bool = (source)

Undocumented