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
    • fab.artefacts
    • fab.build_config
    • fab.cli
    • fab.constants
    • fab.dep_tree
    • fab.metrics
    • fab.mo
    • fab.parse
      • fab.parse.c
      • fab.parse.fortran
      • fab.parse.fortran_common
      • fab.parse.x90
    • fab.steps
      • fab.steps.analyse
      • fab.steps.archive_objects
      • fab.steps.c_pragma_injector
      • fab.steps.cleanup_prebuilds
      • fab.steps.compile_c
      • fab.steps.compile_fortran
      • fab.steps.find_source_files
      • fab.steps.grab
        • fab.steps.grab.archive
        • fab.steps.grab.fcm
        • fab.steps.grab.folder
        • fab.steps.grab.git
        • fab.steps.grab.prebuild
        • fab.steps.grab.svn
      • fab.steps.link
      • fab.steps.preprocess
      • fab.steps.psyclone
      • fab.steps.root_inc_files
    • fab.tools
      • fab.tools.ar
      • fab.tools.category
      • fab.tools.compiler
      • fab.tools.flags
      • fab.tools.linker
      • fab.tools.preprocessor
      • fab.tools.psyclone
      • fab.tools.rsync
      • fab.tools.tool
      • fab.tools.tool_box
      • fab.tools.tool_repository
      • fab.tools.versioning
    • fab.util
  • API Documentation
  • fab.steps
  • fab.steps.link

fab.steps.link#

Link an executable.

Functions

link_exe(config[, flags, source])

Link object files into an executable for every build target.

link_shared_object(config, output_fpath[, ...])

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

Classes

DefaultLinkerSource()

A source getter specifically for linking.

class fab.steps.link.DefaultLinkerSource#

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)

previous

fab.steps.grab.svn

next

fab.steps.preprocess

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

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

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.15.4.