:py:mod:`buildtest.cli.compilers` ================================= .. py:module:: buildtest.cli.compilers Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: buildtest.cli.compilers.BuildtestCompilers Functions ~~~~~~~~~ .. autoapisummary:: buildtest.cli.compilers.compiler_cmd buildtest.cli.compilers.remove_compilers buildtest.cli.compilers.list_compilers buildtest.cli.compilers.compiler_test buildtest.cli.compilers.compiler_find .. py:function:: compiler_cmd(args, configuration) .. py:function:: remove_compilers(configuration, names) This method will remove compilers from buildtest configuration file and update the configuration file. A list of compiler names are specified, if compiler is found it will be removed. :param configuration: An instance of SiteConfiguration class :type configuration: buildtest.config.SiteConfiguration :param names: A list of compiler names to remove from configuration file :type names: list .. py:function:: list_compilers(configuration, print_yaml=None, print_json=None) This method will print available compilers found in configuration file which can be retrieved by running ``buildtest config compilers list`` :param configuration: An instance of SiteConfiguration class :type configuration: buildtest.config.SiteConfiguration :param print_yaml: Print output in YAML format :type print_yaml: bool, optional :param print_json: Print output in JSON format :type print_json: bool, optional .. py:function:: compiler_test(configuration, compiler_names=None) This method implements ``buildtest config compilers test`` which tests the compilers with the corresponding modules if set. This command iterates over all compilers and perform the module load test and show an output of each compiler. :param configuration: An instance of SiteConfiguration class :type configuration: buildtest.config.SiteConfiguration :param compiler_names: A list of compiler names to test :type compiler_names: list, optional .. py:function:: compiler_find(configuration, modulepath=None, detailed=None, update=None, filepath=None) This method implements ``buildtest config compilers find`` which detects new compilers based on module names defined in configuration. If system has Lmod we use Lmodule API to detect the compilers. For environment-modules we search for all modules in current ``$MODULEPATH``. :param configuration: An instance of SiteConfiguration class :type configuration: buildtest.config.SiteConfiguration :param modulepath: A list of directories to search for modules via MODULEPATH to detect compilers :type modulepath: List, optional :param detailed: Flag for printing a detailed report. :type detailed: bool, optional :param update: Flag for updating configuration file with new compilers :type update: bool, optional :param filepath: An option to specify an alternative filepath where configuration file will be written :type filepath: str, optional .. py:class:: BuildtestCompilers(configuration, settings_file=None, detailed=False, modulepath=None) :param settings_file: Specify an alternate settings file to use when finding compilers :param settings_file: str, optional :param compilers: compiler section from buildtest configuration. :type compilers: dict .. py:attribute:: compiler_table .. py:method:: find_compilers() This method returns compiler modules discovered depending on your module system. If you have Lmod system we use spider utility to detect modules, this is leveraging Lmodule API. If you have environment-modules we parse output of ``module av -t``. :return: return a list of compiler modules detected based on module key name. :rtype: dict .. py:method:: _validate_modules(module_dict) This method will validate modules by running ``module load`` test for all discovered modules specified in parameter ``discovered_modules``. This method returns a list of modules that were valid, if all tests pass we return the same list. A module test pass if we get a returncode 0. .. py:method:: _update_compiler_section() This method will update the compiler section by adding new compilers if found :return: Updated compiler section for buildtest configuration :rtype: dict .. py:method:: print_json() Prints compiler section in JSON, this implements ``buildtest config compilers --json`` .. py:method:: print_yaml() Prints compiler section in YAML, this implements ``buildtest config compilers --yaml`` .. py:method:: names() Return a list of compiler names defined in buildtest configuration .. py:method:: print_compilers() This method implements ``buildtest config compilers`` which prints all compilers from buildtest configuration