fc

fortran support

waflib.Tools.fc.dummy(self)[source]

Task generator method

Unused function that does nothing (TODO: remove in waf 1.9)

Feature :fcprogram, fcshlib, fcstlib, fcprogram_test
waflib.Tools.fc.fc_hook(self, node)[source]

Bind the typical Fortran file extensions to the creation of a waflib.Tools.fc.fc instance

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

Configuration Method bound to waflib.Configure.ConfigurationContext

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

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

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

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

Bases: waflib.Task.Task

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

color = 'GREEN'
vars = ['DEFINES', 'FC', 'FCDEFINES_ST', 'FCFLAGS', 'FCINCPATH_ST', 'FC_SRC_F', 'FC_TGT_F', 'FORTRANMODPATHFLAG', 'INCPATHS', '_FCMODOUTFLAGS']
scan()[source]

scanner for fortran dependencies

runnable_status()[source]

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

__doc__ = "\n\tThe fortran tasks can only run when all fortran tasks in the current group are ready to be executed\n\tThis may cause a deadlock if another fortran task is waiting for something that cannot happen (circular dependency)\n\tin this case, set the 'nomod=True' on those tasks instances to break the loop\n\t"
__module__ = 'waflib.Tools.fc'
hcode = '${FC} ${FCFLAGS} ${FCINCPATH_ST:INCPATHS} ${FCDEFINES_ST:DEFINES} ${_FCMODOUTFLAGS} ${FC_TGT_F}${TGT[0].abspath()} ${FC_SRC_F}${SRC[0].abspath()}'
orig_run_str = '${FC} ${FCFLAGS} ${FCINCPATH_ST:INCPATHS} ${FCDEFINES_ST:DEFINES} ${_FCMODOUTFLAGS} ${FC_TGT_F}${TGT[0].abspath()} ${FC_SRC_F}${SRC[0].abspath()}'
class waflib.Tools.fc.fcprogram(*k, **kw)[source]

Bases: waflib.Tools.ccroot.link_task

Link fortran programs

color = 'YELLOW'
inst_to = '${BINDIR}'
__doc__ = 'Link fortran programs'
__module__ = 'waflib.Tools.fc'
hcode = '${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}'
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']
class waflib.Tools.fc.fcshlib(*k, **kw)[source]

Bases: waflib.Tools.fc.fcprogram

Link fortran libraries

inst_to = '${LIBDIR}'
__doc__ = 'Link fortran libraries'
__module__ = 'waflib.Tools.fc'
hcode = 'nocode'
class waflib.Tools.fc.fcprogram_test(*k, **kw)[source]

Bases: waflib.Tools.fc.fcprogram

Custom link task to obtain the compiler outputs for fortran configuration tests

runnable_status()[source]

This task is always executed

exec_command(cmd, **kw)[source]

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

__doc__ = 'Custom link task to obtain the compiler outputs for fortran configuration tests'
__module__ = 'waflib.Tools.fc'
hcode = 'nocode'
class waflib.Tools.fc.fcstlib(*k, **kw)[source]

Bases: waflib.Tools.ccroot.stlink_task

Link fortran static libraries (uses ar by default)

__doc__ = 'Link fortran static libraries (uses ar by default)'
__module__ = 'waflib.Tools.fc'
hcode = '\tdef wrap(self):\n\t\ttry: os.remove(self.outputs[0].abspath())\n\t\texcept OSError: pass\n\t\treturn old(self)\n'
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.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.extension(*k)

Decorator: register 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')

Features defined in this module:

Previous topic

ifort

Next topic

fc_config

This Page