An abstract class holds all configurable attributes of CCompilerOpt
,
these class attributes can be used to change the default behavior
of CCompilerOpt
in order to fit other requirements.
CCompilerOpt
tends to generate all
expected headers in order to 'not' break the build.
Default is False.CCompilerOpt
and CCompiler
's properties(type, flags, etc).
Default is list of two items, containing the time of last modification
of ccompiler_opt
and value of attribute "conf_noopt"Extra tokens that can be reached from dispatch-able sources through the special mark @targets. Default is an empty dictionary.
$ "@targets #avx_group other_tokens" > group_inside.c
>>> CCompilerOpt.conf_target_groups["avx_group"] = \ "$werror $maxopt avx2 avx512f avx512_skx" >>> cco = CCompilerOpt(cc_instance) >>> cco.try_dispatch(["group_inside.c"])
Nested dictionaries defining several compiler flags that linked to some major functions, the main key represent the compiler name and sub-keys represent flags names. Default is already covers all supported C compilers.
Sub-keys explained as follows:
native
, to detect the current
machine support via the compiler.$werror
via dispatch-able sources.'-O3'
A dictionary defines the used CPU features for
argument option 'min'
, the key represent the CPU architecture
name e.g. 'x86'
. Default values provide the best effort
on wide range of users platforms.
Note: case-sensitive for architecture names.
Nested dictionaries used for identifying the CPU features.
the primary key is represented as a feature name or group name
that gathers several features. Default values covers all
supported features but without the major options like "flags",
these undefined options handle it by method conf_features_partial()
.
Default value is covers almost all CPU features for X86, IBM/Power64
and ARM 7/8.
Sub-keys explained as follows:
conf_features
.
Default is None.feature_detect()
.conf_features
.feature_can_autovec()
Extra test case names for the CPU feature that need to be tested against the compiler.
Each test case must have a C file named extra_xxxx.c, where xxxx is the case name in lower case, under 'conf_check_path'. It should contain at least one intrinsic or function related to the test case.
If the compiler able to successfully compile the C file then CCompilerOpt
will add a C #define for it into the main dispatch header, e.g.
`#define {conf_c_prefix}_XXXX where XXXX is the case name in upper case.
Method | __init__ |
Undocumented |
Method | conf_features_partial |
No summary |
Class Variable | conf_c_prefix |
Undocumented |
Class Variable | conf_c_prefix_ |
Undocumented |
Class Variable | conf_cc_flags |
Undocumented |
Class Variable | conf_check_path |
Undocumented |
Class Variable | conf_features |
Undocumented |
Class Variable | conf_min_features |
Undocumented |
Class Variable | conf_nocache |
Undocumented |
Class Variable | conf_noopt |
Undocumented |
Class Variable | conf_target_groups |
Undocumented |
Instance Variable | conf_cache_factors |
Undocumented |
Instance Variable | conf_tmp_path |
Undocumented |
conf_features
,
the returned dict has same rules and notes in
class attribute conf_features
, also its override
any options that been set in 'conf_features'.