fc

Fortran support

waflib.Tools.fc.extension(*k)

Decorator that registers a task generator method which will be invoked during the processing of source files for the extension given:

from waflib import Task
class mytask(Task):
        run_str = 'cp ${SRC} ${TGT}'
@extension('.moo')
def create_maa_file(self, node):
        self.create_task('mytask', node, node.change_ext('.maa'))
def build(bld):
        bld(source='foo.moo')
waflib.Tools.fc.conf(f)

Decorator: attach new configuration functions to waflib.Build.BuildContext and waflib.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.fc_hook(self, node)[source]

Binds the Fortran file extensions create waflib.Tools.fc.fc instances

waflib.Tools.fc.modfile(conf, name)[source]

Configuration Method bound to waflib.Configure.ConfigurationContext

Turns a module name into the right module file name. Defaults to all lower case.

waflib.Tools.fc.get_fortran_tasks(tsk)[source]

Obtains all fortran tasks from the same build group. Those tasks must not have the attribute ‘nomod’ or ‘mod_fortran_done’

Returns

a list of waflib.Tools.fc.fc instances

class waflib.Tools.fc.fc(*k, **kw)[source]

Fortran tasks can only run when all fortran tasks in a current task group are ready to be executed This may cause a deadlock if some fortran task is waiting for something that cannot happen (circular dependency) Should this ever happen, set the ‘nomod=True’ on those tasks instances to break the loop

color = 'GREEN'

Color for the console display, see waflib.Logs.colors_lst

vars = ['DEFINES', 'FC', 'FCDEFINES_ST', 'FCFLAGS', 'FCINCPATH_ST', 'FCPPFLAGS', 'FC_SRC_F', 'FC_TGT_F', 'FORTRANMODPATHFLAG', 'INCPATHS', '_FCMODOUTFLAGS']

ConfigSet variables that should trigger a rebuild (class attribute used for waflib.Task.Task.sig_vars())

scan()[source]

Fortran dependency scanner

runnable_status()[source]

Sets the mod file outputs and the dependencies on the mod files over all Fortran tasks executed by the main thread so there are no concurrency issues

hasrun
generator
env

waflib.ConfigSet.ConfigSet object (make sure to provide one)

inputs

List of input nodes, which represent the files used by the task instance

outputs

List of output nodes, which represent the files created by the task instance

dep_nodes

List of additional nodes to depend on

run_after

Set of tasks that must be executed before this one

hcode = b'${FC} ${FCFLAGS} ${FCINCPATH_ST:INCPATHS} ${FCDEFINES_ST:DEFINES} ${_FCMODOUTFLAGS} ${FC_TGT_F}${TGT[0].abspath()} ${FC_SRC_F}${SRC[0].abspath()} ${FCPPFLAGS}'

String representing an additional hash for the class representation

orig_run_str = '${FC} ${FCFLAGS} ${FCINCPATH_ST:INCPATHS} ${FCDEFINES_ST:DEFINES} ${_FCMODOUTFLAGS} ${FC_TGT_F}${TGT[0].abspath()} ${FC_SRC_F}${SRC[0].abspath()} ${FCPPFLAGS}'
class waflib.Tools.fc.fcprogram(*k, **kw)[source]

Links Fortran programs

color = 'YELLOW'

Color for the console display, see waflib.Logs.colors_lst

inst_to = '${BINDIR}'

Default installation path for the link task outputs, or None to disable

hasrun
generator
env

waflib.ConfigSet.ConfigSet object (make sure to provide one)

inputs

List of input nodes, which represent the files used by the task instance

outputs

List of output nodes, which represent the files created by the task instance

dep_nodes

List of additional nodes to depend on

run_after

Set of tasks that must be executed before this one

hcode = b'${FC} ${LINKFLAGS} ${FCLNK_SRC_F}${SRC} ${FCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FCSTLIB_MARKER} ${FCSTLIBPATH_ST:STLIBPATH} ${FCSTLIB_ST:STLIB} ${FCSHLIB_MARKER} ${FCLIBPATH_ST:LIBPATH} ${FCLIB_ST:LIB} ${LDFLAGS}'

String representing an additional hash for the class representation

orig_run_str = '${FC} ${LINKFLAGS} ${FCLNK_SRC_F}${SRC} ${FCLNK_TGT_F}${TGT[0].abspath()} ${RPATH_ST:RPATH} ${FCSTLIB_MARKER} ${FCSTLIBPATH_ST:STLIBPATH} ${FCSTLIB_ST:STLIB} ${FCSHLIB_MARKER} ${FCLIBPATH_ST:LIBPATH} ${FCLIB_ST:LIB} ${LDFLAGS}'
vars = ['FC', 'FCLIBPATH_ST', 'FCLIB_ST', 'FCLNK_SRC_F', 'FCLNK_TGT_F', 'FCSHLIB_MARKER', 'FCSTLIBPATH_ST', 'FCSTLIB_MARKER', 'FCSTLIB_ST', 'LDFLAGS', 'LIB', 'LIBPATH', 'LINKFLAGS', 'RPATH', 'RPATH_ST', 'STLIB', 'STLIBPATH']

ConfigSet variables that should trigger a rebuild (class attribute used for waflib.Task.Task.sig_vars())

class waflib.Tools.fc.fcshlib(*k, **kw)[source]

Links Fortran libraries

inst_to = '${LIBDIR}'

Default installation path for the link task outputs, or None to disable

hasrun
generator
env

waflib.ConfigSet.ConfigSet object (make sure to provide one)

inputs

List of input nodes, which represent the files used by the task instance

outputs

List of output nodes, which represent the files created by the task instance

dep_nodes

List of additional nodes to depend on

run_after

Set of tasks that must be executed before this one

hcode = b'nocode'

String representing an additional hash for the class representation

class waflib.Tools.fc.fcstlib(*k, **kw)[source]

Links Fortran static libraries (uses ar by default)

hasrun
generator
env

waflib.ConfigSet.ConfigSet object (make sure to provide one)

inputs

List of input nodes, which represent the files used by the task instance

outputs

List of output nodes, which represent the files created by the task instance

dep_nodes

List of additional nodes to depend on

run_after

Set of tasks that must be executed before this one

hcode = b'\tdef wrap(self):\n\t\ttry:\n\t\t\tos.remove(self.outputs[0].abspath())\n\t\texcept OSError:\n\t\t\tpass\n\t\treturn old(self)\n'

String representing an additional hash for the class representation

class waflib.Tools.fc.fcprogram_test(*k, **kw)[source]

Custom link task to obtain compiler outputs for Fortran configuration tests

runnable_status()[source]

This task is always executed

exec_command(cmd, **kw)[source]

Stores the compiler std our/err onto the build context, to bld.out + bld.err

hasrun
generator
env

waflib.ConfigSet.ConfigSet object (make sure to provide one)

inputs

List of input nodes, which represent the files used by the task instance

outputs

List of output nodes, which represent the files created by the task instance

dep_nodes

List of additional nodes to depend on

run_after

Set of tasks that must be executed before this one

hcode = b'nocode'

String representing an additional hash for the class representation