fab.tools.tool_box#

This file contains the ToolBox class.

Classes

ToolBox()

This class implements the tool box.

class fab.tools.tool_box.ToolBox#

This class implements the tool box. It stores one tool for each category to be used in a FAB build.

has(category)#
Return type:

bool

Returns:

whether this tool box has a tool of the specified category or not.

add_tool(tool, silent_replace=False)#

Adds a tool for a given category.

Parameters:
  • tool (Tool) – the tool to add.

  • silent_replace (bool) – if set, no warning will be printed if an existing tool is replaced. (default: False)

Raises:

RuntimeError – if the tool to be added is not available.

Return type:

None

get_tool(category, mpi=None, openmp=None, enforce_fortran_linker=None)#

Returns the tool for the specified category.

Parameters:
  • category (Category) – the name of the category in which to look for the tool.

  • mpi (Optional[bool]) – if no compiler or linker is explicitly specified in this tool box, use the MPI and OpenMP setting to find an appropriate default from the tool repository. (default: None)

  • mpi – if no compiler or linker is explicitly specified in this tool box, use the MPI and OpenMP setting to find an appropriate default from the tool repository.

  • enforce_fortran_linker (Optional[bool]) – if a linker is request, this flag is used to specify if a Fortran-based linker is required. Otherwise, a C-based linker will be returned. (default: None)

Raises:

KeyError – if the category is not known.

Return type:

Tool