Skip to main content
Ctrl+K

Fab 1.1.dev0 documentation

  • Installing Fab
  • Environment
  • Using Fab at the Met Office
  • Introduction to Configuration
  • How to Write a Build Configuration
    • Advanced Configuration
    • Site-Specific Configuration
    • Features
    • Api Reference
    • Developer’s guide
    • Glossary
    • Index
    • Python Module Index
  • GitHub
  • Installing Fab
  • Environment
  • Using Fab at the Met Office
  • Introduction to Configuration
  • How to Write a Build Configuration
  • Advanced Configuration
  • Site-Specific Configuration
  • Features
  • Api Reference
  • Developer’s guide
  • Glossary
  • Index
  • Python Module Index
  • GitHub

Section Navigation

  • fab.parse package
    • fab.parse.c module
    • fab.parse.fortran module
    • fab.parse.fortran_common module
    • fab.parse.x90 module
  • fab.steps package
    • fab.steps.grab package
      • fab.steps.grab.archive module
      • fab.steps.grab.fcm module
      • fab.steps.grab.folder module
      • fab.steps.grab.git module
      • fab.steps.grab.prebuild module
      • fab.steps.grab.svn module
    • fab.steps.analyse module
    • fab.steps.archive_objects module
    • fab.steps.c_pragma_injector module
    • fab.steps.cleanup_prebuilds module
    • fab.steps.compile_c module
    • fab.steps.compile_fortran module
    • fab.steps.find_source_files module
    • fab.steps.link module
    • fab.steps.preprocess module
    • fab.steps.psyclone module
    • fab.steps.root_inc_files module
  • fab.tools package
    • fab.tools.ar module
    • fab.tools.category module
    • fab.tools.compiler module
    • fab.tools.flags module
    • fab.tools.linker module
    • fab.tools.preprocessor module
    • fab.tools.psyclone module
    • fab.tools.rsync module
    • fab.tools.tool module
    • fab.tools.tool_box module
    • fab.tools.tool_repository module
    • fab.tools.versioning module
  • fab.artefacts module
  • fab.build_config module
  • fab.cli module
  • fab.constants module
  • fab.dep_tree module
  • fab.metrics module
  • fab.mo module
  • fab.util module
  • fab.steps.link module

fab.steps.link module#

Link an executable.

class fab.steps.link.DefaultLinkerSource#

Bases: ArtefactsGetter

A source getter specifically for linking. Looks for the default output from archiving objects, falls back to default compiler output. This allows a link step to work with or without a preceding object archive step.

fab.steps.link.link_exe(config, flags=None, source=None)#

Link object files into an executable for every build target.

Expects one or more build targets from its artefact getter, of the form Dict[name, object_files].

The default artefact getter, DefaultLinkerSource, looks for any output from an ArchiveObjects step, and falls back to using output from compiler steps.

Parameters:
  • config – The fab.build_config.BuildConfig object where we can read settings such as the project workspace folder or the multiprocessing flag.

  • flags – A list of flags to pass to the linker. (default: None)

  • source (Optional[ArtefactsGetter]) – An optional ArtefactsGetter. It defaults to the output from compiler steps, which typically is the expected behaviour. (default: None)

fab.steps.link.link_shared_object(config, output_fpath, flags=None, source=None)#

Produce a shared object (.so) file from the given build target.

Expects a single build target from its artefact getter, of the form Dict[None, object_files]. We can assume the list of object files is the entire project source, compiled.

Params are as for LinkerBase, with the addition of:

Parameters:
  • config – The fab.build_config.BuildConfig object where we can read settings such as the project workspace folder or the multiprocessing flag.

  • output_fpath (str) – File path of the shared object to create.

  • flags – A list of flags to pass to the linker. (default: None)

  • source (Optional[ArtefactsGetter]) – An optional ArtefactsGetter. Typically not required, as there is a sensible default. (default: None)

On this page
  • DefaultLinkerSource
  • link_exe()
  • link_shared_object()
Show Source

© Crown Copyright 2024 Met Office. All rights reserved..

Created using Sphinx 8.1.3.

Built with the PyData Sphinx Theme 0.16.0.