easybuild.tools.toolchain.toolchain module

The toolchain module with the abstract Toolchain class.

Creating a new toolchain should be as simple as possible.

author:Stijn De Weirdt (Ghent University)
author:Kenneth Hoste (Ghent University)
class easybuild.tools.toolchain.toolchain.Toolchain(name=None, version=None, mns=None, class_constants=None, tcdeps=None, modtool=None, hidden=False)

Bases: object

General toolchain class

CLASS_CONSTANTS_TO_RESTORE = None
CLASS_CONSTANT_COPIES = {}
NAME = None
OPTIONS_CLASS

alias of ToolchainOptions

SUBTOOLCHAIN = None
TOOLCHAIN_FAMILY = None
VARIABLES_CLASS

alias of ToolchainVariables

VERSION = None
add_dependencies(dependencies)

Verify if the given dependencies exist and add them

as_dict(name=None, version=None)

Return toolchain specification as a dictionary.

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. :param cache_tool: name of compiler caching tool :return: 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 for a certain option.

get_software_root(names)

Try to get the software root for all names

get_software_version(names)

Try to get the software version for all names

get_variable(name, typ=<type 'str'>)

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

is_dep_in_toolchain_module(name)

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

is_required(name)

Determine whether this is a required toolchain element.

static is_rpath_wrapper(path)

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

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, silent=False, loadmod=True, rpath_filter_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

Parameters:
  • 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).
  • silent – keep quiet, or not (mostly relates to extended dry run output)
  • loadmod – whether or not to (re)load the toolchain module, and the modules for the dependencies
  • rpath_filter_dirs – extra directories to include in RPATH filter (e.g. build dir, tmpdir, ...)
prepare_compiler_cache(cache_tool)

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

Parameters:cache_tool – name of compiler caching tool to prepare for
prepare_rpath_wrappers(rpath_filter_dirs=None)

Put RPATH wrapper script in place for compiler and linker commands

Parameters:rpath_filter_dirs – extra directories to include in RPATH filter (e.g. build dir, tmpdir, ...)
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.

Parameters:paths – dictionary containing one or mappings, each one specified as a tuple: (<path/to/script>, <list of commands to symlink to the script>)
toolchain_family()

Return toolchain family for this toolchain.