module documentation

Undocumented

Function CCompiler_compile Compile one or more source files.
Function CCompiler_customize Do any platform-specific customization of a compiler instance.
Function CCompiler_customize_cmd Customize compiler using distutils command.
Function CCompiler_cxx_compiler Return the C++ compiler.
Function CCompiler_find_executables Does nothing here, but is called by the get_version method and can be overridden by subclasses. In particular it is redefined in the FCompiler class where more documentation can be found.
Function CCompiler_get_version Return compiler version, or None if compiler is not available.
Function CCompiler_object_filenames Return the name of the object files for the given source files.
Function CCompiler_show_customization Print the compiler customizations to stdout.
Function CCompiler_spawn Execute a command in a sub-process.
Function gen_lib_options Undocumented
Function new_compiler Undocumented
Function replace_method Undocumented
Function simple_version_match Simple matching of version numbers, for use in CCompiler and FCompiler.
Function _compiler_to_string Undocumented
Function _needs_build Check if an objects needs to be rebuild based on its dependencies
Variable _global_lock Undocumented
Variable _job_semaphore Undocumented
Variable _m Undocumented
Variable _processing_files Undocumented
def CCompiler_compile(self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None, depends=None): (source)

Compile one or more source files.

Please refer to the Python distutils API reference for more details.

Parameters
selfUndocumented
sources:list of strA list of filenames
output_dir:str, optionalPath to the output directory.
macros:list of tuplesA list of macro definitions.
include_dirs:list of str, optionalThe directories to add to the default include file search path for this compilation only.
debug:bool, optionalWhether or not to output debug symbols in or alongside the object file(s).
extra_preargs:?Extra pre- and post-arguments.
extra_postargs:?Extra pre- and post-arguments.
depends:list of str, optionalA list of file names that all targets depend on.
Returns
list of strobjects - A list of object file names, one per source file sources.
Raises
CompileErrorIf compilation fails.
def CCompiler_customize(self, dist, need_cxx=0): (source)

Do any platform-specific customization of a compiler instance.

This method calls distutils.sysconfig.customize_compiler for platform-specific customization, as well as optionally remove a flag to suppress spurious warnings in case C++ code is being compiled.

Notes

All the default options used by distutils can be extracted with:

from distutils import sysconfig
sysconfig.get_config_vars('CC', 'CXX', 'OPT', 'BASECFLAGS',
                          'CCSHARED', 'LDSHARED', 'SO')
Parameters
selfUndocumented
dist:objectThis parameter is not used for anything.
need_cxx:bool, optionalWhether or not C++ has to be compiled. If so (True), the "-Wstrict-prototypes" option is removed to prevent spurious warnings. Default is False.
Returns
NoneUndocumented
def CCompiler_customize_cmd(self, cmd, ignore=()): (source)

Customize compiler using distutils command.

Parameters
selfUndocumented
cmd:class instanceAn instance inheriting from distutils.cmd.Command.
ignore:sequence of str, optionalList of CCompiler commands (without 'set_') that should not be altered. Strings that are checked for are: ('include_dirs', 'define', 'undef', 'libraries', 'library_dirs', 'rpath', 'link_objects').
Returns
NoneUndocumented
def CCompiler_cxx_compiler(self): (source)

Return the C++ compiler.

Parameters
selfUndocumented
None
Returns
class instancecxx - The C++ compiler, as a CCompiler instance.
def CCompiler_find_executables(self): (source)

Does nothing here, but is called by the get_version method and can be overridden by subclasses. In particular it is redefined in the FCompiler class where more documentation can be found.

def CCompiler_get_version(self, force=False, ok_status=[0]): (source)

Return compiler version, or None if compiler is not available.

Parameters
selfUndocumented
force:bool, optionalIf True, force a new determination of the version, even if the compiler already has a version attribute. Default is False.
ok_status:list of int, optionalThe list of status values returned by the version look-up process for which a version string is returned. If the status value is not in ok_status, None is returned. Default is [0].
Returns
str or Noneversion - Version string, in the format of distutils.version.LooseVersion.
def CCompiler_object_filenames(self, source_filenames, strip_dir=0, output_dir=''): (source)

Return the name of the object files for the given source files.

Parameters
selfUndocumented
source_filenames:list of strThe list of paths to source files. Paths can be either relative or absolute, this is handled transparently.
strip_dir:bool, optionalWhether to strip the directory from the returned paths. If True, the file name prepended by output_dir is returned. Default is False.
output_dir:str, optionalIf given, this path is prepended to the returned paths to the object files.
Returns
list of strobj_names - The list of paths to the object files corresponding to the source files in source_filenames.
def CCompiler_show_customization(self): (source)

Print the compiler customizations to stdout.

Notes

Printing is only done if the distutils log threshold is < 2.

Parameters
selfUndocumented
None
Returns
NoneUndocumented
def CCompiler_spawn(self, cmd, display=None, env=None): (source)

Execute a command in a sub-process.

Parameters
selfUndocumented
cmd:strThe command to execute.
display:str or sequence of str, optionalThe text to add to the log file kept by numpy.distutils. If not given, display is equal to cmd.
env:a dictionary for environment variables, optional
Returns
NoneUndocumented
Raises
DistutilsExecErrorIf the command failed, i.e. the exit status was not 0.
def gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries): (source)

Undocumented

def new_compiler(plat=None, compiler=None, verbose=None, dry_run=0, force=0): (source)

Undocumented

def replace_method(klass, method_name, func): (source)

Undocumented

def simple_version_match(pat='[-.\\d]+', ignore='', start=''): (source)

Simple matching of version numbers, for use in CCompiler and FCompiler.

Parameters
pat:str, optionalA regular expression matching version numbers. Default is r'[-.\d]+'.
ignore:str, optionalA regular expression matching patterns to skip. Default is '', in which case nothing is skipped.
start:str, optionalA regular expression matching the start of where to start looking for version numbers. Default is '', in which case searching is started at the beginning of the version string given to matcher.
Returns
callablematcher - A function that is appropriate to use as the .version_match attribute of a CCompiler class. matcher takes a single parameter, a version string.
def _compiler_to_string(compiler): (source)

Undocumented

def _needs_build(obj, cc_args, extra_postargs, pp_opts): (source)

Check if an objects needs to be rebuild based on its dependencies

Parameters
obj:strobject file
cc_argsUndocumented
extra_postargsUndocumented
pp_optsUndocumented
Returns
boolUndocumented
_global_lock = (source)

Undocumented

_job_semaphore = (source)

Undocumented

Undocumented

_processing_files = (source)

Undocumented