fab.tools.tool_repository module#
This file contains the ToolRepository class.
- class fab.tools.tool_repository.ToolRepository#
Bases:
dict
This class implements the tool repository. It stores a list of tools for various categories. For each compiler, it will automatically create a tool called “linker-{compiler-name}” which can be used for linking with the specified compiler.
Singleton access. Changes the value of _singleton so that the constructor can verify that it is indeed called from here.
- add_tool(cls)#
Creates an instance of the specified class and adds it to the tool repository.
- get_tool(category, name)#
- Return type:
- Returns:
the tool with a given name in the specified category.
- Parameters:
- Raises:
- set_default_compiler_suite(suite)#
Sets the default for linker and compilers to be of the given compiler suite.
- Parameters:
suite (
str
) – the name of the compiler suite to make the default.
- get_default(category, mpi=None, openmp=None)#
Returns the default tool for a given category. For most tools that will be the first entry in the list of tools. The exception are compilers and linker: in this case it must be specified if MPI support is required or not. And the default return will be the first tool that either supports MPI or not.
- Parameters:
- Raises:
KeyError – if the category does not exist.
RuntimeError – if no compiler/linker is found with the requested level of MPI support (yes or no).