Skip to content

tweak

Easyconfig module that provides functionality for tweaking existing eaysconfig (.eb) files.

Authors:

  • Stijn De Weirdt (Ghent University)
  • Dries Verdegem (Ghent University)
  • Kenneth Hoste (Ghent University)
  • Pieter De Baets (Ghent University)
  • Jens Timmerman (Ghent University)
  • Toon Willems (Ghent University)
  • Fotis Georgatos (Uni.Lu, NTUA)
  • Alan O'Cais (Juelich Supercomputing Centre)
  • Maxime Boissonneault (Universite Laval, Calcul Quebec, Compute Canada)

check_capability_mapping(source_tc_spec, target_tc_spec)

Compare whether the capabilities of a source toolchain are all present in a target toolchain

PARAMETER DESCRIPTION
source_tc_spec

specs of source toolchain

target_tc_spec

specs of target toolchain

RETURNS DESCRIPTION

boolean indicating whether or not source toolchain is compatible with target toolchain

ec_filename_for(path)

Return a suiting file name for the easyconfig file at , as determined by its contents.

find_matching_easyconfigs(name, installver, paths)

Find easyconfigs that match specified name/installversion in specified list of paths.

PARAMETER DESCRIPTION
name

software name

installver

software install version (which includes version, toolchain, versionprefix/suffix, ...)

paths

list of paths to search easyconfigs in

find_potential_version_mappings(dep, toolchain_mapping, versionsuffix_mapping=None, highest_versions_only=True, ignore_versionsuffixes=False, quiet=False)

Find potential version mapping for a dependency in a new hierarchy

PARAMETER DESCRIPTION
dep

dependency specification (dict)

toolchain_mapping

toolchain mapping used for search

versionsuffix_mapping

mapping of version suffixes (required by software with a special version suffix, such as Python packages)

DEFAULT: None

highest_versions_only

only return highest versions

DEFAULT: True

RETURNS DESCRIPTION

list of dependencies that match

get_dep_tree_of_toolchain(toolchain_spec, modtool)

Get list of dependencies of a toolchain (as EasyConfig objects)

PARAMETER DESCRIPTION
toolchain_spec

toolchain spec to get the dependencies of

modtool

module tool used

RETURNS DESCRIPTION

The dependency tree of the toolchain spec

get_matching_easyconfig_candidates(prefix_stub, toolchain)

Find easyconfigs that match specified requirements w.r.t. toolchain and partial filename pattern.

PARAMETER DESCRIPTION
prefix_stub

stub used in regex (e.g., 'Python-' or 'Python-2')

toolchain

the toolchain to use with the search

RETURNS DESCRIPTION

list of candidate paths, toolchain_suffix of candidates

list_deps_versionsuffixes(ec_spec)

Take an easyconfig spec, parse it, extracts the list of version suffixes used in its dependencies

PARAMETER DESCRIPTION
ec_spec

location of original easyconfig file

RETURNS DESCRIPTION

The list of versionsuffixes used by the dependencies of this recipe

map_common_versionsuffixes(software_name, original_toolchain, toolchain_mapping)

Create a mapping of common versionssuffixes (like -Python-%(pyver)s) between toolchains

PARAMETER DESCRIPTION
software_name

Name of software

original_toolchain

original toolchain

toolchain_mapping

toolchain mapping from that containing original to target

RETURNS DESCRIPTION

dictionary of possible mappings

map_easyconfig_to_target_tc_hierarchy(ec_spec, toolchain_mapping, targetdir=None, update_build_specs=None, update_dep_versions=False, ignore_versionsuffixes=False)

Take an easyconfig spec, parse it, map it to a target toolchain and dump it out

PARAMETER DESCRIPTION
ec_spec

location of original easyconfig file

toolchain_mapping

mapping between source toolchain and target toolchain

targetdir

directory to dump the modified easyconfig file in

DEFAULT: None

update_build_specs

dict with names and values of easyconfig parameters to tweak

DEFAULT: None

update_dep_versions

boolean indicating whether dependency versions should be updated

DEFAULT: False

RETURNS DESCRIPTION

Location of the modified easyconfig file

map_toolchain_hierarchies(source_toolchain, target_toolchain, modtool)

Create a map between toolchain hierarchy of the initial toolchain and that of the target toolchain

PARAMETER DESCRIPTION
source_toolchain

initial toolchain of the easyconfig(s)

target_toolchain

target toolchain for tweaked easyconfig(s)

modtool

module tool used

RETURNS DESCRIPTION

mapping from source hierarchy to target hierarchy

map_versionsuffixes_cache(func)

Function decorator to cache (and retrieve cached) versionsuffixes mapping between toolchains.

match_minimum_tc_specs(source_tc_spec, target_tc_hierarchy)

Match a source toolchain spec to the minimal corresponding toolchain in a target hierarchy

PARAMETER DESCRIPTION
source_tc_spec

specs of source toolchain

target_tc_hierarchy

hierarchy of specs for target toolchain

obtain_ec_for(specs, paths, fp=None)

Obtain an easyconfig file to the given specifications.

Either select between available ones, or use the best suited available one to generate a new easyconfig file.

PARAMETER DESCRIPTION
specs

list of available easyconfig files

paths

a list of paths where easyconfig files can be found

fp

the desired file name

DEFAULT: None

pick_version(req_ver, avail_vers)

Pick version based on an optionally desired version and available versions.

If a desired version is specifed, the most recent version that is less recent than or equal to the desired version will be picked; else, the most recent version will be picked.

This function returns both the version to be used, which is equal to the required version if it was specified, and the version picked that matches that closest.

PARAMETER DESCRIPTION
req_ver

required version

avail_vers

list of available versions

select_or_generate_ec(fp, paths, specs)

Select or generate an easyconfig file with the given requirements, from existing easyconfig files.

If easyconfig files are available for the specified software package, then this function will first try to determine which toolchain to use. * if a toolchain is given, it will use it (possible using a template easyconfig file as base); * if not, and only a single toolchain is available, is will assume it can use that toolchain * else, it fails -- EasyBuild doesn't select between multiple available toolchains

Next, it will trim down the selected easyconfig files to a single one, based on the following requirements (in order of preference): * toolchain version * software version * other parameters (e.g. versionprefix, versionsuffix, etc.)

If a complete match is found, it will return that easyconfig. Else, it will generate a new easyconfig file based on the selected 'best matching' easyconfig file.

tweak(easyconfigs, build_specs, modtool, targetdirs=None)

Tweak list of easyconfigs according to provided build specifications.

tweak_one(orig_ec, tweaked_ec, tweaks, targetdir=None)

Tweak an easyconfig file with the given list of tweaks, using replacement via regular expressions. Note: this will only work 'well-written' easyconfig files, i.e. ones that e.g. set the version once and then use the 'version' variable to construct the list of sources, and possibly other parameters that depend on the version (e.g. list of patch files, dependencies, version suffix, ...)

The tweaks should be specified in a dictionary, with parameters and keys that map to the values to be set.

Reads easyconfig file at path , and writes the tweaked easyconfig file to .

If is not provided, a target filepath is generated based on and the contents of the tweaked easyconfig file.

PARAMETER DESCRIPTION
orig_ec

location of original easyconfig file to read

tweaked_ec

location where tweaked easyconfig file should be written (if this is None, then filename for tweaked easyconfig is auto-derived from contents)

tweaks

dictionary with set of changes to apply to original easyconfig file

targetdir

target directory for tweaked easyconfig file, defaults to temporary directory (only used if tweaked_ec is None)

DEFAULT: None