easybuild.framework.easyconfig.easyconfig module

Easyconfig module that contains the EasyConfig class.

author:Stijn De Weirdt (Ghent University)
author:Dries Verdegem (Ghent University)
author:Kenneth Hoste (Ghent University)
author:Pieter De Baets (Ghent University)
author:Jens Timmerman (Ghent University)
author:Toon Willems (Ghent University)
author:Ward Poelmans (Ghent University)
author:Alan O’Cais (Juelich Supercomputing Centre)
author:Bart Oldeman (McGill University, Calcul Quebec, Compute Canada)
author:Maxime Boissonneault (Universite Laval, Calcul Quebec, Compute Canada)
class easybuild.framework.easyconfig.easyconfig.ActiveMNS(*args, **kwargs)

Bases: object

Wrapper class for active module naming scheme.

check_ec_type(ec, raise_error=True)

Obtain a full parsed easyconfig file to pass to naming scheme methods if provided keys are insufficient.

  • ec – available easyconfig parameter specifications (EasyConfig instance or dict value)
  • raise_error – boolean indicating whether or not an error should be raised if a full easyconfig is required but not found
det_devel_module_filename(ec, force_visible=False)

Determine devel module filename.

det_full_module_name(ec, force_visible=False, require_result=True)

Determine full module name by selected module naming scheme, based on supplied easyconfig.


Determine initial modulepaths according to module naming scheme.


Determine name of software installation subdirectory.


Determine modulepath extensions according to module naming scheme.


Determine module subdirectory according to module naming scheme.

Determine list of paths in which symlinks to module files must be created.

det_short_module_name(ec, force_visible=False)

Determine short module name according to module naming scheme.


Determine user-specific modulepath extensions according to module naming scheme.


Determine whether load statements for a toolchain should be expanded to load statements for its dependencies. This is useful when toolchains are not exposed to users.

is_short_modname_for(short_modname, name)

Determine whether the specified (short) module name is a module for software with the specified name.


Check whether specified list of easyconfig parameters is sufficient for active module naming scheme.

class easybuild.framework.easyconfig.easyconfig.EasyConfig(path, extra_options=None, build_specs=None, validate=True, hidden=None, rawtxt=None, auto_convert_value_types=True)

Bases: object

Class which handles loading, reading, validation of easyconfigs


Return list of all dependencies, incl. hidden/build deps & toolchain, but excluding filtered deps.


Return dict representation of this EasyConfig instance.


Return a flat list of the parsed build dependencies When builddependencies are iterable they are flattened lists with duplicates removed outside of the iterating process, because the callers want simple lists.


Check whether this easyconfig file is deprecated.


Return a copy of this EasyConfig instance.


Returns an array of parsed dependencies (after filtering, if requested) dependency = {‘name’: ‘’, ‘version’: ‘’, ‘dummy’: (False|True), ‘versionsuffix’: ‘’, ‘toolchain’: ‘’} Iterable builddependencies are flattened when not iterating.

Parameters:build_only – only return build dependencies, discard others
dump(fp, always_overwrite=True, backup=False)

Dump this easyconfig to file, with the given filename.

  • always_overwrite – overwrite existing file at specified location without use of –force
  • backup – create backup of existing file before overwriting it
extend_params(extra, overwrite=True)

Extend list of known parameters via provided list of extra easyconfig parameters.


Determine correct filename for this easyconfig file.


Filter dependencies according to ‘filter-deps’ configuration setting.


Replace dependencies by hidden dependencies in list of (build) dependencies, where appropriate.


Try to generate all template values.

get(key, *args, **kwargs)

Check whether any replace easyconfig parameters are still used


Get list of lists of parsed dependencies that correspond with entries in multi_deps easyconfig parameter.


Obtain reference to original/untemplated value of specified easyconfig parameter rather than a copied value with templated values.


helper function for _parse_dependency handles metadata for external module dependencies


Handle lists of dependency versions of which we should iterate specified in ‘multi_deps’ easyconfig parameter.

This is basically just syntactic sugar to prevent having to specify a list of lists in ‘builddependencies’.


returns name


Parse the file and set options mandatory requirements are checked here


Parse specifications for which dependencies should be filtered.


Parse provided version specification as a version range.


Start iterative mode.


Stop iterative mode.


returns the Toolchain used

update(key, value, allow_duplicate=True)

Update a string configuration value with a value (i.e. append to it).


Validate this easyonfig - ensure certain easyconfig parameters are set to a known value (see self.validations) - check OS dependencies - check license


Configure/build/install options specified as lists should have same length.


Validate the license


validate presence of OS dependencies osdependencies should be a single list


returns version


Clean up easyconfigs (in place) by filtering out comments/buildstats included by EasyBuild in archived easyconfigs (cfr. FileRepository.add_easyconfig in easybuild.tools.repository.filerepo)

Parameters:paths – list of paths to easyconfigs to clean up
easybuild.framework.easyconfig.easyconfig.copy_easyconfigs(paths, target_dir)

Copy easyconfig files to specified directory, in the ‘right’ location and using the filename expected by robot.

  • paths – list of paths to copy to git working dir
  • target_dir – target directory

dict with useful information on copied easyconfig files (corresponding EasyConfig instances, paths, status)

easybuild.framework.easyconfig.easyconfig.copy_patch_files(patch_specs, target_dir)

Copy patch files to specified directory, in the ‘right’ location according to the software name they relate to.

  • patch_specs – list of tuples with patch file location and name of software they are for
  • target_dir – target directory
easybuild.framework.easyconfig.easyconfig.create_paths(path, name, version)

Returns all the paths where easyconfig could be located <path> is the basepath <name> should be a string <version> can be a ‘*’ if you use glob patterns, or an install version otherwise

easybuild.framework.easyconfig.easyconfig.det_file_info(paths, target_dir)

Determine useful information on easyconfig files relative to a target directory, before any actual operation (e.g. copying) is performed

  • paths – list of paths to easyconfig files
  • target_dir – target directory

dict with useful information on easyconfig files (corresponding EasyConfig instances, paths, status) relative to a target directory

easybuild.framework.easyconfig.easyconfig.det_installversion(version, toolchain_name, toolchain_version, prefix, suffix)

Deprecated ‘det_installversion’ function, to determine exact install version, based on supplied parameters.

easybuild.framework.easyconfig.easyconfig.det_location_for(path, target_dir, soft_name, target_file)

Determine path to easyconfigs directory for specified software name, using specified target file name.

  • path – path of file to copy
  • target_dir – (parent) target directory, should contain easybuild/easyconfigs subdirectory
  • soft_name – software name (to determine location to copy to)
  • target_file – target file name

full path to the right location

easybuild.framework.easyconfig.easyconfig.det_subtoolchain_version(current_tc, subtoolchain_name, optional_toolchains, cands, incl_capabilities=False)

Returns unique version for subtoolchain, in tc dict. If there is no unique version: * use ‘’ for dummy, if dummy is not skipped. * return None for skipped subtoolchains, that is,

optional toolchains or dummy without add_dummy_to_minimal_toolchains.
  • in all other cases, raises an exception.
easybuild.framework.easyconfig.easyconfig.get_easyblock_class(easyblock, name=None, error_on_failed_import=True, error_on_missing_easyblock=None, **kwargs)

Get class for a particular easyblock (or use default)

easybuild.framework.easyconfig.easyconfig.get_module_path(name, generic=None, decode=True)

Determine the module path for a given easyblock or software name, based on the encoded class name.

  • generic – whether or not the easyblock is generic (if None: auto-derive from specified class name)
  • decode – whether or not to decode the provided class name
easybuild.framework.easyconfig.easyconfig.get_toolchain_hierarchy(toolchain, incl_capabilities=False)

Determine list of subtoolchains for specified parent toolchain. Result starts with the most minimal subtoolchains first, ends with specified toolchain.

The dummy toolchain is considered the most minimal subtoolchain only if the add_dummy_to_minimal_toolchains build option is enabled.

The most complex hierarchy we have now is goolfc which works as follows:

goolfc /
gompic golfc(*)

/ (*) optional toolchains, not compulsory for backwards compatibility gcccuda golf(*)


/ |

GCCcore(*) |

(dummy: only considered if –add-dummy-to-minimal-toolchains configuration option is enabled)

  • parent_toolchain – dictionary with name/version of parent toolchain
  • incl_capabilities – also register toolchain capabilities in result

Decorator to handle deprecated/replaced easyconfig parameters.


Return whether specified easyblock name is a generic easyblock or not.


Determine ‘letter’ directory for specified software name. This usually just the 1st letter of the software name (in lowercase), except for funky software names, e.g. ones starting with a digit.

easybuild.framework.easyconfig.easyconfig.process_easyconfig(path, build_specs=None, validate=True, parse_only=False, hidden=None)

Process easyconfig, returning some information for each block :param path: path to easyconfig file :param build_specs: dictionary specifying build specifications (e.g. version, toolchain, …) :param validate: whether or not to perform validation :param parse_only: only parse easyconfig superficially (faster, but results in partial info) :param hidden: indicate whether corresponding module file should be installed hidden (‘.’-prefixed)

easybuild.framework.easyconfig.easyconfig.resolve_template(value, tmpl_dict)

Given a value, try to susbstitute the templated strings with actual values. - value: some python object (supported are string, tuple/list, dict or some mix thereof) - tmpl_dict: template dictionary

easybuild.framework.easyconfig.easyconfig.robot_find_easyconfig(name, version)

Find an easyconfig for module in path, returns (absolute) path to easyconfig file (or None, if none is found).

easybuild.framework.easyconfig.easyconfig.robot_find_subtoolchain_for_dep(dep, modtool, parent_tc=None, parent_first=False)

Find the subtoolchain to use for a dependency

  • dep – dependency target dict (long and short module names may not exist yet)
  • parent_tc – toolchain from which to derive the toolchain hierarchy to search (default: use dep’s toolchain)
  • parent_first – reverse order in which subtoolchains are considered: parent toolchain, then subtoolchains

minimal toolchain for which an easyconfig exists for this dependency (and matches build_options)


Function decorator to cache (and retrieve cached) toolchain hierarchy queries.

easybuild.framework.easyconfig.easyconfig.verify_easyconfig_filename(path, specs, parsed_ec=None)

Check whether parsed easyconfig at specified path matches expected specs; this basically verifies whether the easyconfig filename corresponds to its contents

  • path – path to easyconfig file
  • specs – expected specs (dict with easyconfig parameter values)
  • parsed_ec – (list of) EasyConfig instance(s) corresponding to easyconfig file