fc_config¶
Fortran configuration helpers
-
waflib.Tools.fc_config.
fc_flags
(conf)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Define common fortran configuration flags and file extensions
-
waflib.Tools.fc_config.
fc_add_flags
(conf)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Add FCFLAGS / LDFLAGS / LINKFLAGS from os.environ to conf.env
-
waflib.Tools.fc_config.
check_fortran
(self, *k, **kw)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
See if the fortran compiler works by compiling a simple fortran program
-
waflib.Tools.fc_config.
check_fc
(self, *k, **kw)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Same as
waflib.Tools.c_config.check()
but default to the Fortran programming language (Overriding the C defaults inwaflib.Tools.c_config.validate_c()
here)
-
waflib.Tools.fc_config.
fortran_modifier_darwin
(conf)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Define fortran flags and extensions for the OSX systems
-
waflib.Tools.fc_config.
fortran_modifier_win32
(conf)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Define fortran flags for the windows platforms
-
waflib.Tools.fc_config.
fortran_modifier_cygwin
(conf)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Define fortran flags for use on cygwin
-
waflib.Tools.fc_config.
check_fortran_dummy_main
(self, *k, **kw)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Guess if a main function is needed by compiling a code snippet with the C compiler and link with the Fortran compiler
TODO: (DC) - handling dialects (F77, F90, etc... -> needs core support first) - fix dummy main check (AC_FC_DUMMY_MAIN vs AC_FC_MAIN)
TODO: what does the above mean? (ita)
-
waflib.Tools.fc_config.
is_link_verbose
(self, txt)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Return True if ‘useful’ link options can be found in txt
-
waflib.Tools.fc_config.
check_fortran_verbose_flag
(self, *k, **kw)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Check what kind of verbose (-v) flag works, then set it to env.FC_VERBOSE_FLAG
-
waflib.Tools.fc_config.
_match_ignore
(line)[source]¶ Returns True if the line should be ignored (fortran test for verbosity).
-
waflib.Tools.fc_config.
parse_fortran_link
(lines)[source]¶ Given the output of verbose link of Fortran compiler, this returns a list of flags necessary for linking using the standard linker.
-
waflib.Tools.fc_config.
check_fortran_clib
(self, autoadd=True, *k, **kw)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Obtain the flags for linking with the C library if this check works, add uselib=’CLIB’ to your task generators
-
waflib.Tools.fc_config.
getoutput
(conf, cmd, stdin=False)[source]¶ TODO a bit redundant, can be removed anytime TODO waf 1.9
-
waflib.Tools.fc_config.
link_main_routines_tg_method
(self)[source]¶ Task generator method
The configuration test declares a unique task generator, so we create other task generators from there for fortran link tests
Feature: link_main_routines_func
-
waflib.Tools.fc_config.
mangling_schemes
()[source]¶ Generate triplets for use with mangle_name (used in check_fortran_mangling) the order is tuned for gfortan
-
waflib.Tools.fc_config.
mangle_name
(u, du, c, name)[source]¶ Mangle a name from a triplet (used in check_fortran_mangling)
-
waflib.Tools.fc_config.
check_fortran_mangling
(self, *k, **kw)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
Detect the mangling scheme, sets FORTRAN_MANGLING to the triplet found
This test will compile a fortran static library, then link a c app against it
-
waflib.Tools.fc_config.
set_lib_pat
(self)[source]¶ Task generator method
- Set the fortran flags for linking with the python library
feature: pyext
-
waflib.Tools.fc_config.
detect_openmp
(self)[source]¶ Configuration Method bound to
waflib.Configure.ConfigurationContext
-
waflib.Tools.fc_config.
conf
(f)¶ Decorator: attach new configuration functions to
waflib.Build.BuildContext
andwaflib.Configure.ConfigurationContext
. The methods bound will accept a parameter named ‘mandatory’ to disable the configuration errors:def configure(conf): conf.find_program('abc', mandatory=False)
Parameters: f (function) – method to bind
-
waflib.Tools.fc_config.
feature
(*k)¶ Decorator: register a task generator method that will be executed when the object attribute ‘feature’ contains the corresponding key(s):
from waflib.Task import feature @feature('myfeature') def myfunction(self): print('that is my feature!') def build(bld): bld(features='myfeature')
Parameters: k (list of string) – feature names
-
waflib.Tools.fc_config.
before_method
(*k)[source]¶ Decorator: register a task generator method which will be executed before the functions of given name(s):
from waflib.TaskGen import feature, before @feature('myfeature') @before_method('fun2') def fun1(self): print('feature 1!') @feature('myfeature') def fun2(self): print('feature 2!') def build(bld): bld(features='myfeature')
Parameters: k (list of string) – method names
Features defined in this module: