Skip to content

toolchain

The toolchain module with the abstract Toolchain class.

Creating a new toolchain should be as simple as possible.

Toolchain terminology

Toolchain: group of development related utilities (eg compiler) and libraries (eg MPI, linear algebra) -> eg tc=Toolchain()

Toolchain options : options passed to the toolchain through the easyconfig file -> eg tc.options

Options : all options passed to an executable Flags: specific subset of options, typically involved with compilation -> eg tc.variables.CFLAGS LinkOptions: specific subset of options, typically involved with linking -> eg tc.variables.LIBBLAS

TooclchainVariables: list of environment variables that are set when the toolchain is initialised and the toolchain options have been parsed. -> eg tc.variables['X'] will be available as os.environ['X']

Authors:

  • Stijn De Weirdt (Ghent University)
  • Kenneth Hoste (Ghent University)

Toolchain

Bases: object

General toolchain class

__init__(name=None, version=None, mns=None, class_constants=None, tcdeps=None, modtool=None, hidden=False)

Toolchain constructor.

PARAMETER DESCRIPTION
name

toolchain name

DEFAULT: None

version

toolchain version

DEFAULT: None

mns

module naming scheme to use

DEFAULT: None

class_constants

toolchain 'constants' to define

DEFAULT: None

tcdeps

list of toolchain 'dependencies' (i.e., the toolchain components)

DEFAULT: None

modtool

ModulesTool instance to use

DEFAULT: None

hidden

bool indicating whether toolchain is hidden or not

DEFAULT: False

add_dependencies(dependencies)

[DEPRECATED] Verify if the given dependencies exist, and return them.

This method is deprecated. You should pass the dependencies to the 'prepare' method instead, via the 'deps' named argument.

as_dict(name=None, version=None)

Return toolchain specification as a dictionary.

banned_linked_shared_libs()

List of shared libraries (names, file names, paths) which are not allowed to be linked in any installed binary/library.

base_init()

Initialise missing class attributes (log, options, variables).

blas_family()

Return type of BLAS library used in this toolchain, or 'None' if BLAS is not supported.

cleanup()

Clean up after using this toolchain

comp_cache_compilers(cache_tool)

Determine list of relevant compilers for specified compiler caching tool.

PARAMETER DESCRIPTION
cache_tool

name of compiler caching tool

RETURNS DESCRIPTION

list of names of relevant compilers

comp_family()

Return compiler family used in this toolchain (abstract method).

compilers()

Return list of relevant compilers for this toolchain

definition()

Determine toolchain elements for given Toolchain instance.

det_short_module_name()

Determine module name for this toolchain.

generate_vars()

Convert the variables in simple vars

get_dependency_version(dependency)

Generate a version string for a dependency on a module using this toolchain

get_flag(name)

Get compiler flag(s) for a certain option.

get_software_root(names)

Try to get the software root for all names

get_software_version(names, required=True)

Try to get the software version for all names

get_variable(name, typ=str)

Get value for specified variable. typ: indicates what type of return value is expected

handle_sysroot()

Extra stuff to be done when alternate system root is specified via --sysroot EasyBuild configuration option.

  • Update $PKG_CONFIG_PATH to include sysroot location to pkg-config files (*.pc).

is_dep_in_toolchain_module(name)

Check whether a specific software name is listed as a dependency in the module for this toolchain.

is_deprecated()

Return whether or not this toolchain is deprecated.

is_required(name)

Determine whether this is a required toolchain element.

is_rpath_wrapper(path) staticmethod

Check whether command at specified location already is an RPATH wrapper script rather than the actual command

is_system_toolchain()

Return boolean to indicate whether this toolchain is a system(/dummy) toolchain.

lapack_family()

Return type of LAPACK library used in this toolchain, or 'None' if LAPACK is not supported.

mpi_family()

Return type of MPI library used in this toolchain, or 'None' if MPI is not supported.

prepare(onlymod=None, deps=None, silent=False, loadmod=True, rpath_filter_dirs=None, rpath_include_dirs=None)

Prepare a set of environment parameters based on name/version of toolchain - load modules for toolchain and dependencies - generate extra variables and set them in the environment

PARAMETER DESCRIPTION
deps

list of dependencies

DEFAULT: None

onlymod

boolean/string to indicate if the toolchain should only load the environment with module (True) or also set all other variables (False) like compiler CC etc (If string: comma separated list of variables that will be ignored).

DEFAULT: None

silent

keep quiet, or not (mostly relates to extended dry run output)

DEFAULT: False

loadmod

whether or not to (re)load the toolchain module, and the modules for the dependencies

DEFAULT: True

rpath_filter_dirs

extra directories to include in RPATH filter (e.g. build dir, tmpdir, ...)

DEFAULT: None

rpath_include_dirs

extra directories to include in RPATH

DEFAULT: None

prepare_compiler_cache(cache_tool)

Prepare for using specified compiler caching tool (e.g., ccache, f90cache)

PARAMETER DESCRIPTION
cache_tool

name of compiler caching tool to prepare for

prepare_rpath_wrappers(rpath_filter_dirs=None, rpath_include_dirs=None)

Put RPATH wrapper script in place for compiler and linker commands

PARAMETER DESCRIPTION
rpath_filter_dirs

extra directories to include in RPATH filter (e.g. build dir, tmpdir, ...)

DEFAULT: None

required_linked_shared_libs()

List of shared libraries (names, file names, paths) which must be linked in all installed binaries/libraries.

reset()

Reset this toolchain instance.

set_minimal_build_env()

Set up a minimal build environment, by setting (only) the $CC and $CXX environment variables.

set_options(options)

Process toolchain options

set_variables()

Do nothing? Everything should have been set by others Needs to be defined for super() relations

show_variables(offset='', sep='\n', verbose=False)

Pretty print the variables

Create a symlink for each command to binary/script at specified path.

PARAMETER DESCRIPTION
paths

dictionary containing one or mappings, each one specified as a tuple: (, )

toolchain_family()

Return toolchain family for this toolchain.

variables_init()

Initialise toolchain variables.

env_vars_external_module(name, version, metadata)

Determine $EBROOT and/or $EBVERSION environment variables that can be set for external module, based on the provided name, version and metadata.

is_system_toolchain(tc_name)

Return whether toolchain with specified name is a system toolchain or not.