numpy / 1.22.0 / reference / generated / numpy.distutils.ccompiler.ccompiler_compile.html /

numpy.distutils.ccompiler.CCompiler_compile

distutils.ccompiler. 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
sources list of str

A list of filenames

output_dir str, optional

Path to the output directory.

macros list of tuples

A list of macro definitions.

include_dirs list of str, optional

The directories to add to the default include file search path for this compilation only.

debug bool, optional

Whether or not to output debug symbols in or alongside the object file(s).

extra_preargs, extra_postargs ?

Extra pre- and post-arguments.

depends list of str, optional

A list of file names that all targets depend on.

Returns
objects list of str

A list of object file names, one per source file sources.

Raises
CompileError

If compilation fails.

© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.22/reference/generated/numpy.distutils.ccompiler.CCompiler_compile.html