From cc0b9babc430975a560841bfce14c8d1f8d35f8c Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Sat, 19 Nov 2016 12:54:58 -0700 Subject: [PATCH 01/20] restructuring code --- cime_config/cesm/config_files.xml | 4 +- cime_config/cesm/machines/config_build.xml | 4 +- cime_config/xml_schemas/config_build.xsd | 127 +-- scripts/Tools/code_checker | 38 +- utils/python/CIME/XML/build.py | 759 +++--------------- utils/python/CIME/XML/compilerblock.py | 237 ++++++ utils/python/CIME/XML/compilers.py | 332 +++----- utils/python/CIME/build/__init__.py | 0 utils/python/CIME/build/cmakemacroswriter.py | 119 +++ utils/python/CIME/build/macroconditiontree.py | 170 ++++ utils/python/CIME/build/macrowriterbase.py | 282 +++++++ utils/python/CIME/build/makemacroswriter.py | 93 +++ utils/python/CIME/build/possiblevalues.py | 139 ++++ utils/python/CIME/build/valuesetting.py | 107 +++ utils/python/CIME/macros_writers.py | 326 -------- 15 files changed, 1442 insertions(+), 1295 deletions(-) create mode 100644 utils/python/CIME/XML/compilerblock.py create mode 100644 utils/python/CIME/build/__init__.py create mode 100644 utils/python/CIME/build/cmakemacroswriter.py create mode 100644 utils/python/CIME/build/macroconditiontree.py create mode 100644 utils/python/CIME/build/macrowriterbase.py create mode 100644 utils/python/CIME/build/makemacroswriter.py create mode 100644 utils/python/CIME/build/possiblevalues.py create mode 100644 utils/python/CIME/build/valuesetting.py delete mode 100644 utils/python/CIME/macros_writers.py diff --git a/cime_config/cesm/config_files.xml b/cime_config/cesm/config_files.xml index 42d126bc870..ff6f3f07d67 100644 --- a/cime_config/cesm/config_files.xml +++ b/cime_config/cesm/config_files.xml @@ -43,7 +43,8 @@ char - $CIMEROOT/cime_config/$MODEL/machines/config_compilers.xml + $CIMEROOT/cime_config/$MODEL/machines/config_build.xml + $CIMEROOT/cime_config/xml_schemas/config_build.xsd case_last env_case.xml file containing compiler specifications for target model primary component (for documentation only - DO NOT EDIT) @@ -332,4 +333,3 @@ - diff --git a/cime_config/cesm/machines/config_build.xml b/cime_config/cesm/machines/config_build.xml index dd0f2f12ef1..ad363759b82 100644 --- a/cime_config/cesm/machines/config_build.xml +++ b/cime_config/cesm/machines/config_build.xml @@ -1,5 +1,5 @@ - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + @@ -39,12 +24,21 @@ - - + + + + - - + + + + - - + complicate the process of adding new models. --> + + - - - - - - - + + + + + + + + @@ -105,11 +93,48 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/Tools/code_checker b/scripts/Tools/code_checker index 2d83c2b50b9..36fb2681db1 100755 --- a/scripts/Tools/code_checker +++ b/scripts/Tools/code_checker @@ -43,13 +43,13 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter CIME.utils.setup_standard_logging_options(parser) parser.add_argument("--dir", default=get_python_libs_root(), - help="The root directory containing python files to check.") + help="The root directory containing python files to check.") parser.add_argument("-j", "--num-procs", type=int, default=8, - help="The number of files to check in parallel") + help="The number of files to check in parallel") parser.add_argument("files", nargs="*", - help="Restrict checking to specific files. Relative name is fine.") + help="Restrict checking to specific files. Relative name is fine.") args = parser.parse_args(args[1:]) @@ -66,30 +66,30 @@ def run_pylint(on_file): cimeroot = get_cime_root() if "scripts/Tools" in on_file: - cmd_options +=",relative-import" + cmd_options +=",relative-import" # add init-hook option cmd_options += " --init-hook='sys.path.extend((\"%s\",\"%s\"))'"%\ - (os.path.join(cimeroot,"utils","python"), - os.path.join(cimeroot,"scripts","Tools")) + (os.path.join(cimeroot,"utils","python"), + os.path.join(cimeroot,"scripts","Tools")) cmd = "%s %s %s" % (pylint, cmd_options, on_file) - + logger.debug("pylint command is %s"%cmd) stat, out, err = run_cmd(cmd, verbose=False, from_dir=cimeroot) if stat != 0: - logger.info("File %s has pylint problems, please fix\n Use command: %s" % (on_file, cmd)) - logger.info(out + "\n" + err) - return False + logger.info("File %s has pylint problems, please fix\n Use command: %s" % (on_file, cmd)) + logger.info(out + "\n" + err) + return False else: - logger.info("File %s has no pylint problems" % on_file) - return True + logger.info("File %s has no pylint problems" % on_file) + return True ############################################################################### def matches(file_path, file_ends): ############################################################################### for file_end in file_ends: - if file_path.endswith(file_end): - return True + if file_path.endswith(file_end): + return True return False @@ -104,9 +104,11 @@ def check_code(dir_to_check, num_procs, files): # Get list of files to check files_to_check = run_cmd_no_fail('git ls-files --full-name %s' % dir_to_check, verbose=False).splitlines() if files: - files_to_check = [item for item in files_to_check if matches(item, files)] + files_to_check = [item for item in files_to_check if matches(item, files)] else: - files_to_check = [item for item in files_to_check if item.endswith(".py")] + files_to_check = [item for item in files_to_check if item.endswith(".py")] + if len(files_to_check) == 0: + files_to_check = files pool = ThreadPool(num_procs) results = pool.map(run_pylint, files_to_check) @@ -116,8 +118,8 @@ def check_code(dir_to_check, num_procs, files): def _main_func(description): ############################################################################### if ("--test" in sys.argv): - test_results = doctest.testmod(verbose=True) - sys.exit(1 if test_results.failed > 0 else 0) + test_results = doctest.testmod(verbose=True) + sys.exit(1 if test_results.failed > 0 else 0) pylint = find_executable("pylint") expect(pylint is not None, "pylint not found") diff --git a/utils/python/CIME/XML/build.py b/utils/python/CIME/XML/build.py index 438440ef364..29c0ad19383 100644 --- a/utils/python/CIME/XML/build.py +++ b/utils/python/CIME/XML/build.py @@ -65,589 +65,10 @@ from CIME.macros_writers import * from CIME.utils import get_cime_root -from CIME.XML.machines import Machines # pylint: disable=unused-import from CIME.XML.standard_module_setup import * __all__ = ["Build"] -logger = logging.getLogger(__name__) - -class ValueSetting(object): - - """Holds data about how a value can be assigned to a variable. - - Note that this class doesn't know or care *which* variable might be - assigned in this way, only that there is a procedure to perform that - operation - - Public attributes: - value - The actual value that will be set. - do_append - Boolean describing whether the value should be - appended to the existing value of the variable rather - than overwriting other settings. - conditions - Dictionary containing the set of values that different - variables have to have to use this setting (e.g. - DEBUG="TRUE" might be a condition on a debug flag). - set_up - List of any commands that have to be executed in the build - system before this setting can occur. - tear_down - List of any commands that should be executed to clean up - after setting the variable. - - Public methods: - is_ambiguous_with - """ - - def __init__(self, value, do_append, conditions, set_up, tear_down): # pylint: disable=too-many-arguments - """Create a ValueSetting object by specifying all its data.""" - self.value = value - self.do_append = do_append - self.conditions = conditions - self.set_up = set_up - self.tear_down = tear_down - - def is_ambiguous_with(self, other): - """Check to see if this setting conflicts with another one. - - The purpose of this routine is to see if two settings can coexist - in the same Macros file, or if doing so would raise an ambiguity - about which one should be preferred over the other. Note that this - is a symmetric relation (this function returns the same value if - self and other are swapped). - - The rules to determine this are as follows: - - 1) If one or both settings are appending to the value, there's no - ambiguity, because both can cooperate to set the value. - - >>> a = ValueSetting('foo', True, dict(), [], []) - >>> b = ValueSetting('bar', False, dict(), [], []) - >>> a.is_ambiguous_with(b) - False - >>> b.is_ambiguous_with(a) - False - - 2) If the two settings have conflicting conditions, then there - is no ambiguity because they can't both apply to the same - build. - - >>> a = ValueSetting('foo', False, {"DEBUG": "TRUE"}, [], []) - >>> b = ValueSetting('bar', False, {"DEBUG": "FALSE"}, [], []) - >>> a.is_ambiguous_with(b) - False - - 3) If one setting is strictly more specific than the other, then - there's no ambiguity, because we prefer the more specific - setting whenever both apply to a build. - - >>> a = ValueSetting('foo', False, {"DEBUG": "TRUE"}, [], []) - >>> b = ValueSetting('bar', False, {"DEBUG": "TRUE", "MPILIB": "mpich2"}, [], []) - >>> a.is_ambiguous_with(b) - False - >>> b.is_ambiguous_with(a) - False - - 4) All other cases are considered ambiguous. - - >>> a = ValueSetting('foo', False, dict(), [], []) - >>> b = ValueSetting('bar', False, dict(), [], []) - >>> a.is_ambiguous_with(b) - True - >>> a = ValueSetting('foo', False, {"DEBUG": "TRUE"}, [], []) - >>> b = ValueSetting('bar', False, {"MPILIB": "mpich2"}, [], []) - >>> a.is_ambiguous_with(b) - True - """ - # Append check. - if self.do_append or other.do_append: - return False - # Consistency check. - for var_name in self.conditions: - if var_name not in other.conditions: - continue - if self.conditions[var_name] != other.conditions[var_name]: - return False - # Specificity check. - # One setting being more specific than the other is equivalent to - # its set of conditions being a proper superset of the others. - self_set = set(self.conditions.keys()) - other_set = set(other.conditions.keys()) - if self_set < other_set or self_set > other_set: - return False - # Any situation we couldn't resolve is ambiguous. - return True - - -class PossibleValues(object): - - """Holds a list of settings for a single "Macros" variable. - - This helper class takes in variable settings and, for each one, decides - whether to throw it out, add it to the list of values, or replace the - existing list of values with the new, more specific setting. - - This class also performs ambiguity checking; if it is possible at build - time for more than one setting to match the same variable, this is - considered an error. - - Public attributes: - name - The name of the variable. - settings - The current list of possible initial settings for the - variable. - append_settings - A dictionary of lists of possible appending settings - for the variable, with the specificity of each list - as the associated dictionary key. - depends - The current list of variables that this variable depends on - to get its value. - - Public methods: - add_setting - ambiguity_check - to_cond_trees - """ - - def __init__(self, name, setting, specificity, depends): - """Construct a PossibleValues object. - - The name argument refers to the name of the variable. The other - arguments are the same as for append_match. - """ - self.name = name - self.depends = depends - # If this is an appending setting, its specificity can't cause it - # to overwrite other settings, but we want to keep track of it. - if setting.do_append: - self.settings = [] - self.append_settings = {specificity: [setting]} - self._specificity = 0 - else: - self.settings = [setting] - self.append_settings = {} - self._specificity = specificity - - def add_setting(self, setting, specificity, depends): - """Add a possible value for a variable. - - Arguments: - setting - A ValueSetting to start the list. - specificity - An integer representing how specific the setting is. - Only the initial settings with the highest - specificity and appending settings with at least that - specificity will actually be kept in the list. The - lowest allowed specificity is 0. - depends - A set of variable names, specifying the variables that - have to be set before this setting can be used (e.g. if - SLIBS refers to NETCDF_PATH, then NETCDF_PATH has to be - set first). - - >>> a = ValueSetting('foo', False, dict(), [], []) - >>> b = ValueSetting('bar', False, dict(), [], []) - >>> vals = PossibleValues('var', a, 0, {'dep1'}) - >>> vals.add_setting(b, 1, {'dep2'}) - >>> a not in vals.settings and b in vals.settings - True - >>> 'dep1' not in vals.depends and 'dep2' in vals.depends - True - >>> vals.add_setting(a, 1, {'dep1'}) - >>> a in vals.settings and b in vals.settings - True - >>> 'dep1' in vals.depends and 'dep2' in vals.depends - True - """ - if setting.do_append: - # Appending settings with at least the current level of - # specificity should be kept. - if specificity >= self._specificity: - if specificity not in self.append_settings: - self.append_settings[specificity] = [] - self.append_settings[specificity].append(setting) - self.depends |= depends - else: - # Add equally specific settings to the list. - if specificity == self._specificity: - self.settings.append(setting) - self.depends |= depends - # Replace the list if the setting is more specific. - elif specificity > self._specificity: - self.settings = [setting] - self._specificity = specificity - self.depends = depends - # Do nothing if the setting is less specific. - - def ambiguity_check(self): - """Check the current list of settings for ambiguity. - - This function raises an error if an ambiguity is found. - """ - for i in range(len(self.settings)-1): - for other in self.settings[i+1:]: - expect(not self.settings[i].is_ambiguous_with(other), - "Variable "+self.name+" is set ambiguously in " - "config_build.xml. Check the file for these " - "conflicting settings: \n1: {}\n2: {}".format( - self.settings[i].conditions, other.conditions)) - - def to_cond_trees(self): - """Convert this object to a pair of MacroConditionTree objects. - - This represents the step where the list of possible values is - frozen and we're ready to convert it into an actual text file. This - object is checked for ambiguities before conversion. - - The return value is a tuple of two trees. The first contains all - initial settings, and the second contains all appending settings. - If either would be empty, None is returned instead. - """ - self.ambiguity_check() - if self.settings: - normal_tree = MacroConditionTree(self.name, self.settings) - else: - normal_tree = None - append_settings = [] - for specificity in self.append_settings: - if specificity >= self._specificity: - append_settings += self.append_settings[specificity] - if append_settings: - append_tree = MacroConditionTree(self.name, append_settings) - else: - append_tree = None - return (normal_tree, append_tree) - - -class MacroConditionTree(object): # pylint: disable=too-many-instance-attributes - - """Tree containing the various possible settings of a specific macro. - - Unlike the PossibleValues class, this class assumes that we have - finished determining which settings could apply on a given machine. It - also sorts the settings based on the conditions under which they take - effect, in preparation for writing out the Macros file itself. - - Public methods: - merge - write_out - """ - - def __init__(self, name, settings): - """Create a MacroConditionTree recursively. - - Arguments: - name - Name of the variable. - settings - A list of all settings for this variable. - """ - # Search for any conditions controlling the number of settings. - condition = None - # Prefer the COMPILER attribute as the top level attribute, for - # readability of the merged file. - if any("COMPILER" in setting.conditions for setting in settings): - condition = "COMPILER" - else: - # To make merging more effective, sort the conditions. - all_conditions = [] - for setting in settings: - all_conditions += setting.conditions.keys() - if all_conditions: - condition = sorted(all_conditions)[0] - if condition is None: - # If there are no conditions, we have reached a leaf. - # We combine whatever settings are left; there should be at - # most one non-appending setting, or an arbitrary number of - # appending settings. - self._is_leaf = True - self._assignments = [] - self._set_up = [] - self._tear_down = [] - self._do_append = True - for setting in settings: - if not setting.do_append: - self._do_append = False - assert len(settings) == 1, \ - "Internal error in macros: An ambiguity was " \ - "found after the ambiguity check was complete, " \ - "or there is a mixture of appending and initial " \ - "settings in the condition tree." - self._assignments.append((name, setting.value)) - self._set_up += setting.set_up - self._tear_down += setting.tear_down - else: - # If a condition was found, partition the settings depending on - # how they use it, and recursively create a tree for each - # partition. - self._is_leaf = False - self._condition = condition - partition = dict() - for setting in settings: - # If some of the settings don't use a condition, we use - # None to represent that. - cond_val = setting.conditions.pop(condition, None) - if cond_val in partition: - partition[cond_val].append(setting) - else: - partition[cond_val] = [setting] - branches = dict() - for cond_val in partition: - branches[cond_val] = \ - MacroConditionTree(name, partition[cond_val]) - self._branches = branches - - # pylint shouldn't concern itself with the way that we access other, since - # it's actually a member of the same class. - # pylint:disable=protected-access - def merge(self, other): - """Merge another tree with this one. - - This should be considered destructive to both trees. The only valid - value is the one that's returned. - """ - if self._is_leaf: - if other._is_leaf: - assert self._do_append == other._do_append, \ - "Internal error in macros: Tried to merge an " \ - "appending tree with a tree containing initial "\ - "settings." - # If both are leaves, just merge the values. - self._assignments += other._assignments - self._set_up += other._set_up - self._tear_down += other._tear_down - return self - else: - # If other is not a leaf, swap the arguments so that self - # is the one that's not a leaf, handled below. - return other.merge(self) - else: - # If self is not a leaf but other is, it should go in - # self._branches[None]. The same goes for the case where the - # conditions don't match, and self._condition is last - # alphabetically. - if other._is_leaf or self._condition > other._condition: - if None in self._branches: - self._branches[None] = self._branches[None].merge(other) - else: - self._branches[None] = other - return self - else: - # If the other condition comes last alphabetically, swap - # the order. - if self._condition < other._condition: - return other.merge(self) - # If neither is a leaf and their conditions match, merge - # their sets of branches. - for (cond_val, other_branch) in other._branches.items(): - if cond_val in self._branches: - self._branches[cond_val] = \ - self._branches[cond_val].merge(other_branch) - else: - self._branches[cond_val] = other_branch - return self - # pylint:enable=protected-access - - def write_out(self, writer): - """Write tree to file. - - The writer argument is an object inheriting from MacroWriterBase. - This function first writes out all the initial settings with - appropriate conditionals, then the appending settings. - """ - if self._is_leaf: - for line in self._set_up: - writer.write_line(line) - for (name, value) in self._assignments: - if self._do_append: - writer.append_variable(name, value) - else: - writer.set_variable(name, value) - for line in self._tear_down: - writer.write_line(line) - else: - condition = self._condition - # Take care of the settings that don't use this condition. - if None in self._branches: - self._branches[None].write_out(writer) - # Now all the if statements. - for cond_val in self._branches: - if cond_val is None: - continue - env_ref = writer.environment_variable_string(condition) - writer.start_ifeq(env_ref, cond_val) - self._branches[cond_val].write_out(writer) - writer.end_ifeq() - - -def _merge_optional_trees(tree, big_tree): - """Merge two MacroConditionTrees when one or both objects may be `None`.""" - if tree is not None: - if big_tree is None: - return tree - else: - return big_tree.merge(tree) - else: - return big_tree - - -class CompilerBlock(object): - - """Data used to translate a single element. - - This is used during write_macros to traverse the XML and create a list - of settings specified in the element. - - Public methods: - add_settings_to_lists - matches_machine - """ - - def __init__(self, writer, compiler_elem, machobj): - """Construct a CompilerBlock. - - Arguments: - writer - The Makefile/CMake writer object. - compiler_elem - An xml.ElementTree.Element corresponding to this - element. - machobj - Machines object for this machine. - """ - self._writer = writer - self._compiler_elem = compiler_elem - self._machobj = machobj - # If there's no COMPILER attribute, self._compiler is None. - self._compiler = compiler_elem.get("COMPILER") - self._specificity = 0 - - def _handle_references(self, elem, set_up, tear_down, depends): - """Expand markup used internally. - - This function is responsible for expanding , , and - tags into Makefile/CMake syntax. - - Arguments: - elem - An ElementTree.Element containing text to expand. - set_up - A list to add any preparation commands to. - tear_down - A list to add any cleanup commands to. - depends - A set of variables that need to be set before this one. - - Note that while the return value of this function is the expanded - text, the set_up, tear_down, and depends variables are also - modified and thus serve as additional outputs. - """ - writer = self._writer - output = elem.text - if output is None: - output = "" - for child in elem: - if child.tag == "env": - # tags just need to be expanded by the writer. - output += writer.environment_variable_string(child.text) - elif child.tag == "shell": - # tags can contain other tags, so handle those. - command = self._handle_references(child, set_up, tear_down, - depends) - new_set_up, inline, new_tear_down = \ - writer.shell_command_strings(command) - output += inline - if new_set_up is not None: - set_up.append(new_set_up) - if new_tear_down is not None: - tear_down.append(new_tear_down) - elif child.tag == "var": - # commands also need expansion by the writer, and can - # add dependencies. - var_name = child.text - output += writer.variable_string(var_name) - depends.add(var_name) - else: - expect(False, - "Unexpected tag "+child.tag+" encountered in " - "config_build.xml. Check that the file is valid " - "according to the schema.") - if child.tail is not None: - output += child.tail - return output - - def _elem_to_setting(self, elem): - """Take an element and convert it to a ValueSetting. - - Arguments: - elem - An ElementTree.Element with data to add. - - This function returns a tuple containing a ValueSetting - corresponding to the element, along with a set of names of - variables that this setting depends on. - """ - # Attributes on an element are the conditions on that element. - conditions = dict(elem.items()) - if self._compiler is not None: - conditions["COMPILER"] = self._compiler - # Deal with internal markup. - set_up = [] - tear_down = [] - depends = set() - value_text = self._handle_references(elem, set_up, - tear_down, depends) - # Create the setting object. - setting = ValueSetting(value_text, elem.tag == "append", - conditions, set_up, tear_down) - return (setting, depends) - - def _add_elem_to_lists(self, name, elem, value_lists): - """Add an element's data to an appropriate list of value settings. - - Arguments: - name - The name of the variable being set by this element. - elem - The element to translate into a ValueSetting. - value_lists - A dictionary of PossibleValues, containing the lists - of all settings for each variable. - """ - # Skip this if the element's MPILIB is not valid. - if "MPILIB" in elem.keys() and \ - not self._machobj.is_valid_MPIlib(elem.get("MPILIB")): - return - setting, depends = self._elem_to_setting(elem) - if name not in value_lists: - value_lists[name] = PossibleValues(name, setting, - self._specificity, depends) - else: - value_lists[name].add_setting(setting, self._specificity, - depends) - - def add_settings_to_lists(self, flag_vars, value_lists): - """Add all data in the element to lists of settings. - - Arguments: - flag_vars - A set of variables containing "flag-like" data. - value_lists - A dictionary of PossibleValues, containing the lists - of all settings for each variable. - """ - for elem in self._compiler_elem: - # Deal with "flag"-type variables. - if elem.tag in flag_vars: - for child in elem: - self._add_elem_to_lists(elem.tag, child, value_lists) - else: - self._add_elem_to_lists(elem.tag, elem, value_lists) - - def matches_machine(self): - """Check whether this block matches a machine/os. - - This also sets the specificity of the block, so this must be called - before add_settings_to_lists if machine-specific output is needed. - """ - self._specificity = 0 - if "MACH" in self._compiler_elem.keys(): - if self._machobj.get_machine_name() == \ - self._compiler_elem.get("MACH"): - self._specificity += 2 - else: - return False - if "OS" in self._compiler_elem.keys(): - if self._machobj.get_value("OS") == self._compiler_elem.get("OS"): - self._specificity += 1 - else: - return False - # Check if the compiler is valid on this machine. - if self._compiler is not None: - return self._machobj.is_valid_compiler(self._compiler) - else: - return True - - class Build(object): """Class to convert config_build.xml input into a macros file. @@ -656,101 +77,101 @@ class Build(object): os - Operating system used in config_build lookup and ranking. machobj - Machines object used in config_build lookup. flag_vars - A set of all variables in config_build that contain "flag- - like" data (i.e. a space-separated list of arguments). + like" data (i.e. a space-separated list of arguments). Public methods: write_macros """ def __init__(self, machobj, schema_path=None): - """Construct a Build given machine-specific information. - - In the process some information about possible variables is read in - from the schema file. - - Arguments: - machobj - A Machines object for this machine. - schema_path (optional) - Path to config_build.xsd within CIME. - - >>> "CFLAGS" in Build('MyMach').flag_vars - True - >>> "MPICC" in Build('MyMach').flag_vars - False - """ - self.machobj = machobj - - # The schema is used to figure out which variables contain - # command-line arguments (e.g. compiler flags), since these are - # processed in a more complex manner than other variables. - if schema_path is None: - schema_path = os.path.join(get_cime_root(), "cime_config", - "xml_schemas", "config_build.xsd") - - # Run an XPath query to extract the list of flag variable names. - ns = {"xs": "http://www.w3.org/2001/XMLSchema"} - flag_xpath = ".//xs:group[@name='compilerVars']/xs:choice/xs:element[@type='flagsVar']" - flag_elems = ET.parse(schema_path).getroot().findall(flag_xpath, ns) - self.flag_vars = set(elem.get('name') for elem in flag_elems) + """Construct a Build given machine-specific information. + + In the process some information about possible variables is read in + from the schema file. + + Arguments: + machobj - A Machines object for this machine. + schema_path (optional) - Path to config_build.xsd within CIME. + + >>> "CFLAGS" in Build('MyMach').flag_vars + True + >>> "MPICC" in Build('MyMach').flag_vars + False + """ + self.machobj = machobj + + # The schema is used to figure out which variables contain + # command-line arguments (e.g. compiler flags), since these are + # processed in a more complex manner than other variables. + if schema_path is None: + schema_path = os.path.join(get_cime_root(), "cime_config", + "xml_schemas", "config_build.xsd") + + # Run an XPath query to extract the list of flag variable names. + ns = {"xs": "http://www.w3.org/2001/XMLSchema"} + flag_xpath = ".//xs:group[@name='compilerVars']/xs:choice/xs:element[@type='flagsVar']" + flag_elems = ET.parse(schema_path).getroot().findall(flag_xpath, ns) + self.flag_vars = set(elem.get('name') for elem in flag_elems) def write_macros(self, build_system, xml_file, output): - """Write a Macros file for this machine. - - Arguments: - build_system - Format of the file to be written. Currently the only - valid values are "Makefile" and "CMake". - xml_file - File name or file object containing the config_build - specification of machine-specific settings. - output - Text I/O object (inheriting from io.TextIOBase) that - output should be written to. Typically, this will be the - Macros file, opened for writing. - """ - # Set up writer for this build system. - if build_system == "Makefile": - writer = MakeMacroWriter(output) - elif build_system == "CMake": - writer = CMakeMacroWriter(output) - else: - expect(False, - "Unrecognized build system provided to write_macros: " + - build_system) - - # Start processing the file. - value_lists = dict() - for compiler_elem in ET.parse(xml_file).findall("compiler"): - block = CompilerBlock(writer, compiler_elem, self.machobj) - # If this block matches machine settings, use it. - if block.matches_machine(): - block.add_settings_to_lists(self.flag_vars, value_lists) - - # Now that we've scanned through the input, output the variable - # settings. - vars_written = set() - while value_lists: - # Variables that are ready to be written. - ready_variables = [ - var_name for var_name in value_lists.keys() - if value_lists[var_name].depends <= vars_written - ] - expect(len(ready_variables) > 0, - "The config_build XML has bad references. " - "Check for circular references or variables that " - "are in a tag but not actually defined.") - big_normal_tree = None - big_append_tree = None - for var_name in ready_variables: - # Note that we're writing this variable. - vars_written.add(var_name) - # Make the conditional trees and write them out. - normal_tree, append_tree = \ - value_lists[var_name].to_cond_trees() - big_normal_tree = _merge_optional_trees(normal_tree, - big_normal_tree) - big_append_tree = _merge_optional_trees(append_tree, - big_append_tree) - # Remove this variable from the list of variables to handle - # next iteration. - del value_lists[var_name] - if big_normal_tree is not None: - big_normal_tree.write_out(writer) - if big_append_tree is not None: - big_append_tree.write_out(writer) + """Write a Macros file for this machine. + + Arguments: + build_system - Format of the file to be written. Currently the only + valid values are "Makefile" and "CMake". + xml_file - File name or file object containing the config_build + specification of machine-specific settings. + output - Text I/O object (inheriting from io.TextIOBase) that + output should be written to. Typically, this will be the + Macros file, opened for writing. + """ + # Set up writer for this build system. + if build_system == "Makefile": + writer = MakeMacroWriter(output) + elif build_system == "CMake": + writer = CMakeMacroWriter(output) + else: + expect(False, + "Unrecognized build system provided to write_macros: " + + build_system) + + # Start processing the file. + value_lists = dict() + for compiler_elem in ET.parse(xml_file).findall("compiler"): + block = CompilerBlock(writer, compiler_elem, self.machobj) + # If this block matches machine settings, use it. + if block.matches_machine(): + block.add_settings_to_lists(self.flag_vars, value_lists) + + # Now that we've scanned through the input, output the variable + # settings. + vars_written = set() + while value_lists: + # Variables that are ready to be written. + ready_variables = [ + var_name for var_name in value_lists.keys() + if value_lists[var_name].depends <= vars_written + ] + expect(len(ready_variables) > 0, + "The config_build XML has bad references. " + "Check for circular references or variables that " + "are in a tag but not actually defined.") + big_normal_tree = None + big_append_tree = None + for var_name in ready_variables: + # Note that we're writing this variable. + vars_written.add(var_name) + # Make the conditional trees and write them out. + normal_tree, append_tree = \ + value_lists[var_name].to_cond_trees() + big_normal_tree = _merge_optional_trees(normal_tree, + big_normal_tree) + big_append_tree = _merge_optional_trees(append_tree, + big_append_tree) + # Remove this variable from the list of variables to handle + # next iteration. + del value_lists[var_name] + if big_normal_tree is not None: + big_normal_tree.write_out(writer) + if big_append_tree is not None: + big_append_tree.write_out(writer) diff --git a/utils/python/CIME/XML/compilerblock.py b/utils/python/CIME/XML/compilerblock.py new file mode 100644 index 00000000000..ae190766fa8 --- /dev/null +++ b/utils/python/CIME/XML/compilerblock.py @@ -0,0 +1,237 @@ +""" +Classes used to build the CIME Macros file. + +The main "public" class here is Build. It is initialized with machine-specific +information, and its write_macros method is the driver for translating the +config_build.xml file into a Makefile or CMake-format Macros file. + +For developers, here's the role of the other classes in the process: + +- A CompilerBlock is responsible for translating the XML code in a + tag into Python data structures. + +- A PossibleValues object keeps track of all the settings that could affect a + particular variable, and is the main way that these settings are stored. + +- A MacroConditionTree is the structure that is responsible for writing out the + settings. While the PossibleValues objects are organized by variable name, the + MacroConditionTree is organized by conditional blocks, and thus roughly + plays the role of a syntax tree corresponding to the Makefile/CMake output. + +In more detail: + +- Build.write_macros immediately creates a MakeMacroWriter or CMakeMacroWriter + to translate strings for the build system. + +- It also creates value_lists, a dictionary of PossibleValues objects, with + variable names as the keys. Each variable has a single PossibleValues object + associated with it. + +- For each element, Build.write_macros creates a CompilerBlock + instance. This object is responsible for translating the XML in its block, in + order to populate the PossibleValues instances. This includes handling the + // tags, and keeping track of dependencies induced by one + variable referencing another's value. + +- The PossibleValues object holds the information about how one variable can be + set, based on various build options. It has two main roles: + 1. As we iterate through the XML input file, each setting is added to the + relevant PossibleValues object. The PossibleValues object contains lists + of settings sorted by how machine-specific those settings are. + 2. The PossibleValues object iterates through the list of settings to check + for ambiguities. E.g. if there is a setting for DEBUG=TRUE, and another + setting for MPILIB=mpi-serial, it is ambiguous in the case where both + conditions hold. + +- A ValueSetting object is a simple struct that a setting from the XML file is + translated to. The lists in the PossibleValues class contain these objects. + +- Once the XML has all been read in and the PossibleValues objects are + populated, the dependencies among variables are checked in Build.write_macros. + For each variable, if all its dependencies have been handled, it is converted + to a MacroConditionTree merged with all other trees for variables that are + ready, and written out. Then we loop through the variable list again to check + for variables whose dependencies are all handled. + +- The MacroConditionTree acts as a primitive syntax tree. Its __init__ method + reorganizes the data into conditional blocks, and its write_out method writes + uses the MakeMacroWriter/CMakeMacroWrite object to write to the Macros file. + MacroConditionTree objects can be merged to reduce the length of the output. +""" + +# These don't seem to be particularly useful checks. +# pylint: disable=invalid-name,too-few-public-methods,unused-wildcard-import +# pylint: disable=wildcard-import + +from CIME.macros_writers import * +from CIME.utils import get_cime_root +from CIME.XML.standard_module_setup import * + +__all__ = ["Build"] + + + + +class CompilerBlock(object): + + """Data used to translate a single element. + + This is used during write_macros to traverse the XML and create a list + of settings specified in the element. + + Public methods: + add_settings_to_lists + matches_machine + """ + + def __init__(self, writer, compiler_elem, machobj): + """Construct a CompilerBlock. + + Arguments: + writer - The Makefile/CMake writer object. + compiler_elem - An xml.ElementTree.Element corresponding to this + element. + machobj - Machines object for this machine. + """ + self._writer = writer + self._compiler_elem = compiler_elem + self._machobj = machobj + # If there's no COMPILER attribute, self._compiler is None. + self._compiler = compiler_elem.get("COMPILER") + self._specificity = 0 + + def _handle_references(self, elem, set_up, tear_down, depends): + """Expand markup used internally. + + This function is responsible for expanding , , and + tags into Makefile/CMake syntax. + + Arguments: + elem - An ElementTree.Element containing text to expand. + set_up - A list to add any preparation commands to. + tear_down - A list to add any cleanup commands to. + depends - A set of variables that need to be set before this one. + + Note that while the return value of this function is the expanded + text, the set_up, tear_down, and depends variables are also + modified and thus serve as additional outputs. + """ + writer = self._writer + output = elem.text + if output is None: + output = "" + for child in elem: + if child.tag == "env": + # tags just need to be expanded by the writer. + output += writer.environment_variable_string(child.text) + elif child.tag == "shell": + # tags can contain other tags, so handle those. + command = self._handle_references(child, set_up, tear_down, + depends) + new_set_up, inline, new_tear_down = \ + writer.shell_command_strings(command) + output += inline + if new_set_up is not None: + set_up.append(new_set_up) + if new_tear_down is not None: + tear_down.append(new_tear_down) + elif child.tag == "var": + # commands also need expansion by the writer, and can + # add dependencies. + var_name = child.text + output += writer.variable_string(var_name) + depends.add(var_name) + else: + expect(False, + "Unexpected tag "+child.tag+" encountered in " + "config_build.xml. Check that the file is valid " + "according to the schema.") + if child.tail is not None: + output += child.tail + return output + + def _elem_to_setting(self, elem): + """Take an element and convert it to a ValueSetting. + + Arguments: + elem - An ElementTree.Element with data to add. + + This function returns a tuple containing a ValueSetting + corresponding to the element, along with a set of names of + variables that this setting depends on. + """ + # Attributes on an element are the conditions on that element. + conditions = dict(elem.items()) + if self._compiler is not None: + conditions["COMPILER"] = self._compiler + # Deal with internal markup. + set_up = [] + tear_down = [] + depends = set() + value_text = self._handle_references(elem, set_up, + tear_down, depends) + # Create the setting object. + setting = ValueSetting(value_text, elem.tag == "append", + conditions, set_up, tear_down) + return (setting, depends) + + def _add_elem_to_lists(self, name, elem, value_lists): + """Add an element's data to an appropriate list of value settings. + + Arguments: + name - The name of the variable being set by this element. + elem - The element to translate into a ValueSetting. + value_lists - A dictionary of PossibleValues, containing the lists + of all settings for each variable. + """ + # Skip this if the element's MPILIB is not valid. + if "MPILIB" in elem.keys() and \ + not self._machobj.is_valid_MPIlib(elem.get("MPILIB")): + return + setting, depends = self._elem_to_setting(elem) + if name not in value_lists: + value_lists[name] = PossibleValues(name, setting, + self._specificity, depends) + else: + value_lists[name].add_setting(setting, self._specificity, + depends) + + def add_settings_to_lists(self, flag_vars, value_lists): + """Add all data in the element to lists of settings. + + Arguments: + flag_vars - A set of variables containing "flag-like" data. + value_lists - A dictionary of PossibleValues, containing the lists + of all settings for each variable. + """ + for elem in self._compiler_elem: + # Deal with "flag"-type variables. + if elem.tag in flag_vars: + for child in elem: + self._add_elem_to_lists(elem.tag, child, value_lists) + else: + self._add_elem_to_lists(elem.tag, elem, value_lists) + + def matches_machine(self): + """Check whether this block matches a machine/os. + + This also sets the specificity of the block, so this must be called + before add_settings_to_lists if machine-specific output is needed. + """ + self._specificity = 0 + if "MACH" in self._compiler_elem.keys(): + if self._machobj.get_machine_name() == \ + self._compiler_elem.get("MACH"): + self._specificity += 2 + else: + return False + if "OS" in self._compiler_elem.keys(): + if self._machobj.get_value("OS") == self._compiler_elem.get("OS"): + self._specificity += 1 + else: + return False + # Check if the compiler is valid on this machine. + if self._compiler is not None: + return self._machobj.is_valid_compiler(self._compiler) + else: + return True diff --git a/utils/python/CIME/XML/compilers.py b/utils/python/CIME/XML/compilers.py index 68bd76f531d..cc34e21e580 100644 --- a/utils/python/CIME/XML/compilers.py +++ b/utils/python/CIME/XML/compilers.py @@ -5,256 +5,134 @@ from CIME.XML.standard_module_setup import * from CIME.XML.generic_xml import GenericXML from CIME.XML.files import Files +from CIME.XML.build.macros_writer import write_macros_file_v1 logger = logging.getLogger(__name__) class Compilers(GenericXML): def __init__(self, compiler=None, machine=None, os_= None, mpilib=None, infile=None, files=None): - """ - initialize an object - """ - if infile is None: - if files is None: - files = Files() - infile = files.get_value("COMPILERS_SPEC_FILE") + """ + initialize an object + """ + if infile is None: + if files is None: + files = Files() + infile = files.get_value("COMPILERS_SPEC_FILE") + schema = files.get_schema("COMPILERS_SPEC_FILE") + + GenericXML.__init__(self, infile, schema) + self._version = self.get_version() + + self.machine = machine + self.os = os_ + self.mpilib = mpilib + self.compiler_nodes = None # Listed from last to first + self.compiler = compiler + #Append the contents of $HOME/.cime/config_compilers.xml if it exists + #This could cause problems if node matchs are repeated when only one is expected + infile = os.path.join(os.environ.get("HOME"),".cime","config_compilers.xml") + if os.path.exists(infile): + GenericXML.read(self, infile, schema) + + if self.compiler is not None: + self.set_compiler(compiler) + + if self._version != "1.0": + # Run an XPath query to extract the list of flag variable names. + ns = {"xs": "http://www.w3.org/2001/XMLSchema"} + flag_xpath = ".//xs:group[@name='compilerVars']/xs:choice/xs:element[@type='flagsVar']" + flag_elems = ET.parse(schema).getroot().findall(flag_xpath, ns) + self.flag_vars = set(elem.get('name') for elem in flag_elems) - GenericXML.__init__(self, infile) - - self.machine = machine - self.os = os_ - self.mpilib = mpilib - self.compiler_nodes = None # Listed from last to first - self.compiler = compiler - #Append the contents of $HOME/.cime/config_compilers.xml if it exists - #This could cause problems if node matchs are repeated when only one is expected - infile = os.path.join(os.environ.get("HOME"),".cime","config_compilers.xml") - if os.path.exists(infile): - GenericXML.read(self, infile) - - if self.compiler is not None: - self.set_compiler(compiler) def get_compiler(self): - """ - Return the name of the compiler - """ - return self.compiler + """ + Return the name of the compiler + """ + return self.compiler def get_optional_compiler_node(self, nodename, attributes=None): - """ - Return data on a node for a compiler - """ - expect(self.compiler_nodes is not None, "Compiler not set, use parent get_node?") - for compiler_node in self.compiler_nodes: - result = self.get_optional_node(nodename, attributes, root=compiler_node) - if result is not None: - return result + """ + Return data on a node for a compiler + """ + expect(self.compiler_nodes is not None, "Compiler not set, use parent get_node?") + for compiler_node in self.compiler_nodes: + result = self.get_optional_node(nodename, attributes, root=compiler_node) + if result is not None: + return result - return None + return None def _is_compatible(self, compiler_node, compiler, machine, os_, mpilib): - for xmlid, value in [ ("COMPILER", compiler), ("MACH", machine), ("OS", os_), ("MPILIB", mpilib) ]: - if value is not None and xmlid in compiler_node.attrib and value != compiler_node.get(xmlid): - return False + for xmlid, value in [ ("COMPILER", compiler), ("MACH", machine), ("OS", os_), ("MPILIB", mpilib) ]: + if value is not None and xmlid in compiler_node.attrib and value != compiler_node.get(xmlid): + return False - return True + return True def set_compiler(self, compiler, machine=None, os_=None, mpilib=None): - """ - Sets the compiler block in the Compilers object - - >>> machobj = Compilers(machine="melvin") - >>> machobj.set_compiler("gnu") - >>> machobj.get_compiler() - 'gnu' - """ - machine = machine if machine else self.machine - os_ = os_ if os_ else self.os - mpilib = mpilib if mpilib else self.mpilib - - if self.compiler != compiler or self.machine != machine or self.os != os_ or self.mpilib != mpilib or self.compiler_nodes is None: - self.compiler_nodes = [] - nodes = self.get_nodes("compiler") - for node in nodes: - if self._is_compatible(node, compiler, machine, os_, mpilib): - self.compiler_nodes.append(node) - - self.compiler_nodes.reverse() - - self.compiler = compiler - self.machine = machine - self.os = os_ - self.mpilib = mpilib + """ + Sets the compiler block in the Compilers object + + >>> machobj = Compilers(machine="melvin") + >>> machobj.set_compiler("gnu") + >>> machobj.get_compiler() + 'gnu' + """ + machine = machine if machine else self.machine + os_ = os_ if os_ else self.os + mpilib = mpilib if mpilib else self.mpilib + + if self.compiler != compiler or self.machine != machine or self.os != os_ or self.mpilib != mpilib or self.compiler_nodes is None: + self.compiler_nodes = [] + nodes = self.get_nodes("compiler") + for node in nodes: + if self._is_compatible(node, compiler, machine, os_, mpilib): + self.compiler_nodes.append(node) + + self.compiler_nodes.reverse() + + self.compiler = compiler + self.machine = machine + self.os = os_ + self.mpilib = mpilib def get_value(self, name, attribute=None, resolved=True, subgroup=None): - """ - Get Value of fields in the config_compilers.xml file - """ - expect(self.compiler_nodes is not None, "Compiler object has no compiler defined") - expect(subgroup is None, "This class does not support subgroups") - value = None + """ + Get Value of fields in the config_compilers.xml file + """ + expect(self.compiler_nodes is not None, "Compiler object has no compiler defined") + expect(subgroup is None, "This class does not support subgroups") + value = None - node = self.get_optional_compiler_node(name) - if node is not None: - value = node.text + node = self.get_optional_compiler_node(name) + if node is not None: + value = node.text - if value is None: - # if all else fails - value = GenericXML.get_value(self, name) + if value is None: + # if all else fails + value = GenericXML.get_value(self, name) - if resolved: - if value is not None: - value = self.get_resolved_value(value) - elif name in os.environ: - value = os.environ[name] + if resolved: + if value is not None: + value = self.get_resolved_value(value) + elif name in os.environ: + value = os.environ[name] - return value + return value def write_macros_file(self, macros_file="Macros", output_format="make"): - """ - Parse the config_compiler.xml file into a Macros file for the - given machine and compiler. - """ - - # Parse the xml settings into the $macros hash structure - # put conditional settings in the _COND_ portion of the hash - # and handle them seperately - macros = {"_COND_" : {}} - - # Do worst matches first - for compiler_node in reversed(self.compiler_nodes): - _add_to_macros(compiler_node, macros) - - # A few things can be used from environ if not in XML - for item in ["MPI_PATH", "NETCDF_PATH"]: - if not item in macros and item in os.environ: - logger.warn("Setting %s from Environment" % item) - macros[item] = os.environ[item] - - with open(macros_file, "w") as fd: - fd.write( -"""# -# COMPILER=%s -# OS=%s -# MACH=%s -""" % (self.compiler, self.os, self.machine) -) - if output_format == "make": - fd.write("#\n# Makefile Macros generated from %s \n#\n" % self.filename) - - # print the settings out to the Macros file - for key, value in sorted(macros.iteritems()): - if key == "_COND_": - pass - elif key.startswith("ADD_"): - fd.write("%s+=%s\n\n" % (key[4:], value)) - else: - fd.write("%s:=%s\n\n" % (key, value)) - - elif output_format == "cmake": - fd.write( -'''# -# cmake Macros generated from $compiler_file -# -include(Compilers) -set(CMAKE_C_FLAGS_RELEASE "" CACHE STRING "Flags used by c compiler." FORCE) -set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "Flags used by c compiler." FORCE) -set(CMAKE_Fortran_FLAGS_RELEASE "" CACHE STRING "Flags used by Fortran compiler." FORCE) -set(CMAKE_Fortran_FLAGS_DEBUG "" CACHE STRING "Flags used by Fortran compiler." FORCE) -set(all_build_types "None Debug Release RelWithDebInfo MinSizeRel") -set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build, options are: ${all_build_types}." FORCE) -''') - - # print the settings out to the Macros file, do it in - # two passes so that path values appear first in the - # file. - for key, value in sorted(macros.iteritems()): - if key == "_COND_": - pass - else: - value = value.replace("(", "{").replace(")", "}") - if key.endswith("_PATH"): - fd.write("set(%s %s)\n" % (key, value)) - fd.write("list(APPEND CMAKE_PREFIX_PATH %s)\n\n" % value) - - for key, value in sorted(macros.iteritems()): - if key == "_COND_": - pass - else: - value = value.replace("(", "{").replace(")", "}") - if "CFLAGS" in key: - fd.write("add_flags(CMAKE_C_FLAGS %s)\n\n" % value) - elif "FFLAGS" in key: - fd.write("add_flags(CMAKE_Fortran_FLAGS %s)\n\n" % value) - elif "CPPDEFS" in key: - fd.write("list(APPEND COMPILE_DEFINITIONS %s)\n\n" % value) - elif "SLIBS" in key or "LDFLAGS" in key: - fd.write("add_flags(CMAKE_EXE_LINKER_FLAGS %s)\n\n" % value) - - # Recursively print the conditionals, combining tests to avoid repetition - _parse_hash(macros["_COND_"], fd, 0, output_format) - - -def _parse_hash(macros, fd, depth, output_format, cmakedebug=""): - width = 2 * depth - for key, value in macros.iteritems(): - if type(value) is dict: - if output_format == "make" or "DEBUG" in key: - for key2, value2 in value.iteritems(): - if output_format == "make": - fd.write("%sifeq ($(%s), %s) \n" % (" " * width, key, key2)) - - _parse_hash(value2, fd, depth + 1, output_format, key2) - else: - if output_format == "make": - if key.startswith("ADD_"): - fd.write("%s %s += %s\n" % (" " * width, key[4:], value)) - else: - fd.write("%s %s += %s\n" % (" " * width, key, value)) - - else: - value = value.replace("(", "{").replace(")", "}") - release = "DEBUG" if "TRUE" in cmakedebug else "RELEASE" - if "CFLAGS" in key: - fd.write("add_flags(CMAKE_C_FLAGS_%s %s)\n\n" % (release, value)) - elif "FFLAGS" in key: - fd.write("add_flags(CMAKE_Fortran_FLAGS_%s %s)\n\n" % (release, value)) - elif "CPPDEF" in key: - fd.write("add_config_definitions(%s %s)\n\n" % (release, value)) - elif "SLIBS" in key or "LDFLAGS" in key: - fd.write("add_flags(CMAKE_EXE_LINKER_FLAGS_%s %s)\n\n" % (release, value)) - - width -= 2 - if output_format == "make" and depth > 0: - fd.write("%sendif\n\n" % (" " * width)) - -def _add_to_macros(node, macros): - for child in node: - name = child.tag - attrib = child.attrib - value = child.text - - if not attrib: - if name.startswith("ADD_"): - basename = name[4:] - if basename in macros: - macros[basename] = "%s %s" % (macros[basename], value) - elif name in macros: - macros[name] = "%s %s" % (macros[name], value) - else: - macros[name] = value - else: - macros[name] = value - - else: - cond_macros = macros["_COND_"] - for key, value2 in attrib.iteritems(): - if key not in cond_macros: - cond_macros[key] = {} - if value2 not in cond_macros[key]: - cond_macros[key][value2] = {} - cond_macros = cond_macros[key][value2] - - cond_macros[name] = value + if self._version == "1.0": + # Parse the xml settings into the $macros hash structure + # put conditional settings in the _COND_ portion of the hash + # and handle them seperately + macros = {"_COND_" : {}} + + # Do worst matches first + for compiler_node in reversed(self.compiler_nodes): + _add_to_macros(compiler_node, macros) + return write_macros_file_v1(macros, macros_file, output_format) + else: + return self._write_macros_file_v2(macros_file, output_format) diff --git a/utils/python/CIME/build/__init__.py b/utils/python/CIME/build/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/utils/python/CIME/build/cmakemacroswriter.py b/utils/python/CIME/build/cmakemacroswriter.py new file mode 100644 index 00000000000..7254b397d99 --- /dev/null +++ b/utils/python/CIME/build/cmakemacroswriter.py @@ -0,0 +1,119 @@ +"""Classes used to write build system files. + +The classes here are used to write out settings for use by Makefile and CMake +build systems. The two relevant classes are CMakeMacroWriter and +MakeMacroWriter, which encapsulate the information necessary to write CMake and +Makefile formatted text, respectively. See the docstrings for those classes for +more. +""" + +# This is not the most useful check. +# pylint: disable=invalid-name + +from CIME.build.macrowriterbase import MacroWriterBase +from CIME.XML.standard_module_setup import * +logger = logging.getLogger(__name__) + + +class CMakeMacroWriter(MacroWriterBase): + + """Macro writer for the CMake format. + + For details on the provided methods, see MacroWriterBase, which this + class inherits from. + """ + + def __init__(self, output): + """Initialize a CMake macro writer. + + Arguments: + output - File-like object (probably an io.TextIOWrapper), which + will be written to. + """ + super(CMakeMacroWriter, self).__init__(output) + # This counter is for avoiding name conflicts in temporary + # variables used for shell commands. + self._var_num = 0 + + def environment_variable_string(self, name): + """Return an environment variable reference. + + >>> import io + >>> s = io.StringIO() + >>> CMakeMacroWriter(s).environment_variable_string("foo") + '$ENV{foo}' + """ + return "$ENV{" + name + "}" + + def shell_command_strings(self, command): + # pylint: disable=line-too-long + """Return strings used to get the output of a shell command. + + >>> import io + >>> s = io.StringIO() + >>> set_up, inline, tear_down = CMakeMacroWriter(s).shell_command_strings("echo bar") + >>> set_up + 'execute_process(COMMAND echo bar OUTPUT_VARIABLE CIME_TEMP_SHELL0 OUTPUT_STRIP_TRAILING_WHITESPACE)' + >>> inline + '${CIME_TEMP_SHELL0}' + >>> tear_down + 'unset(CIME_TEMP_SHELL0)' + """ + # pylint: enable=line-too-long + # Create a unique variable name, then increment variable number + # counter so that we get a different value next time. + var_name = "CIME_TEMP_SHELL" + str(self._var_num) + self._var_num += 1 + set_up = "execute_process(COMMAND " + command + \ + " OUTPUT_VARIABLE " + var_name + \ + " OUTPUT_STRIP_TRAILING_WHITESPACE)" + tear_down = "unset(" + var_name + ")" + return (set_up, "${" + var_name + "}", tear_down) + + def variable_string(self, name): + """Return a string to refer to a variable with the given name. + + >>> import io + >>> s = io.StringIO() + >>> CMakeMacroWriter(s).variable_string("foo") + '${CIME_foo}' + """ + return "${CIME_" + name + "}" + + def set_variable(self, name, value): + """Write out a statement setting a variable to some value. + + >>> import io + >>> s = io.StringIO() + >>> CMakeMacroWriter(s).set_variable("foo", "bar") + >>> s.getvalue() + u'set(CIME_foo "bar")\\n' + """ + self.write_line("set(CIME_" + name + ' "' + value + '")') + + def start_ifeq(self, left, right): + """Write out a statement to start a conditional block. + + >>> import io + >>> s = io.StringIO() + >>> CMakeMacroWriter(s).start_ifeq("foo", "bar") + >>> s.getvalue() + u'if("foo" STREQUAL "bar")\\n' + """ + self.write_line('if("' + left + '" STREQUAL "' + right + '")') + self.indent_right() + + def end_ifeq(self): + """Write out a statement to end a block started with start_ifeq. + + >>> import io + >>> s = io.StringIO() + >>> writer = CMakeMacroWriter(s) + >>> writer.start_ifeq("foo", "bar") + >>> writer.set_variable("foo2", "bar2") + >>> writer.end_ifeq() + >>> s.getvalue() + u'if("foo" STREQUAL "bar")\\n set(CIME_foo2 "bar2")\\nendif()\\n' + """ + self.indent_left() + self.write_line("endif()") diff --git a/utils/python/CIME/build/macroconditiontree.py b/utils/python/CIME/build/macroconditiontree.py new file mode 100644 index 00000000000..57253978ffc --- /dev/null +++ b/utils/python/CIME/build/macroconditiontree.py @@ -0,0 +1,170 @@ +from CIME.XML.standard_module_setup import * +logger = logging.getLogger(__name__) + +class MacroConditionTree(object): # pylint: disable=too-many-instance-attributes + + """Tree containing the various possible settings of a specific macro. + + Unlike the PossibleValues class, this class assumes that we have + finished determining which settings could apply on a given machine. It + also sorts the settings based on the conditions under which they take + effect, in preparation for writing out the Macros file itself. + + Public methods: + merge + write_out + """ + + def __init__(self, name, settings): + """Create a MacroConditionTree recursively. + + Arguments: + name - Name of the variable. + settings - A list of all settings for this variable. + """ + # Search for any conditions controlling the number of settings. + condition = None + # Prefer the COMPILER attribute as the top level attribute, for + # readability of the merged file. + if any("COMPILER" in setting.conditions for setting in settings): + condition = "COMPILER" + else: + # To make merging more effective, sort the conditions. + all_conditions = [] + for setting in settings: + all_conditions += setting.conditions.keys() + if all_conditions: + condition = sorted(all_conditions)[0] + if condition is None: + # If there are no conditions, we have reached a leaf. + # We combine whatever settings are left; there should be at + # most one non-appending setting, or an arbitrary number of + # appending settings. + self._is_leaf = True + self._assignments = [] + self._set_up = [] + self._tear_down = [] + self._do_append = True + for setting in settings: + if not setting.do_append: + self._do_append = False + assert len(settings) == 1, \ + "Internal error in macros: An ambiguity was " \ + "found after the ambiguity check was complete, " \ + "or there is a mixture of appending and initial " \ + "settings in the condition tree." + self._assignments.append((name, setting.value)) + self._set_up += setting.set_up + self._tear_down += setting.tear_down + else: + # If a condition was found, partition the settings depending on + # how they use it, and recursively create a tree for each + # partition. + self._is_leaf = False + self._condition = condition + partition = dict() + for setting in settings: + # If some of the settings don't use a condition, we use + # None to represent that. + cond_val = setting.conditions.pop(condition, None) + if cond_val in partition: + partition[cond_val].append(setting) + else: + partition[cond_val] = [setting] + branches = dict() + for cond_val in partition: + branches[cond_val] = \ + MacroConditionTree(name, partition[cond_val]) + self._branches = branches + + # pylint shouldn't concern itself with the way that we access other, since + # it's actually a member of the same class. + # pylint:disable=protected-access + def merge(self, other): + """Merge another tree with this one. + + This should be considered destructive to both trees. The only valid + value is the one that's returned. + """ + if self._is_leaf: + if other._is_leaf: + assert self._do_append == other._do_append, \ + "Internal error in macros: Tried to merge an " \ + "appending tree with a tree containing initial "\ + "settings." + # If both are leaves, just merge the values. + self._assignments += other._assignments + self._set_up += other._set_up + self._tear_down += other._tear_down + return self + else: + # If other is not a leaf, swap the arguments so that self + # is the one that's not a leaf, handled below. + return other.merge(self) + else: + # If self is not a leaf but other is, it should go in + # self._branches[None]. The same goes for the case where the + # conditions don't match, and self._condition is last + # alphabetically. + if other._is_leaf or self._condition > other._condition: + if None in self._branches: + self._branches[None] = self._branches[None].merge(other) + else: + self._branches[None] = other + return self + else: + # If the other condition comes last alphabetically, swap + # the order. + if self._condition < other._condition: + return other.merge(self) + # If neither is a leaf and their conditions match, merge + # their sets of branches. + for (cond_val, other_branch) in other._branches.items(): + if cond_val in self._branches: + self._branches[cond_val] = \ + self._branches[cond_val].merge(other_branch) + else: + self._branches[cond_val] = other_branch + return self + # pylint:enable=protected-access + + def write_out(self, writer): + """Write tree to file. + + The writer argument is an object inheriting from MacroWriterBase. + This function first writes out all the initial settings with + appropriate conditionals, then the appending settings. + """ + if self._is_leaf: + for line in self._set_up: + writer.write_line(line) + for (name, value) in self._assignments: + if self._do_append: + writer.append_variable(name, value) + else: + writer.set_variable(name, value) + for line in self._tear_down: + writer.write_line(line) + else: + condition = self._condition + # Take care of the settings that don't use this condition. + if None in self._branches: + self._branches[None].write_out(writer) + # Now all the if statements. + for cond_val in self._branches: + if cond_val is None: + continue + env_ref = writer.environment_variable_string(condition) + writer.start_ifeq(env_ref, cond_val) + self._branches[cond_val].write_out(writer) + writer.end_ifeq() + +def _merge_optional_trees(tree, big_tree): + """Merge two MacroConditionTrees when one or both objects may be `None`.""" + if tree is not None: + if big_tree is None: + return tree + else: + return big_tree.merge(tree) + else: + return big_tree diff --git a/utils/python/CIME/build/macrowriterbase.py b/utils/python/CIME/build/macrowriterbase.py new file mode 100644 index 00000000000..b9faa2b7afc --- /dev/null +++ b/utils/python/CIME/build/macrowriterbase.py @@ -0,0 +1,282 @@ +"""Classes used to write build system files. + +The classes here are used to write out settings for use by Makefile and CMake +build systems. The two relevant classes are CMakeMacroWriter and +MakeMacroWriter, which encapsulate the information necessary to write CMake and +Makefile formatted text, respectively. See the docstrings for those classes for +more. +""" + +# This is not the most useful check. +# pylint: disable=invalid-name + +from abc import ABCMeta, abstractmethod + +__all__ = ["CMakeMacroWriter", "MakeMacroWriter"] + +class MacroWriterBase(object): + + """Abstract base class for macro file writers. + + The methods here come in three flavors: + 1. indent_left/indent_right change the level of indent used internally by + the class. + 2. The various methods ending in "_string" return strings relevant to the + build system. + 3. The other methods write information to the file handle associated with + an individual writer instance. + + Public attributes: + indent_increment - Number of spaces to indent if blocks (does not apply + to format-specific indentation, e.g. cases where + Makefiles must use tabs). + output - File-like object that output is written to. + + Public methods: + indent_string + indent_left + indent_right + write_line + environment_variable_string + shell_command_string + variable_string + set_variable + append_variable + start_ifeq + end_ifeq + """ + + __metaclass__ = ABCMeta + + indent_increment = 2 + + def __init__(self, output): + """Initialize a macro writer. + + Arguments: + output - File-like object (probably an io.TextIOWrapper), which + will be written to. + """ + self.output = output + self._indent_num = 0 + + def indent_string(self): + """Return an appropriate number of spaces for the indent.""" + return ' ' * self._indent_num + + def indent_left(self): + """Decrease the amount of line indent.""" + self._indent_num -= 2 + + def indent_right(self): + """Increase the amount of line indent.""" + self._indent_num += 2 + + def write_line(self, line): + """Write a single line of output, appropriately indented. + + A trailing newline is added, whether or not the input has one. + """ + self.output.write(unicode(self.indent_string() + line + "\n")) + + @abstractmethod + def environment_variable_string(self, name): + """Return an environment variable reference.""" + pass + + @abstractmethod + def shell_command_strings(self, command): + """Return strings used to get the output of a shell command. + + Implementations should return a tuple of three strings: + 1. A line that is needed to get the output of the command (or None, + if a command can be run inline). + 2. A string that can be used within a line to refer to the output. + 3. A line that does any cleanup of temporary variables (or None, if + no cleanup is necessary). + + Example usage: + + # Get strings and write initial command. + (pre, var, post) = writer.shell_command_strings(command) + if pre is not None: + writer.write(pre) + + # Use the variable to write an if block. + writer.start_ifeq(var, "TRUE") + writer.set_variable("foo", "bar") + writer.end_ifeq() + + # Cleanup + if post is not None: + writer.write(post) + """ + pass + + @abstractmethod + def variable_string(self, name): + """Return a string to refer to a variable with the given name.""" + pass + + @abstractmethod + def set_variable(self, name, value): + """Write out a statement setting a variable to some value.""" + pass + + def append_variable(self, name, value): + """Write out a statement appending a value to a string variable.""" + var_string = self.variable_string(name) + self.set_variable(name, var_string + " " + value) + + @abstractmethod + def start_ifeq(self, left, right): + """Write out a statement to start a conditional block. + + The arguments to this method are compared, and the block is entered + only if they are equal. + """ + pass + + @abstractmethod + def end_ifeq(self): + """Write out a statement to end a block started with start_ifeq.""" + pass + +# None class based method for version 1.0 + +def write_macros_file_v1(macros, macros_file="Macros", output_format="make"): + """ + Parse the config_compiler.xml file into a Macros file for the + given machine and compiler. + """ + # A few things can be used from environ if not in XML + for item in ["MPI_PATH", "NETCDF_PATH"]: + if not item in macros and item in os.environ: + logger.warn("Setting %s from Environment" % item) + macros[item] = os.environ[item] + + with open(macros_file, "w") as fd: + fd.write( +"""# +# COMPILER=%s +# OS=%s +# MACH=%s +""" % (self.compiler, self.os, self.machine) +) + if output_format == "make": + fd.write("#\n# Makefile Macros generated from %s \n#\n" % self.filename) + + # print the settings out to the Macros file + for key, value in sorted(macros.iteritems()): + if key == "_COND_": + pass + elif key.startswith("ADD_"): + fd.write("%s+=%s\n\n" % (key[4:], value)) + else: + fd.write("%s:=%s\n\n" % (key, value)) + + elif output_format == "cmake": + fd.write( +'''# +# cmake Macros generated from $compiler_file +# +include(Compilers) +set(CMAKE_C_FLAGS_RELEASE "" CACHE STRING "Flags used by c compiler." FORCE) +set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "Flags used by c compiler." FORCE) +set(CMAKE_Fortran_FLAGS_RELEASE "" CACHE STRING "Flags used by Fortran compiler." FORCE) +set(CMAKE_Fortran_FLAGS_DEBUG "" CACHE STRING "Flags used by Fortran compiler." FORCE) +set(all_build_types "None Debug Release RelWithDebInfo MinSizeRel") +set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build, options are: ${all_build_types}." FORCE) +''') + + # print the settings out to the Macros file, do it in + # two passes so that path values appear first in the + # file. + for key, value in sorted(macros.iteritems()): + if key == "_COND_": + pass + else: + value = value.replace("(", "{").replace(")", "}") + if key.endswith("_PATH"): + fd.write("set(%s %s)\n" % (key, value)) + fd.write("list(APPEND CMAKE_PREFIX_PATH %s)\n\n" % value) + + for key, value in sorted(macros.iteritems()): + if key == "_COND_": + pass + else: + value = value.replace("(", "{").replace(")", "}") + if "CFLAGS" in key: + fd.write("add_flags(CMAKE_C_FLAGS %s)\n\n" % value) + elif "FFLAGS" in key: + fd.write("add_flags(CMAKE_Fortran_FLAGS %s)\n\n" % value) + elif "CPPDEFS" in key: + fd.write("list(APPEND COMPILE_DEFINITIONS %s)\n\n" % value) + elif "SLIBS" in key or "LDFLAGS" in key: + fd.write("add_flags(CMAKE_EXE_LINKER_FLAGS %s)\n\n" % value) + + # Recursively print the conditionals, combining tests to avoid repetition + _parse_hash(macros["_COND_"], fd, 0, output_format) + + +def _parse_hash(macros, fd, depth, output_format, cmakedebug=""): + width = 2 * depth + for key, value in macros.iteritems(): + if type(value) is dict: + if output_format == "make" or "DEBUG" in key: + for key2, value2 in value.iteritems(): + if output_format == "make": + fd.write("%sifeq ($(%s), %s) \n" % (" " * width, key, key2)) + + _parse_hash(value2, fd, depth + 1, output_format, key2) + else: + if output_format == "make": + if key.startswith("ADD_"): + fd.write("%s %s += %s\n" % (" " * width, key[4:], value)) + else: + fd.write("%s %s += %s\n" % (" " * width, key, value)) + + else: + value = value.replace("(", "{").replace(")", "}") + release = "DEBUG" if "TRUE" in cmakedebug else "RELEASE" + if "CFLAGS" in key: + fd.write("add_flags(CMAKE_C_FLAGS_%s %s)\n\n" % (release, value)) + elif "FFLAGS" in key: + fd.write("add_flags(CMAKE_Fortran_FLAGS_%s %s)\n\n" % (release, value)) + elif "CPPDEF" in key: + fd.write("add_config_definitions(%s %s)\n\n" % (release, value)) + elif "SLIBS" in key or "LDFLAGS" in key: + fd.write("add_flags(CMAKE_EXE_LINKER_FLAGS_%s %s)\n\n" % (release, value)) + + width -= 2 + if output_format == "make" and depth > 0: + fd.write("%sendif\n\n" % (" " * width)) + +def _add_to_macros(node, macros): + for child in node: + name = child.tag + attrib = child.attrib + value = child.text + + if not attrib: + if name.startswith("ADD_"): + basename = name[4:] + if basename in macros: + macros[basename] = "%s %s" % (macros[basename], value) + elif name in macros: + macros[name] = "%s %s" % (macros[name], value) + else: + macros[name] = value + else: + macros[name] = value + + else: + cond_macros = macros["_COND_"] + for key, value2 in attrib.iteritems(): + if key not in cond_macros: + cond_macros[key] = {} + if value2 not in cond_macros[key]: + cond_macros[key][value2] = {} + cond_macros = cond_macros[key][value2] + + cond_macros[name] = value diff --git a/utils/python/CIME/build/makemacroswriter.py b/utils/python/CIME/build/makemacroswriter.py new file mode 100644 index 00000000000..0bcf2205762 --- /dev/null +++ b/utils/python/CIME/build/makemacroswriter.py @@ -0,0 +1,93 @@ +"""Classes used to write build system files. + +The classes here are used to write out settings for use by Makefile and CMake +build systems. The two relevant classes are CMakeMacroWriter and +MakeMacroWriter, which encapsulate the information necessary to write CMake and +Makefile formatted text, respectively. See the docstrings for those classes for +more. +""" + +from CIME.build.macrowriterbase import MacroWriterBase +from CIME.XML.standard_module_setup import * +logger = logging.getLogger(__name__) + +# This is not the most useful check. +# pylint: disable=invalid-name + +class MakeMacroWriter(MacroWriterBase): + + """Macro writer for the Makefile format. + + For details on the provided methods, see MacroWriterBase, which this + class inherits from. + """ + + def environment_variable_string(self, name): + """Return an environment variable reference. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).environment_variable_string("foo") + '$(foo)' + """ + return "$(" + name + ")" + + def shell_command_strings(self, command): + """Return strings used to get the output of a shell command. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).shell_command_strings("echo bar") + (None, '$(shell echo bar)', None) + """ + return (None, "$(shell " + command + ")", None) + + def variable_string(self, name): + """Return a string to refer to a variable with the given name. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).variable_string("foo") + '$(foo)' + """ + return "$(" + name + ")" + + def set_variable(self, name, value): + """Write out a statement setting a variable to some value. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).set_variable("foo", "bar") + >>> s.getvalue() + u'foo := bar\\n' + """ + # Note that ":=" is used so that we can control the behavior for + # both Makefile and CMake variables similarly. + self.write_line(name + " := " + value) + + def start_ifeq(self, left, right): + """Write out a statement to start a conditional block. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).start_ifeq("foo", "bar") + >>> s.getvalue() + u'ifeq (foo,bar)\\n' + """ + self.write_line("ifeq (" + left + "," + right + ")") + self.indent_right() + + def end_ifeq(self): + """Write out a statement to end a block started with start_ifeq. + + >>> import io + >>> s = io.StringIO() + >>> writer = MakeMacroWriter(s) + >>> writer.start_ifeq("foo", "bar") + >>> writer.set_variable("foo2", "bar2") + >>> writer.end_ifeq() + >>> s.getvalue() + u'ifeq (foo,bar)\\n foo2 := bar2\\nendif\\n' + """ + self.indent_left() + self.write_line("endif") diff --git a/utils/python/CIME/build/possiblevalues.py b/utils/python/CIME/build/possiblevalues.py new file mode 100644 index 00000000000..2ec6e09ce7c --- /dev/null +++ b/utils/python/CIME/build/possiblevalues.py @@ -0,0 +1,139 @@ +from CIME.XML.standard_module_setup import * +from CIME.build.macroconditiontree import MacroConditionTree + +logger = logging.getLogger(__name__) + +class PossibleValues(object): + + """Holds a list of settings for a single "Macros" variable. + + This helper class takes in variable settings and, for each one, decides + whether to throw it out, add it to the list of values, or replace the + existing list of values with the new, more specific setting. + + This class also performs ambiguity checking; if it is possible at build + time for more than one setting to match the same variable, this is + considered an error. + + Public attributes: + name - The name of the variable. + settings - The current list of possible initial settings for the + variable. + append_settings - A dictionary of lists of possible appending settings + for the variable, with the specificity of each list + as the associated dictionary key. + depends - The current list of variables that this variable depends on + to get its value. + + Public methods: + add_setting + ambiguity_check + to_cond_trees + """ + + def __init__(self, name, setting, specificity, depends): + """Construct a PossibleValues object. + + The name argument refers to the name of the variable. The other + arguments are the same as for append_match. + """ + self.name = name + self.depends = depends + # If this is an appending setting, its specificity can't cause it + # to overwrite other settings, but we want to keep track of it. + if setting.do_append: + self.settings = [] + self.append_settings = {specificity: [setting]} + self._specificity = 0 + else: + self.settings = [setting] + self.append_settings = {} + self._specificity = specificity + + def add_setting(self, setting, specificity, depends): + """Add a possible value for a variable. + + Arguments: + setting - A ValueSetting to start the list. + specificity - An integer representing how specific the setting is. + Only the initial settings with the highest + specificity and appending settings with at least that + specificity will actually be kept in the list. The + lowest allowed specificity is 0. + depends - A set of variable names, specifying the variables that + have to be set before this setting can be used (e.g. if + SLIBS refers to NETCDF_PATH, then NETCDF_PATH has to be + set first). + + >>> a = ValueSetting('foo', False, dict(), [], []) + >>> b = ValueSetting('bar', False, dict(), [], []) + >>> vals = PossibleValues('var', a, 0, {'dep1'}) + >>> vals.add_setting(b, 1, {'dep2'}) + >>> a not in vals.settings and b in vals.settings + True + >>> 'dep1' not in vals.depends and 'dep2' in vals.depends + True + >>> vals.add_setting(a, 1, {'dep1'}) + >>> a in vals.settings and b in vals.settings + True + >>> 'dep1' in vals.depends and 'dep2' in vals.depends + True + """ + if setting.do_append: + # Appending settings with at least the current level of + # specificity should be kept. + if specificity >= self._specificity: + if specificity not in self.append_settings: + self.append_settings[specificity] = [] + self.append_settings[specificity].append(setting) + self.depends |= depends + else: + # Add equally specific settings to the list. + if specificity == self._specificity: + self.settings.append(setting) + self.depends |= depends + # Replace the list if the setting is more specific. + elif specificity > self._specificity: + self.settings = [setting] + self._specificity = specificity + self.depends = depends + # Do nothing if the setting is less specific. + + def ambiguity_check(self): + """Check the current list of settings for ambiguity. + + This function raises an error if an ambiguity is found. + """ + for i in range(len(self.settings)-1): + for other in self.settings[i+1:]: + expect(not self.settings[i].is_ambiguous_with(other), + "Variable "+self.name+" is set ambiguously in " + "config_build.xml. Check the file for these " + "conflicting settings: \n1: {}\n2: {}".format( + self.settings[i].conditions, other.conditions)) + + def to_cond_trees(self): + """Convert this object to a pair of MacroConditionTree objects. + + This represents the step where the list of possible values is + frozen and we're ready to convert it into an actual text file. This + object is checked for ambiguities before conversion. + + The return value is a tuple of two trees. The first contains all + initial settings, and the second contains all appending settings. + If either would be empty, None is returned instead. + """ + self.ambiguity_check() + if self.settings: + normal_tree = MacroConditionTree(self.name, self.settings) + else: + normal_tree = None + append_settings = [] + for specificity in self.append_settings: + if specificity >= self._specificity: + append_settings += self.append_settings[specificity] + if append_settings: + append_tree = MacroConditionTree(self.name, append_settings) + else: + append_tree = None + return (normal_tree, append_tree) diff --git a/utils/python/CIME/build/valuesetting.py b/utils/python/CIME/build/valuesetting.py new file mode 100644 index 00000000000..13f8ce9318d --- /dev/null +++ b/utils/python/CIME/build/valuesetting.py @@ -0,0 +1,107 @@ +from CIME.XML.standard_module_setup import * + +logger = logging.getLogger(__name__) + +class ValueSetting(object): + + """Holds data about how a value can be assigned to a variable. + + Note that this class doesn't know or care *which* variable might be + assigned in this way, only that there is a procedure to perform that + operation + + Public attributes: + value - The actual value that will be set. + do_append - Boolean describing whether the value should be + appended to the existing value of the variable rather + than overwriting other settings. + conditions - Dictionary containing the set of values that different + variables have to have to use this setting (e.g. + DEBUG="TRUE" might be a condition on a debug flag). + set_up - List of any commands that have to be executed in the build + system before this setting can occur. + tear_down - List of any commands that should be executed to clean up + after setting the variable. + + Public methods: + is_ambiguous_with + """ + + def __init__(self, value, do_append, conditions, set_up, tear_down): # pylint: disable=too-many-arguments + """Create a ValueSetting object by specifying all its data.""" + self.value = value + self.do_append = do_append + self.conditions = conditions + self.set_up = set_up + self.tear_down = tear_down + + def is_ambiguous_with(self, other): + """Check to see if this setting conflicts with another one. + + The purpose of this routine is to see if two settings can coexist + in the same Macros file, or if doing so would raise an ambiguity + about which one should be preferred over the other. Note that this + is a symmetric relation (this function returns the same value if + self and other are swapped). + + The rules to determine this are as follows: + + 1) If one or both settings are appending to the value, there's no + ambiguity, because both can cooperate to set the value. + + >>> a = ValueSetting('foo', True, dict(), [], []) + >>> b = ValueSetting('bar', False, dict(), [], []) + >>> a.is_ambiguous_with(b) + False + >>> b.is_ambiguous_with(a) + False + + 2) If the two settings have conflicting conditions, then there + is no ambiguity because they can't both apply to the same + build. + + >>> a = ValueSetting('foo', False, {"DEBUG": "TRUE"}, [], []) + >>> b = ValueSetting('bar', False, {"DEBUG": "FALSE"}, [], []) + >>> a.is_ambiguous_with(b) + False + + 3) If one setting is strictly more specific than the other, then + there's no ambiguity, because we prefer the more specific + setting whenever both apply to a build. + + >>> a = ValueSetting('foo', False, {"DEBUG": "TRUE"}, [], []) + >>> b = ValueSetting('bar', False, {"DEBUG": "TRUE", "MPILIB": "mpich2"}, [], []) + >>> a.is_ambiguous_with(b) + False + >>> b.is_ambiguous_with(a) + False + + 4) All other cases are considered ambiguous. + + >>> a = ValueSetting('foo', False, dict(), [], []) + >>> b = ValueSetting('bar', False, dict(), [], []) + >>> a.is_ambiguous_with(b) + True + >>> a = ValueSetting('foo', False, {"DEBUG": "TRUE"}, [], []) + >>> b = ValueSetting('bar', False, {"MPILIB": "mpich2"}, [], []) + >>> a.is_ambiguous_with(b) + True + """ + # Append check. + if self.do_append or other.do_append: + return False + # Consistency check. + for var_name in self.conditions: + if var_name not in other.conditions: + continue + if self.conditions[var_name] != other.conditions[var_name]: + return False + # Specificity check. + # One setting being more specific than the other is equivalent to + # its set of conditions being a proper superset of the others. + self_set = set(self.conditions.keys()) + other_set = set(other.conditions.keys()) + if self_set < other_set or self_set > other_set: + return False + # Any situation we couldn't resolve is ambiguous. + return True diff --git a/utils/python/CIME/macros_writers.py b/utils/python/CIME/macros_writers.py deleted file mode 100644 index 78cc2f03a69..00000000000 --- a/utils/python/CIME/macros_writers.py +++ /dev/null @@ -1,326 +0,0 @@ -"""Classes used to write build system files. - -The classes here are used to write out settings for use by Makefile and CMake -build systems. The two relevant classes are CMakeMacroWriter and -MakeMacroWriter, which encapsulate the information necessary to write CMake and -Makefile formatted text, respectively. See the docstrings for those classes for -more. -""" - -# This is not the most useful check. -# pylint: disable=invalid-name - -from abc import ABCMeta, abstractmethod - -__all__ = ["CMakeMacroWriter", "MakeMacroWriter"] - -class MacroWriterBase(object): - - """Abstract base class for macro file writers. - - The methods here come in three flavors: - 1. indent_left/indent_right change the level of indent used internally by - the class. - 2. The various methods ending in "_string" return strings relevant to the - build system. - 3. The other methods write information to the file handle associated with - an individual writer instance. - - Public attributes: - indent_increment - Number of spaces to indent if blocks (does not apply - to format-specific indentation, e.g. cases where - Makefiles must use tabs). - output - File-like object that output is written to. - - Public methods: - indent_string - indent_left - indent_right - write_line - environment_variable_string - shell_command_string - variable_string - set_variable - append_variable - start_ifeq - end_ifeq - """ - - __metaclass__ = ABCMeta - - indent_increment = 2 - - def __init__(self, output): - """Initialize a macro writer. - - Arguments: - output - File-like object (probably an io.TextIOWrapper), which - will be written to. - """ - self.output = output - self._indent_num = 0 - - def indent_string(self): - """Return an appropriate number of spaces for the indent.""" - return ' ' * self._indent_num - - def indent_left(self): - """Decrease the amount of line indent.""" - self._indent_num -= 2 - - def indent_right(self): - """Increase the amount of line indent.""" - self._indent_num += 2 - - def write_line(self, line): - """Write a single line of output, appropriately indented. - - A trailing newline is added, whether or not the input has one. - """ - self.output.write(unicode(self.indent_string() + line + "\n")) - - @abstractmethod - def environment_variable_string(self, name): - """Return an environment variable reference.""" - pass - - @abstractmethod - def shell_command_strings(self, command): - """Return strings used to get the output of a shell command. - - Implementations should return a tuple of three strings: - 1. A line that is needed to get the output of the command (or None, - if a command can be run inline). - 2. A string that can be used within a line to refer to the output. - 3. A line that does any cleanup of temporary variables (or None, if - no cleanup is necessary). - - Example usage: - - # Get strings and write initial command. - (pre, var, post) = writer.shell_command_strings(command) - if pre is not None: - writer.write(pre) - - # Use the variable to write an if block. - writer.start_ifeq(var, "TRUE") - writer.set_variable("foo", "bar") - writer.end_ifeq() - - # Cleanup - if post is not None: - writer.write(post) - """ - pass - - @abstractmethod - def variable_string(self, name): - """Return a string to refer to a variable with the given name.""" - pass - - @abstractmethod - def set_variable(self, name, value): - """Write out a statement setting a variable to some value.""" - pass - - def append_variable(self, name, value): - """Write out a statement appending a value to a string variable.""" - var_string = self.variable_string(name) - self.set_variable(name, var_string + " " + value) - - @abstractmethod - def start_ifeq(self, left, right): - """Write out a statement to start a conditional block. - - The arguments to this method are compared, and the block is entered - only if they are equal. - """ - pass - - @abstractmethod - def end_ifeq(self): - """Write out a statement to end a block started with start_ifeq.""" - pass - - -class MakeMacroWriter(MacroWriterBase): - - """Macro writer for the Makefile format. - - For details on the provided methods, see MacroWriterBase, which this - class inherits from. - """ - - def environment_variable_string(self, name): - """Return an environment variable reference. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).environment_variable_string("foo") - '$(foo)' - """ - return "$(" + name + ")" - - def shell_command_strings(self, command): - """Return strings used to get the output of a shell command. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).shell_command_strings("echo bar") - (None, '$(shell echo bar)', None) - """ - return (None, "$(shell " + command + ")", None) - - def variable_string(self, name): - """Return a string to refer to a variable with the given name. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).variable_string("foo") - '$(foo)' - """ - return "$(" + name + ")" - - def set_variable(self, name, value): - """Write out a statement setting a variable to some value. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).set_variable("foo", "bar") - >>> s.getvalue() - u'foo := bar\\n' - """ - # Note that ":=" is used so that we can control the behavior for - # both Makefile and CMake variables similarly. - self.write_line(name + " := " + value) - - def start_ifeq(self, left, right): - """Write out a statement to start a conditional block. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).start_ifeq("foo", "bar") - >>> s.getvalue() - u'ifeq (foo,bar)\\n' - """ - self.write_line("ifeq (" + left + "," + right + ")") - self.indent_right() - - def end_ifeq(self): - """Write out a statement to end a block started with start_ifeq. - - >>> import io - >>> s = io.StringIO() - >>> writer = MakeMacroWriter(s) - >>> writer.start_ifeq("foo", "bar") - >>> writer.set_variable("foo2", "bar2") - >>> writer.end_ifeq() - >>> s.getvalue() - u'ifeq (foo,bar)\\n foo2 := bar2\\nendif\\n' - """ - self.indent_left() - self.write_line("endif") - - -class CMakeMacroWriter(MacroWriterBase): - - """Macro writer for the CMake format. - - For details on the provided methods, see MacroWriterBase, which this - class inherits from. - """ - - def __init__(self, output): - """Initialize a CMake macro writer. - - Arguments: - output - File-like object (probably an io.TextIOWrapper), which - will be written to. - """ - super(CMakeMacroWriter, self).__init__(output) - # This counter is for avoiding name conflicts in temporary - # variables used for shell commands. - self._var_num = 0 - - def environment_variable_string(self, name): - """Return an environment variable reference. - - >>> import io - >>> s = io.StringIO() - >>> CMakeMacroWriter(s).environment_variable_string("foo") - '$ENV{foo}' - """ - return "$ENV{" + name + "}" - - def shell_command_strings(self, command): - # pylint: disable=line-too-long - """Return strings used to get the output of a shell command. - - >>> import io - >>> s = io.StringIO() - >>> set_up, inline, tear_down = CMakeMacroWriter(s).shell_command_strings("echo bar") - >>> set_up - 'execute_process(COMMAND echo bar OUTPUT_VARIABLE CIME_TEMP_SHELL0 OUTPUT_STRIP_TRAILING_WHITESPACE)' - >>> inline - '${CIME_TEMP_SHELL0}' - >>> tear_down - 'unset(CIME_TEMP_SHELL0)' - """ - # pylint: enable=line-too-long - # Create a unique variable name, then increment variable number - # counter so that we get a different value next time. - var_name = "CIME_TEMP_SHELL" + str(self._var_num) - self._var_num += 1 - set_up = "execute_process(COMMAND " + command + \ - " OUTPUT_VARIABLE " + var_name + \ - " OUTPUT_STRIP_TRAILING_WHITESPACE)" - tear_down = "unset(" + var_name + ")" - return (set_up, "${" + var_name + "}", tear_down) - - def variable_string(self, name): - """Return a string to refer to a variable with the given name. - - >>> import io - >>> s = io.StringIO() - >>> CMakeMacroWriter(s).variable_string("foo") - '${CIME_foo}' - """ - return "${CIME_" + name + "}" - - def set_variable(self, name, value): - """Write out a statement setting a variable to some value. - - >>> import io - >>> s = io.StringIO() - >>> CMakeMacroWriter(s).set_variable("foo", "bar") - >>> s.getvalue() - u'set(CIME_foo "bar")\\n' - """ - self.write_line("set(CIME_" + name + ' "' + value + '")') - - def start_ifeq(self, left, right): - """Write out a statement to start a conditional block. - - >>> import io - >>> s = io.StringIO() - >>> CMakeMacroWriter(s).start_ifeq("foo", "bar") - >>> s.getvalue() - u'if("foo" STREQUAL "bar")\\n' - """ - self.write_line('if("' + left + '" STREQUAL "' + right + '")') - self.indent_right() - - def end_ifeq(self): - """Write out a statement to end a block started with start_ifeq. - - >>> import io - >>> s = io.StringIO() - >>> writer = CMakeMacroWriter(s) - >>> writer.start_ifeq("foo", "bar") - >>> writer.set_variable("foo2", "bar2") - >>> writer.end_ifeq() - >>> s.getvalue() - u'if("foo" STREQUAL "bar")\\n set(CIME_foo2 "bar2")\\nendif()\\n' - """ - self.indent_left() - self.write_line("endif()") From 311f78a5a4ee169a429cb7e0952ad9fbf618bb87 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Sun, 20 Nov 2016 09:34:21 -0700 Subject: [PATCH 02/20] mv build to BuildTools --- scripts/Tools/code_checker | 36 +-- .../CIME/{build => BuildTools}/__init__.py | 0 .../CIME/BuildTools/cmakemacroswriter.py | 119 ++++++++ .../macroconditiontree.py | 2 +- .../python/CIME/BuildTools/macrowriterbase.py | 254 ++++++++++++++++ .../CIME/BuildTools/makemacroswriter.py | 93 ++++++ .../{build => BuildTools}/possiblevalues.py | 2 +- .../{build => BuildTools}/valuesetting.py | 0 utils/python/CIME/XML/build.py | 185 ++++++------ utils/python/CIME/XML/compilerblock.py | 9 +- utils/python/CIME/XML/compilers.py | 242 ++++++++------- utils/python/CIME/build/cmakemacroswriter.py | 119 -------- utils/python/CIME/build/macrowriterbase.py | 282 ------------------ utils/python/CIME/build/makemacroswriter.py | 93 ------ 14 files changed, 719 insertions(+), 717 deletions(-) rename utils/python/CIME/{build => BuildTools}/__init__.py (100%) create mode 100644 utils/python/CIME/BuildTools/cmakemacroswriter.py rename utils/python/CIME/{build => BuildTools}/macroconditiontree.py (99%) create mode 100644 utils/python/CIME/BuildTools/macrowriterbase.py create mode 100644 utils/python/CIME/BuildTools/makemacroswriter.py rename utils/python/CIME/{build => BuildTools}/possiblevalues.py (98%) rename utils/python/CIME/{build => BuildTools}/valuesetting.py (100%) delete mode 100644 utils/python/CIME/build/cmakemacroswriter.py delete mode 100644 utils/python/CIME/build/macrowriterbase.py delete mode 100644 utils/python/CIME/build/makemacroswriter.py diff --git a/scripts/Tools/code_checker b/scripts/Tools/code_checker index 36fb2681db1..c51e4d351bc 100755 --- a/scripts/Tools/code_checker +++ b/scripts/Tools/code_checker @@ -43,13 +43,13 @@ formatter_class=argparse.ArgumentDefaultsHelpFormatter CIME.utils.setup_standard_logging_options(parser) parser.add_argument("--dir", default=get_python_libs_root(), - help="The root directory containing python files to check.") + help="The root directory containing python files to check.") parser.add_argument("-j", "--num-procs", type=int, default=8, - help="The number of files to check in parallel") + help="The number of files to check in parallel") parser.add_argument("files", nargs="*", - help="Restrict checking to specific files. Relative name is fine.") + help="Restrict checking to specific files. Relative name is fine.") args = parser.parse_args(args[1:]) @@ -66,30 +66,30 @@ def run_pylint(on_file): cimeroot = get_cime_root() if "scripts/Tools" in on_file: - cmd_options +=",relative-import" + cmd_options +=",relative-import" # add init-hook option cmd_options += " --init-hook='sys.path.extend((\"%s\",\"%s\"))'"%\ - (os.path.join(cimeroot,"utils","python"), - os.path.join(cimeroot,"scripts","Tools")) + (os.path.join(cimeroot,"utils","python"), + os.path.join(cimeroot,"scripts","Tools")) cmd = "%s %s %s" % (pylint, cmd_options, on_file) logger.debug("pylint command is %s"%cmd) stat, out, err = run_cmd(cmd, verbose=False, from_dir=cimeroot) if stat != 0: - logger.info("File %s has pylint problems, please fix\n Use command: %s" % (on_file, cmd)) - logger.info(out + "\n" + err) - return False + logger.info("File %s has pylint problems, please fix\n Use command: %s" % (on_file, cmd)) + logger.info(out + "\n" + err) + return False else: - logger.info("File %s has no pylint problems" % on_file) - return True + logger.info("File %s has no pylint problems" % on_file) + return True ############################################################################### def matches(file_path, file_ends): ############################################################################### for file_end in file_ends: - if file_path.endswith(file_end): - return True + if file_path.endswith(file_end): + return True return False @@ -104,11 +104,11 @@ def check_code(dir_to_check, num_procs, files): # Get list of files to check files_to_check = run_cmd_no_fail('git ls-files --full-name %s' % dir_to_check, verbose=False).splitlines() if files: - files_to_check = [item for item in files_to_check if matches(item, files)] + files_to_check = [item for item in files_to_check if matches(item, files)] else: - files_to_check = [item for item in files_to_check if item.endswith(".py")] + files_to_check = [item for item in files_to_check if item.endswith(".py")] if len(files_to_check) == 0: - files_to_check = files + files_to_check = files pool = ThreadPool(num_procs) results = pool.map(run_pylint, files_to_check) @@ -118,8 +118,8 @@ def check_code(dir_to_check, num_procs, files): def _main_func(description): ############################################################################### if ("--test" in sys.argv): - test_results = doctest.testmod(verbose=True) - sys.exit(1 if test_results.failed > 0 else 0) + test_results = doctest.testmod(verbose=True) + sys.exit(1 if test_results.failed > 0 else 0) pylint = find_executable("pylint") expect(pylint is not None, "pylint not found") diff --git a/utils/python/CIME/build/__init__.py b/utils/python/CIME/BuildTools/__init__.py similarity index 100% rename from utils/python/CIME/build/__init__.py rename to utils/python/CIME/BuildTools/__init__.py diff --git a/utils/python/CIME/BuildTools/cmakemacroswriter.py b/utils/python/CIME/BuildTools/cmakemacroswriter.py new file mode 100644 index 00000000000..59681ac57f7 --- /dev/null +++ b/utils/python/CIME/BuildTools/cmakemacroswriter.py @@ -0,0 +1,119 @@ +"""Classes used to write build system files. + +The classes here are used to write out settings for use by Makefile and CMake +build systems. The two relevant classes are CMakeMacroWriter and +MakeMacroWriter, which encapsulate the information necessary to write CMake and +Makefile formatted text, respectively. See the docstrings for those classes for +more. +""" + +# This is not the most useful check. +# pylint: disable=invalid-name + +from CIME.BuildTools.macrowriterbase import MacroWriterBase +from CIME.XML.standard_module_setup import * +logger = logging.getLogger(__name__) + + +class CMakeMacroWriter(MacroWriterBase): + + """Macro writer for the CMake format. + + For details on the provided methods, see MacroWriterBase, which this + class inherits from. + """ + + def __init__(self, output): + """Initialize a CMake macro writer. + + Arguments: + output - File-like object (probably an io.TextIOWrapper), which + will be written to. + """ + super(CMakeMacroWriter, self).__init__(output) + # This counter is for avoiding name conflicts in temporary + # variables used for shell commands. + self._var_num = 0 + + def environment_variable_string(self, name): + """Return an environment variable reference. + + >>> import io + >>> s = io.StringIO() + >>> CMakeMacroWriter(s).environment_variable_string("foo") + '$ENV{foo}' + """ + return "$ENV{" + name + "}" + + def shell_command_strings(self, command): + # pylint: disable=line-too-long + """Return strings used to get the output of a shell command. + + >>> import io + >>> s = io.StringIO() + >>> set_up, inline, tear_down = CMakeMacroWriter(s).shell_command_strings("echo bar") + >>> set_up + 'execute_process(COMMAND echo bar OUTPUT_VARIABLE CIME_TEMP_SHELL0 OUTPUT_STRIP_TRAILING_WHITESPACE)' + >>> inline + '${CIME_TEMP_SHELL0}' + >>> tear_down + 'unset(CIME_TEMP_SHELL0)' + """ + # pylint: enable=line-too-long + # Create a unique variable name, then increment variable number + # counter so that we get a different value next time. + var_name = "CIME_TEMP_SHELL" + str(self._var_num) + self._var_num += 1 + set_up = "execute_process(COMMAND " + command + \ + " OUTPUT_VARIABLE " + var_name + \ + " OUTPUT_STRIP_TRAILING_WHITESPACE)" + tear_down = "unset(" + var_name + ")" + return (set_up, "${" + var_name + "}", tear_down) + + def variable_string(self, name): + """Return a string to refer to a variable with the given name. + + >>> import io + >>> s = io.StringIO() + >>> CMakeMacroWriter(s).variable_string("foo") + '${CIME_foo}' + """ + return "${CIME_" + name + "}" + + def set_variable(self, name, value): + """Write out a statement setting a variable to some value. + + >>> import io + >>> s = io.StringIO() + >>> CMakeMacroWriter(s).set_variable("foo", "bar") + >>> s.getvalue() + u'set(CIME_foo "bar")\\n' + """ + self.write_line("set(CIME_" + name + ' "' + value + '")') + + def start_ifeq(self, left, right): + """Write out a statement to start a conditional block. + + >>> import io + >>> s = io.StringIO() + >>> CMakeMacroWriter(s).start_ifeq("foo", "bar") + >>> s.getvalue() + u'if("foo" STREQUAL "bar")\\n' + """ + self.write_line('if("' + left + '" STREQUAL "' + right + '")') + self.indent_right() + + def end_ifeq(self): + """Write out a statement to end a block started with start_ifeq. + + >>> import io + >>> s = io.StringIO() + >>> writer = CMakeMacroWriter(s) + >>> writer.start_ifeq("foo", "bar") + >>> writer.set_variable("foo2", "bar2") + >>> writer.end_ifeq() + >>> s.getvalue() + u'if("foo" STREQUAL "bar")\\n set(CIME_foo2 "bar2")\\nendif()\\n' + """ + self.indent_left() + self.write_line("endif()") diff --git a/utils/python/CIME/build/macroconditiontree.py b/utils/python/CIME/BuildTools/macroconditiontree.py similarity index 99% rename from utils/python/CIME/build/macroconditiontree.py rename to utils/python/CIME/BuildTools/macroconditiontree.py index 57253978ffc..4172f2621f5 100644 --- a/utils/python/CIME/build/macroconditiontree.py +++ b/utils/python/CIME/BuildTools/macroconditiontree.py @@ -159,7 +159,7 @@ def write_out(self, writer): self._branches[cond_val].write_out(writer) writer.end_ifeq() -def _merge_optional_trees(tree, big_tree): +def merge_optional_trees(tree, big_tree): """Merge two MacroConditionTrees when one or both objects may be `None`.""" if tree is not None: if big_tree is None: diff --git a/utils/python/CIME/BuildTools/macrowriterbase.py b/utils/python/CIME/BuildTools/macrowriterbase.py new file mode 100644 index 00000000000..117c101e093 --- /dev/null +++ b/utils/python/CIME/BuildTools/macrowriterbase.py @@ -0,0 +1,254 @@ +"""Classes used to write build system files. + +The classes here are used to write out settings for use by Makefile and CMake +build systems. The two relevant classes are CMakeMacroWriter and +MakeMacroWriter, which encapsulate the information necessary to write CMake and +Makefile formatted text, respectively. See the docstrings for those classes for +more. +""" + +# This is not the most useful check. +# pylint: disable=invalid-name + +import os +from abc import ABCMeta, abstractmethod +from CIME.XML.standard_module_setup import * +logger = logging.getLogger(__name__) + +class MacroWriterBase(object): + + """Abstract base class for macro file writers. + + The methods here come in three flavors: + 1. indent_left/indent_right change the level of indent used internally by + the class. + 2. The various methods ending in "_string" return strings relevant to the + build system. + 3. The other methods write information to the file handle associated with + an individual writer instance. + + Public attributes: + indent_increment - Number of spaces to indent if blocks (does not apply + to format-specific indentation, e.g. cases where + Makefiles must use tabs). + output - File-like object that output is written to. + + Public methods: + indent_string + indent_left + indent_right + write_line + environment_variable_string + shell_command_string + variable_string + set_variable + append_variable + start_ifeq + end_ifeq + """ + + __metaclass__ = ABCMeta + + indent_increment = 2 + + def __init__(self, output): + """Initialize a macro writer. + + Arguments: + output - File-like object (probably an io.TextIOWrapper), which + will be written to. + """ + self.output = output + self._indent_num = 0 + + def indent_string(self): + """Return an appropriate number of spaces for the indent.""" + return ' ' * self._indent_num + + def indent_left(self): + """Decrease the amount of line indent.""" + self._indent_num -= 2 + + def indent_right(self): + """Increase the amount of line indent.""" + self._indent_num += 2 + + def write_line(self, line): + """Write a single line of output, appropriately indented. + + A trailing newline is added, whether or not the input has one. + """ + self.output.write(unicode(self.indent_string() + line + "\n")) + + @abstractmethod + def environment_variable_string(self, name): + """Return an environment variable reference.""" + pass + + @abstractmethod + def shell_command_strings(self, command): + """Return strings used to get the output of a shell command. + + Implementations should return a tuple of three strings: + 1. A line that is needed to get the output of the command (or None, + if a command can be run inline). + 2. A string that can be used within a line to refer to the output. + 3. A line that does any cleanup of temporary variables (or None, if + no cleanup is necessary). + + Example usage: + + # Get strings and write initial command. + (pre, var, post) = writer.shell_command_strings(command) + if pre is not None: + writer.write(pre) + + # Use the variable to write an if block. + writer.start_ifeq(var, "TRUE") + writer.set_variable("foo", "bar") + writer.end_ifeq() + + # Cleanup + if post is not None: + writer.write(post) + """ + pass + + @abstractmethod + def variable_string(self, name): + """Return a string to refer to a variable with the given name.""" + pass + + @abstractmethod + def set_variable(self, name, value): + """Write out a statement setting a variable to some value.""" + pass + + def append_variable(self, name, value): + """Write out a statement appending a value to a string variable.""" + var_string = self.variable_string(name) + self.set_variable(name, var_string + " " + value) + + @abstractmethod + def start_ifeq(self, left, right): + """Write out a statement to start a conditional block. + + The arguments to this method are compared, and the block is entered + only if they are equal. + """ + pass + + @abstractmethod + def end_ifeq(self): + """Write out a statement to end a block started with start_ifeq.""" + pass + +# None class based method for version 1.0 + +def write_macros_file_v1(macros, compiler, os_, machine, macros_file="Macros", output_format="make"): + """ + Parse the config_compiler.xml file into a Macros file for the + given machine and compiler. + """ + # A few things can be used from environ if not in XML + for item in ["MPI_PATH", "NETCDF_PATH"]: + if not item in macros and item in os.environ: + logger.warn("Setting %s from Environment" % item) + macros[item] = os.environ[item] + + with open(macros_file, "w") as fd: + fd.write( +"""# +# COMPILER=%s +# OS=%s +# MACH=%s +""" % (compiler, os_, machine) +) + if output_format == "make": + fd.write("#\n# Makefile Macros \n") + + # print the settings out to the Macros file + for key, value in sorted(macros.iteritems()): + if key == "_COND_": + pass + elif key.startswith("ADD_"): + fd.write("%s+=%s\n\n" % (key[4:], value)) + else: + fd.write("%s:=%s\n\n" % (key, value)) + + elif output_format == "cmake": + fd.write( +'''# +# cmake Macros generated from $compiler_file +# +include(Compilers) +set(CMAKE_C_FLAGS_RELEASE "" CACHE STRING "Flags used by c compiler." FORCE) +set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "Flags used by c compiler." FORCE) +set(CMAKE_Fortran_FLAGS_RELEASE "" CACHE STRING "Flags used by Fortran compiler." FORCE) +set(CMAKE_Fortran_FLAGS_DEBUG "" CACHE STRING "Flags used by Fortran compiler." FORCE) +set(all_build_types "None Debug Release RelWithDebInfo MinSizeRel") +set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build, options are: ${all_build_types}." FORCE) +''') + + # print the settings out to the Macros file, do it in + # two passes so that path values appear first in the + # file. + for key, value in sorted(macros.iteritems()): + if key == "_COND_": + pass + else: + value = value.replace("(", "{").replace(")", "}") + if key.endswith("_PATH"): + fd.write("set(%s %s)\n" % (key, value)) + fd.write("list(APPEND CMAKE_PREFIX_PATH %s)\n\n" % value) + + for key, value in sorted(macros.iteritems()): + if key == "_COND_": + pass + else: + value = value.replace("(", "{").replace(")", "}") + if "CFLAGS" in key: + fd.write("add_flags(CMAKE_C_FLAGS %s)\n\n" % value) + elif "FFLAGS" in key: + fd.write("add_flags(CMAKE_Fortran_FLAGS %s)\n\n" % value) + elif "CPPDEFS" in key: + fd.write("list(APPEND COMPILE_DEFINITIONS %s)\n\n" % value) + elif "SLIBS" in key or "LDFLAGS" in key: + fd.write("add_flags(CMAKE_EXE_LINKER_FLAGS %s)\n\n" % value) + + # Recursively print the conditionals, combining tests to avoid repetition + _parse_hash(macros["_COND_"], fd, 0, output_format) + + +def _parse_hash(macros, fd, depth, output_format, cmakedebug=""): + width = 2 * depth + for key, value in macros.iteritems(): + if type(value) is dict: + if output_format == "make" or "DEBUG" in key: + for key2, value2 in value.iteritems(): + if output_format == "make": + fd.write("%sifeq ($(%s), %s) \n" % (" " * width, key, key2)) + + _parse_hash(value2, fd, depth + 1, output_format, key2) + else: + if output_format == "make": + if key.startswith("ADD_"): + fd.write("%s %s += %s\n" % (" " * width, key[4:], value)) + else: + fd.write("%s %s += %s\n" % (" " * width, key, value)) + + else: + value = value.replace("(", "{").replace(")", "}") + release = "DEBUG" if "TRUE" in cmakedebug else "RELEASE" + if "CFLAGS" in key: + fd.write("add_flags(CMAKE_C_FLAGS_%s %s)\n\n" % (release, value)) + elif "FFLAGS" in key: + fd.write("add_flags(CMAKE_Fortran_FLAGS_%s %s)\n\n" % (release, value)) + elif "CPPDEF" in key: + fd.write("add_config_definitions(%s %s)\n\n" % (release, value)) + elif "SLIBS" in key or "LDFLAGS" in key: + fd.write("add_flags(CMAKE_EXE_LINKER_FLAGS_%s %s)\n\n" % (release, value)) + + width -= 2 + if output_format == "make" and depth > 0: + fd.write("%sendif\n\n" % (" " * width)) diff --git a/utils/python/CIME/BuildTools/makemacroswriter.py b/utils/python/CIME/BuildTools/makemacroswriter.py new file mode 100644 index 00000000000..83322e0b1f6 --- /dev/null +++ b/utils/python/CIME/BuildTools/makemacroswriter.py @@ -0,0 +1,93 @@ +"""Classes used to write build system files. + +The classes here are used to write out settings for use by Makefile and CMake +build systems. The two relevant classes are CMakeMacroWriter and +MakeMacroWriter, which encapsulate the information necessary to write CMake and +Makefile formatted text, respectively. See the docstrings for those classes for +more. +""" + +from CIME.BuildTools.macrowriterbase import MacroWriterBase +from CIME.XML.standard_module_setup import * +logger = logging.getLogger(__name__) + +# This is not the most useful check. +# pylint: disable=invalid-name + +class MakeMacroWriter(MacroWriterBase): + + """Macro writer for the Makefile format. + + For details on the provided methods, see MacroWriterBase, which this + class inherits from. + """ + + def environment_variable_string(self, name): + """Return an environment variable reference. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).environment_variable_string("foo") + '$(foo)' + """ + return "$(" + name + ")" + + def shell_command_strings(self, command): + """Return strings used to get the output of a shell command. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).shell_command_strings("echo bar") + (None, '$(shell echo bar)', None) + """ + return (None, "$(shell " + command + ")", None) + + def variable_string(self, name): + """Return a string to refer to a variable with the given name. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).variable_string("foo") + '$(foo)' + """ + return "$(" + name + ")" + + def set_variable(self, name, value): + """Write out a statement setting a variable to some value. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).set_variable("foo", "bar") + >>> s.getvalue() + u'foo := bar\\n' + """ + # Note that ":=" is used so that we can control the behavior for + # both Makefile and CMake variables similarly. + self.write_line(name + " := " + value) + + def start_ifeq(self, left, right): + """Write out a statement to start a conditional block. + + >>> import io + >>> s = io.StringIO() + >>> MakeMacroWriter(s).start_ifeq("foo", "bar") + >>> s.getvalue() + u'ifeq (foo,bar)\\n' + """ + self.write_line("ifeq (" + left + "," + right + ")") + self.indent_right() + + def end_ifeq(self): + """Write out a statement to end a block started with start_ifeq. + + >>> import io + >>> s = io.StringIO() + >>> writer = MakeMacroWriter(s) + >>> writer.start_ifeq("foo", "bar") + >>> writer.set_variable("foo2", "bar2") + >>> writer.end_ifeq() + >>> s.getvalue() + u'ifeq (foo,bar)\\n foo2 := bar2\\nendif\\n' + """ + self.indent_left() + self.write_line("endif") diff --git a/utils/python/CIME/build/possiblevalues.py b/utils/python/CIME/BuildTools/possiblevalues.py similarity index 98% rename from utils/python/CIME/build/possiblevalues.py rename to utils/python/CIME/BuildTools/possiblevalues.py index 2ec6e09ce7c..a4073922fee 100644 --- a/utils/python/CIME/build/possiblevalues.py +++ b/utils/python/CIME/BuildTools/possiblevalues.py @@ -1,5 +1,5 @@ from CIME.XML.standard_module_setup import * -from CIME.build.macroconditiontree import MacroConditionTree +from CIME.BuildTools.macroconditiontree import MacroConditionTree logger = logging.getLogger(__name__) diff --git a/utils/python/CIME/build/valuesetting.py b/utils/python/CIME/BuildTools/valuesetting.py similarity index 100% rename from utils/python/CIME/build/valuesetting.py rename to utils/python/CIME/BuildTools/valuesetting.py diff --git a/utils/python/CIME/XML/build.py b/utils/python/CIME/XML/build.py index 29c0ad19383..f4ef6869af3 100644 --- a/utils/python/CIME/XML/build.py +++ b/utils/python/CIME/XML/build.py @@ -63,9 +63,12 @@ # pylint: disable=invalid-name,too-few-public-methods,unused-wildcard-import # pylint: disable=wildcard-import -from CIME.macros_writers import * from CIME.utils import get_cime_root from CIME.XML.standard_module_setup import * +from CIME.BuildTools.cmakemacroswriter import CMakeMacroWriter +from CIME.BuildTools.makemacroswriter import MakeMacroWriter +from CIME.XML.compilerblock import CompilerBlock +from CIME.BuildTools.macroconditiontree import merge_optional_trees __all__ = ["Build"] @@ -77,101 +80,101 @@ class Build(object): os - Operating system used in config_build lookup and ranking. machobj - Machines object used in config_build lookup. flag_vars - A set of all variables in config_build that contain "flag- - like" data (i.e. a space-separated list of arguments). + like" data (i.e. a space-separated list of arguments). Public methods: write_macros """ def __init__(self, machobj, schema_path=None): - """Construct a Build given machine-specific information. - - In the process some information about possible variables is read in - from the schema file. - - Arguments: - machobj - A Machines object for this machine. - schema_path (optional) - Path to config_build.xsd within CIME. - - >>> "CFLAGS" in Build('MyMach').flag_vars - True - >>> "MPICC" in Build('MyMach').flag_vars - False - """ - self.machobj = machobj - - # The schema is used to figure out which variables contain - # command-line arguments (e.g. compiler flags), since these are - # processed in a more complex manner than other variables. - if schema_path is None: - schema_path = os.path.join(get_cime_root(), "cime_config", - "xml_schemas", "config_build.xsd") - - # Run an XPath query to extract the list of flag variable names. - ns = {"xs": "http://www.w3.org/2001/XMLSchema"} - flag_xpath = ".//xs:group[@name='compilerVars']/xs:choice/xs:element[@type='flagsVar']" - flag_elems = ET.parse(schema_path).getroot().findall(flag_xpath, ns) - self.flag_vars = set(elem.get('name') for elem in flag_elems) + """Construct a Build given machine-specific information. + + In the process some information about possible variables is read in + from the schema file. + + Arguments: + machobj - A Machines object for this machine. + schema_path (optional) - Path to config_build.xsd within CIME. + + >>> "CFLAGS" in Build('MyMach').flag_vars + True + >>> "MPICC" in Build('MyMach').flag_vars + False + """ + self.machobj = machobj + + # The schema is used to figure out which variables contain + # command-line arguments (e.g. compiler flags), since these are + # processed in a more complex manner than other variables. + if schema_path is None: + schema_path = os.path.join(get_cime_root(), "cime_config", + "xml_schemas", "config_build.xsd") + + # Run an XPath query to extract the list of flag variable names. + ns = {"xs": "http://www.w3.org/2001/XMLSchema"} + flag_xpath = ".//xs:group[@name='compilerVars']/xs:choice/xs:element[@type='flagsVar']" + flag_elems = ET.parse(schema_path).getroot().findall(flag_xpath, ns) + self.flag_vars = set(elem.get('name') for elem in flag_elems) def write_macros(self, build_system, xml_file, output): - """Write a Macros file for this machine. - - Arguments: - build_system - Format of the file to be written. Currently the only - valid values are "Makefile" and "CMake". - xml_file - File name or file object containing the config_build - specification of machine-specific settings. - output - Text I/O object (inheriting from io.TextIOBase) that - output should be written to. Typically, this will be the - Macros file, opened for writing. - """ - # Set up writer for this build system. - if build_system == "Makefile": - writer = MakeMacroWriter(output) - elif build_system == "CMake": - writer = CMakeMacroWriter(output) - else: - expect(False, - "Unrecognized build system provided to write_macros: " + - build_system) - - # Start processing the file. - value_lists = dict() - for compiler_elem in ET.parse(xml_file).findall("compiler"): - block = CompilerBlock(writer, compiler_elem, self.machobj) - # If this block matches machine settings, use it. - if block.matches_machine(): - block.add_settings_to_lists(self.flag_vars, value_lists) - - # Now that we've scanned through the input, output the variable - # settings. - vars_written = set() - while value_lists: - # Variables that are ready to be written. - ready_variables = [ - var_name for var_name in value_lists.keys() - if value_lists[var_name].depends <= vars_written - ] - expect(len(ready_variables) > 0, - "The config_build XML has bad references. " - "Check for circular references or variables that " - "are in a tag but not actually defined.") - big_normal_tree = None - big_append_tree = None - for var_name in ready_variables: - # Note that we're writing this variable. - vars_written.add(var_name) - # Make the conditional trees and write them out. - normal_tree, append_tree = \ - value_lists[var_name].to_cond_trees() - big_normal_tree = _merge_optional_trees(normal_tree, - big_normal_tree) - big_append_tree = _merge_optional_trees(append_tree, - big_append_tree) - # Remove this variable from the list of variables to handle - # next iteration. - del value_lists[var_name] - if big_normal_tree is not None: - big_normal_tree.write_out(writer) - if big_append_tree is not None: - big_append_tree.write_out(writer) + """Write a Macros file for this machine. + + Arguments: + build_system - Format of the file to be written. Currently the only + valid values are "Makefile" and "CMake". + xml_file - File name or file object containing the config_build + specification of machine-specific settings. + output - Text I/O object (inheriting from io.TextIOBase) that + output should be written to. Typically, this will be the + Macros file, opened for writing. + """ + # Set up writer for this build system. + if build_system == "Makefile": + writer = MakeMacroWriter(output) + elif build_system == "CMake": + writer = CMakeMacroWriter(output) + else: + expect(False, + "Unrecognized build system provided to write_macros: " + + build_system) + + # Start processing the file. + value_lists = dict() + for compiler_elem in ET.parse(xml_file).findall("compiler"): + block = CompilerBlock(writer, compiler_elem, self.machobj) + # If this block matches machine settings, use it. + if block.matches_machine(): + block.add_settings_to_lists(self.flag_vars, value_lists) + + # Now that we've scanned through the input, output the variable + # settings. + vars_written = set() + while value_lists: + # Variables that are ready to be written. + ready_variables = [ + var_name for var_name in value_lists.keys() + if value_lists[var_name].depends <= vars_written + ] + expect(len(ready_variables) > 0, + "The config_build XML has bad references. " + "Check for circular references or variables that " + "are in a tag but not actually defined.") + big_normal_tree = None + big_append_tree = None + for var_name in ready_variables: + # Note that we're writing this variable. + vars_written.add(var_name) + # Make the conditional trees and write them out. + normal_tree, append_tree = \ + value_lists[var_name].to_cond_trees() + big_normal_tree = merge_optional_trees(normal_tree, + big_normal_tree) + big_append_tree = merge_optional_trees(append_tree, + big_append_tree) + # Remove this variable from the list of variables to handle + # next iteration. + del value_lists[var_name] + if big_normal_tree is not None: + big_normal_tree.write_out(writer) + if big_append_tree is not None: + big_append_tree.write_out(writer) diff --git a/utils/python/CIME/XML/compilerblock.py b/utils/python/CIME/XML/compilerblock.py index ae190766fa8..ee27a154f75 100644 --- a/utils/python/CIME/XML/compilerblock.py +++ b/utils/python/CIME/XML/compilerblock.py @@ -63,14 +63,9 @@ # pylint: disable=invalid-name,too-few-public-methods,unused-wildcard-import # pylint: disable=wildcard-import -from CIME.macros_writers import * -from CIME.utils import get_cime_root from CIME.XML.standard_module_setup import * - -__all__ = ["Build"] - - - +from CIME.BuildTools.valuesetting import ValueSetting +from CIME.BuildTools.possiblevalues import PossibleValues class CompilerBlock(object): diff --git a/utils/python/CIME/XML/compilers.py b/utils/python/CIME/XML/compilers.py index cc34e21e580..9b533868395 100644 --- a/utils/python/CIME/XML/compilers.py +++ b/utils/python/CIME/XML/compilers.py @@ -5,134 +5,166 @@ from CIME.XML.standard_module_setup import * from CIME.XML.generic_xml import GenericXML from CIME.XML.files import Files -from CIME.XML.build.macros_writer import write_macros_file_v1 +from CIME.BuildTools.macrowriterbase import write_macros_file_v1 #write_macros_file_v2 logger = logging.getLogger(__name__) class Compilers(GenericXML): def __init__(self, compiler=None, machine=None, os_= None, mpilib=None, infile=None, files=None): - """ - initialize an object - """ - if infile is None: - if files is None: - files = Files() - infile = files.get_value("COMPILERS_SPEC_FILE") - schema = files.get_schema("COMPILERS_SPEC_FILE") - - GenericXML.__init__(self, infile, schema) - self._version = self.get_version() - - self.machine = machine - self.os = os_ - self.mpilib = mpilib - self.compiler_nodes = None # Listed from last to first - self.compiler = compiler - #Append the contents of $HOME/.cime/config_compilers.xml if it exists - #This could cause problems if node matchs are repeated when only one is expected - infile = os.path.join(os.environ.get("HOME"),".cime","config_compilers.xml") - if os.path.exists(infile): - GenericXML.read(self, infile, schema) - - if self.compiler is not None: - self.set_compiler(compiler) - - if self._version != "1.0": - # Run an XPath query to extract the list of flag variable names. - ns = {"xs": "http://www.w3.org/2001/XMLSchema"} - flag_xpath = ".//xs:group[@name='compilerVars']/xs:choice/xs:element[@type='flagsVar']" - flag_elems = ET.parse(schema).getroot().findall(flag_xpath, ns) - self.flag_vars = set(elem.get('name') for elem in flag_elems) + """ + initialize an object + """ + if infile is None: + if files is None: + files = Files() + infile = files.get_value("COMPILERS_SPEC_FILE") + schema = files.get_schema("COMPILERS_SPEC_FILE") + + GenericXML.__init__(self, infile, schema) + self._version = self.get_version() + + self.machine = machine + self.os = os_ + self.mpilib = mpilib + self.compiler_nodes = None # Listed from last to first + self.compiler = compiler + #Append the contents of $HOME/.cime/config_compilers.xml if it exists + #This could cause problems if node matchs are repeated when only one is expected + infile = os.path.join(os.environ.get("HOME"),".cime","config_compilers.xml") + if os.path.exists(infile): + GenericXML.read(self, infile) + + if self.compiler is not None: + self.set_compiler(compiler) + + if self._version != "1.0": + # Run an XPath query to extract the list of flag variable names. + ns = {"xs": "http://www.w3.org/2001/XMLSchema"} + flag_xpath = ".//xs:group[@name='compilerVars']/xs:choice/xs:element[@type='flagsVar']" + flag_elems = ET.parse(schema).getroot().findall(flag_xpath, ns) + self.flag_vars = set(elem.get('name') for elem in flag_elems) def get_compiler(self): - """ - Return the name of the compiler - """ - return self.compiler + """ + Return the name of the compiler + """ + return self.compiler def get_optional_compiler_node(self, nodename, attributes=None): - """ - Return data on a node for a compiler - """ - expect(self.compiler_nodes is not None, "Compiler not set, use parent get_node?") - for compiler_node in self.compiler_nodes: - result = self.get_optional_node(nodename, attributes, root=compiler_node) - if result is not None: - return result + """ + Return data on a node for a compiler + """ + expect(self.compiler_nodes is not None, "Compiler not set, use parent get_node?") + for compiler_node in self.compiler_nodes: + result = self.get_optional_node(nodename, attributes, root=compiler_node) + if result is not None: + return result - return None + return None def _is_compatible(self, compiler_node, compiler, machine, os_, mpilib): - for xmlid, value in [ ("COMPILER", compiler), ("MACH", machine), ("OS", os_), ("MPILIB", mpilib) ]: - if value is not None and xmlid in compiler_node.attrib and value != compiler_node.get(xmlid): - return False + for xmlid, value in [ ("COMPILER", compiler), ("MACH", machine), ("OS", os_), ("MPILIB", mpilib) ]: + if value is not None and xmlid in compiler_node.attrib and value != compiler_node.get(xmlid): + return False - return True + return True def set_compiler(self, compiler, machine=None, os_=None, mpilib=None): - """ - Sets the compiler block in the Compilers object - - >>> machobj = Compilers(machine="melvin") - >>> machobj.set_compiler("gnu") - >>> machobj.get_compiler() - 'gnu' - """ - machine = machine if machine else self.machine - os_ = os_ if os_ else self.os - mpilib = mpilib if mpilib else self.mpilib - - if self.compiler != compiler or self.machine != machine or self.os != os_ or self.mpilib != mpilib or self.compiler_nodes is None: - self.compiler_nodes = [] - nodes = self.get_nodes("compiler") - for node in nodes: - if self._is_compatible(node, compiler, machine, os_, mpilib): - self.compiler_nodes.append(node) - - self.compiler_nodes.reverse() - - self.compiler = compiler - self.machine = machine - self.os = os_ - self.mpilib = mpilib + """ + Sets the compiler block in the Compilers object + + >>> machobj = Compilers(machine="melvin") + >>> machobj.set_compiler("gnu") + >>> machobj.get_compiler() + 'gnu' + """ + machine = machine if machine else self.machine + os_ = os_ if os_ else self.os + mpilib = mpilib if mpilib else self.mpilib + + if self.compiler != compiler or self.machine != machine or self.os != os_ or self.mpilib != mpilib or self.compiler_nodes is None: + self.compiler_nodes = [] + nodes = self.get_nodes("compiler") + for node in nodes: + if self._is_compatible(node, compiler, machine, os_, mpilib): + self.compiler_nodes.append(node) + + self.compiler_nodes.reverse() + + self.compiler = compiler + self.machine = machine + self.os = os_ + self.mpilib = mpilib def get_value(self, name, attribute=None, resolved=True, subgroup=None): - """ - Get Value of fields in the config_compilers.xml file - """ - expect(self.compiler_nodes is not None, "Compiler object has no compiler defined") - expect(subgroup is None, "This class does not support subgroups") - value = None + """ + Get Value of fields in the config_compilers.xml file + """ + expect(self.compiler_nodes is not None, "Compiler object has no compiler defined") + expect(subgroup is None, "This class does not support subgroups") + value = None - node = self.get_optional_compiler_node(name) - if node is not None: - value = node.text + node = self.get_optional_compiler_node(name) + if node is not None: + value = node.text - if value is None: - # if all else fails - value = GenericXML.get_value(self, name) + if value is None: + # if all else fails + value = GenericXML.get_value(self, name) - if resolved: - if value is not None: - value = self.get_resolved_value(value) - elif name in os.environ: - value = os.environ[name] + if resolved: + if value is not None: + value = self.get_resolved_value(value) + elif name in os.environ: + value = os.environ[name] - return value + return value def write_macros_file(self, macros_file="Macros", output_format="make"): - if self._version == "1.0": - # Parse the xml settings into the $macros hash structure - # put conditional settings in the _COND_ portion of the hash - # and handle them seperately - macros = {"_COND_" : {}} - - # Do worst matches first - for compiler_node in reversed(self.compiler_nodes): - _add_to_macros(compiler_node, macros) - return write_macros_file_v1(macros, macros_file, output_format) - else: - return self._write_macros_file_v2(macros_file, output_format) + if self._version == "1.0": + # Parse the xml settings into the $macros hash structure + # put conditional settings in the _COND_ portion of the hash + # and handle them seperately + macros = {"_COND_" : {}} + + # Do worst matches first + for compiler_node in reversed(self.compiler_nodes): + _add_to_macros(compiler_node, macros) + return write_macros_file_v1(macros, self.compiler, self.os, + self.machine, macros_file, + output_format) + else: + expect(False, "Need to fix this") +# return write_macros_file_v2(macros_file, output_format) + +def _add_to_macros(node, macros): + for child in node: + name = child.tag + attrib = child.attrib + value = child.text + + if not attrib: + if name.startswith("ADD_"): + basename = name[4:] + if basename in macros: + macros[basename] = "%s %s" % (macros[basename], value) + elif name in macros: + macros[name] = "%s %s" % (macros[name], value) + else: + macros[name] = value + else: + macros[name] = value + + else: + cond_macros = macros["_COND_"] + for key, value2 in attrib.iteritems(): + if key not in cond_macros: + cond_macros[key] = {} + if value2 not in cond_macros[key]: + cond_macros[key][value2] = {} + cond_macros = cond_macros[key][value2] + + cond_macros[name] = value diff --git a/utils/python/CIME/build/cmakemacroswriter.py b/utils/python/CIME/build/cmakemacroswriter.py deleted file mode 100644 index 7254b397d99..00000000000 --- a/utils/python/CIME/build/cmakemacroswriter.py +++ /dev/null @@ -1,119 +0,0 @@ -"""Classes used to write build system files. - -The classes here are used to write out settings for use by Makefile and CMake -build systems. The two relevant classes are CMakeMacroWriter and -MakeMacroWriter, which encapsulate the information necessary to write CMake and -Makefile formatted text, respectively. See the docstrings for those classes for -more. -""" - -# This is not the most useful check. -# pylint: disable=invalid-name - -from CIME.build.macrowriterbase import MacroWriterBase -from CIME.XML.standard_module_setup import * -logger = logging.getLogger(__name__) - - -class CMakeMacroWriter(MacroWriterBase): - - """Macro writer for the CMake format. - - For details on the provided methods, see MacroWriterBase, which this - class inherits from. - """ - - def __init__(self, output): - """Initialize a CMake macro writer. - - Arguments: - output - File-like object (probably an io.TextIOWrapper), which - will be written to. - """ - super(CMakeMacroWriter, self).__init__(output) - # This counter is for avoiding name conflicts in temporary - # variables used for shell commands. - self._var_num = 0 - - def environment_variable_string(self, name): - """Return an environment variable reference. - - >>> import io - >>> s = io.StringIO() - >>> CMakeMacroWriter(s).environment_variable_string("foo") - '$ENV{foo}' - """ - return "$ENV{" + name + "}" - - def shell_command_strings(self, command): - # pylint: disable=line-too-long - """Return strings used to get the output of a shell command. - - >>> import io - >>> s = io.StringIO() - >>> set_up, inline, tear_down = CMakeMacroWriter(s).shell_command_strings("echo bar") - >>> set_up - 'execute_process(COMMAND echo bar OUTPUT_VARIABLE CIME_TEMP_SHELL0 OUTPUT_STRIP_TRAILING_WHITESPACE)' - >>> inline - '${CIME_TEMP_SHELL0}' - >>> tear_down - 'unset(CIME_TEMP_SHELL0)' - """ - # pylint: enable=line-too-long - # Create a unique variable name, then increment variable number - # counter so that we get a different value next time. - var_name = "CIME_TEMP_SHELL" + str(self._var_num) - self._var_num += 1 - set_up = "execute_process(COMMAND " + command + \ - " OUTPUT_VARIABLE " + var_name + \ - " OUTPUT_STRIP_TRAILING_WHITESPACE)" - tear_down = "unset(" + var_name + ")" - return (set_up, "${" + var_name + "}", tear_down) - - def variable_string(self, name): - """Return a string to refer to a variable with the given name. - - >>> import io - >>> s = io.StringIO() - >>> CMakeMacroWriter(s).variable_string("foo") - '${CIME_foo}' - """ - return "${CIME_" + name + "}" - - def set_variable(self, name, value): - """Write out a statement setting a variable to some value. - - >>> import io - >>> s = io.StringIO() - >>> CMakeMacroWriter(s).set_variable("foo", "bar") - >>> s.getvalue() - u'set(CIME_foo "bar")\\n' - """ - self.write_line("set(CIME_" + name + ' "' + value + '")') - - def start_ifeq(self, left, right): - """Write out a statement to start a conditional block. - - >>> import io - >>> s = io.StringIO() - >>> CMakeMacroWriter(s).start_ifeq("foo", "bar") - >>> s.getvalue() - u'if("foo" STREQUAL "bar")\\n' - """ - self.write_line('if("' + left + '" STREQUAL "' + right + '")') - self.indent_right() - - def end_ifeq(self): - """Write out a statement to end a block started with start_ifeq. - - >>> import io - >>> s = io.StringIO() - >>> writer = CMakeMacroWriter(s) - >>> writer.start_ifeq("foo", "bar") - >>> writer.set_variable("foo2", "bar2") - >>> writer.end_ifeq() - >>> s.getvalue() - u'if("foo" STREQUAL "bar")\\n set(CIME_foo2 "bar2")\\nendif()\\n' - """ - self.indent_left() - self.write_line("endif()") diff --git a/utils/python/CIME/build/macrowriterbase.py b/utils/python/CIME/build/macrowriterbase.py deleted file mode 100644 index b9faa2b7afc..00000000000 --- a/utils/python/CIME/build/macrowriterbase.py +++ /dev/null @@ -1,282 +0,0 @@ -"""Classes used to write build system files. - -The classes here are used to write out settings for use by Makefile and CMake -build systems. The two relevant classes are CMakeMacroWriter and -MakeMacroWriter, which encapsulate the information necessary to write CMake and -Makefile formatted text, respectively. See the docstrings for those classes for -more. -""" - -# This is not the most useful check. -# pylint: disable=invalid-name - -from abc import ABCMeta, abstractmethod - -__all__ = ["CMakeMacroWriter", "MakeMacroWriter"] - -class MacroWriterBase(object): - - """Abstract base class for macro file writers. - - The methods here come in three flavors: - 1. indent_left/indent_right change the level of indent used internally by - the class. - 2. The various methods ending in "_string" return strings relevant to the - build system. - 3. The other methods write information to the file handle associated with - an individual writer instance. - - Public attributes: - indent_increment - Number of spaces to indent if blocks (does not apply - to format-specific indentation, e.g. cases where - Makefiles must use tabs). - output - File-like object that output is written to. - - Public methods: - indent_string - indent_left - indent_right - write_line - environment_variable_string - shell_command_string - variable_string - set_variable - append_variable - start_ifeq - end_ifeq - """ - - __metaclass__ = ABCMeta - - indent_increment = 2 - - def __init__(self, output): - """Initialize a macro writer. - - Arguments: - output - File-like object (probably an io.TextIOWrapper), which - will be written to. - """ - self.output = output - self._indent_num = 0 - - def indent_string(self): - """Return an appropriate number of spaces for the indent.""" - return ' ' * self._indent_num - - def indent_left(self): - """Decrease the amount of line indent.""" - self._indent_num -= 2 - - def indent_right(self): - """Increase the amount of line indent.""" - self._indent_num += 2 - - def write_line(self, line): - """Write a single line of output, appropriately indented. - - A trailing newline is added, whether or not the input has one. - """ - self.output.write(unicode(self.indent_string() + line + "\n")) - - @abstractmethod - def environment_variable_string(self, name): - """Return an environment variable reference.""" - pass - - @abstractmethod - def shell_command_strings(self, command): - """Return strings used to get the output of a shell command. - - Implementations should return a tuple of three strings: - 1. A line that is needed to get the output of the command (or None, - if a command can be run inline). - 2. A string that can be used within a line to refer to the output. - 3. A line that does any cleanup of temporary variables (or None, if - no cleanup is necessary). - - Example usage: - - # Get strings and write initial command. - (pre, var, post) = writer.shell_command_strings(command) - if pre is not None: - writer.write(pre) - - # Use the variable to write an if block. - writer.start_ifeq(var, "TRUE") - writer.set_variable("foo", "bar") - writer.end_ifeq() - - # Cleanup - if post is not None: - writer.write(post) - """ - pass - - @abstractmethod - def variable_string(self, name): - """Return a string to refer to a variable with the given name.""" - pass - - @abstractmethod - def set_variable(self, name, value): - """Write out a statement setting a variable to some value.""" - pass - - def append_variable(self, name, value): - """Write out a statement appending a value to a string variable.""" - var_string = self.variable_string(name) - self.set_variable(name, var_string + " " + value) - - @abstractmethod - def start_ifeq(self, left, right): - """Write out a statement to start a conditional block. - - The arguments to this method are compared, and the block is entered - only if they are equal. - """ - pass - - @abstractmethod - def end_ifeq(self): - """Write out a statement to end a block started with start_ifeq.""" - pass - -# None class based method for version 1.0 - -def write_macros_file_v1(macros, macros_file="Macros", output_format="make"): - """ - Parse the config_compiler.xml file into a Macros file for the - given machine and compiler. - """ - # A few things can be used from environ if not in XML - for item in ["MPI_PATH", "NETCDF_PATH"]: - if not item in macros and item in os.environ: - logger.warn("Setting %s from Environment" % item) - macros[item] = os.environ[item] - - with open(macros_file, "w") as fd: - fd.write( -"""# -# COMPILER=%s -# OS=%s -# MACH=%s -""" % (self.compiler, self.os, self.machine) -) - if output_format == "make": - fd.write("#\n# Makefile Macros generated from %s \n#\n" % self.filename) - - # print the settings out to the Macros file - for key, value in sorted(macros.iteritems()): - if key == "_COND_": - pass - elif key.startswith("ADD_"): - fd.write("%s+=%s\n\n" % (key[4:], value)) - else: - fd.write("%s:=%s\n\n" % (key, value)) - - elif output_format == "cmake": - fd.write( -'''# -# cmake Macros generated from $compiler_file -# -include(Compilers) -set(CMAKE_C_FLAGS_RELEASE "" CACHE STRING "Flags used by c compiler." FORCE) -set(CMAKE_C_FLAGS_DEBUG "" CACHE STRING "Flags used by c compiler." FORCE) -set(CMAKE_Fortran_FLAGS_RELEASE "" CACHE STRING "Flags used by Fortran compiler." FORCE) -set(CMAKE_Fortran_FLAGS_DEBUG "" CACHE STRING "Flags used by Fortran compiler." FORCE) -set(all_build_types "None Debug Release RelWithDebInfo MinSizeRel") -set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build, options are: ${all_build_types}." FORCE) -''') - - # print the settings out to the Macros file, do it in - # two passes so that path values appear first in the - # file. - for key, value in sorted(macros.iteritems()): - if key == "_COND_": - pass - else: - value = value.replace("(", "{").replace(")", "}") - if key.endswith("_PATH"): - fd.write("set(%s %s)\n" % (key, value)) - fd.write("list(APPEND CMAKE_PREFIX_PATH %s)\n\n" % value) - - for key, value in sorted(macros.iteritems()): - if key == "_COND_": - pass - else: - value = value.replace("(", "{").replace(")", "}") - if "CFLAGS" in key: - fd.write("add_flags(CMAKE_C_FLAGS %s)\n\n" % value) - elif "FFLAGS" in key: - fd.write("add_flags(CMAKE_Fortran_FLAGS %s)\n\n" % value) - elif "CPPDEFS" in key: - fd.write("list(APPEND COMPILE_DEFINITIONS %s)\n\n" % value) - elif "SLIBS" in key or "LDFLAGS" in key: - fd.write("add_flags(CMAKE_EXE_LINKER_FLAGS %s)\n\n" % value) - - # Recursively print the conditionals, combining tests to avoid repetition - _parse_hash(macros["_COND_"], fd, 0, output_format) - - -def _parse_hash(macros, fd, depth, output_format, cmakedebug=""): - width = 2 * depth - for key, value in macros.iteritems(): - if type(value) is dict: - if output_format == "make" or "DEBUG" in key: - for key2, value2 in value.iteritems(): - if output_format == "make": - fd.write("%sifeq ($(%s), %s) \n" % (" " * width, key, key2)) - - _parse_hash(value2, fd, depth + 1, output_format, key2) - else: - if output_format == "make": - if key.startswith("ADD_"): - fd.write("%s %s += %s\n" % (" " * width, key[4:], value)) - else: - fd.write("%s %s += %s\n" % (" " * width, key, value)) - - else: - value = value.replace("(", "{").replace(")", "}") - release = "DEBUG" if "TRUE" in cmakedebug else "RELEASE" - if "CFLAGS" in key: - fd.write("add_flags(CMAKE_C_FLAGS_%s %s)\n\n" % (release, value)) - elif "FFLAGS" in key: - fd.write("add_flags(CMAKE_Fortran_FLAGS_%s %s)\n\n" % (release, value)) - elif "CPPDEF" in key: - fd.write("add_config_definitions(%s %s)\n\n" % (release, value)) - elif "SLIBS" in key or "LDFLAGS" in key: - fd.write("add_flags(CMAKE_EXE_LINKER_FLAGS_%s %s)\n\n" % (release, value)) - - width -= 2 - if output_format == "make" and depth > 0: - fd.write("%sendif\n\n" % (" " * width)) - -def _add_to_macros(node, macros): - for child in node: - name = child.tag - attrib = child.attrib - value = child.text - - if not attrib: - if name.startswith("ADD_"): - basename = name[4:] - if basename in macros: - macros[basename] = "%s %s" % (macros[basename], value) - elif name in macros: - macros[name] = "%s %s" % (macros[name], value) - else: - macros[name] = value - else: - macros[name] = value - - else: - cond_macros = macros["_COND_"] - for key, value2 in attrib.iteritems(): - if key not in cond_macros: - cond_macros[key] = {} - if value2 not in cond_macros[key]: - cond_macros[key][value2] = {} - cond_macros = cond_macros[key][value2] - - cond_macros[name] = value diff --git a/utils/python/CIME/build/makemacroswriter.py b/utils/python/CIME/build/makemacroswriter.py deleted file mode 100644 index 0bcf2205762..00000000000 --- a/utils/python/CIME/build/makemacroswriter.py +++ /dev/null @@ -1,93 +0,0 @@ -"""Classes used to write build system files. - -The classes here are used to write out settings for use by Makefile and CMake -build systems. The two relevant classes are CMakeMacroWriter and -MakeMacroWriter, which encapsulate the information necessary to write CMake and -Makefile formatted text, respectively. See the docstrings for those classes for -more. -""" - -from CIME.build.macrowriterbase import MacroWriterBase -from CIME.XML.standard_module_setup import * -logger = logging.getLogger(__name__) - -# This is not the most useful check. -# pylint: disable=invalid-name - -class MakeMacroWriter(MacroWriterBase): - - """Macro writer for the Makefile format. - - For details on the provided methods, see MacroWriterBase, which this - class inherits from. - """ - - def environment_variable_string(self, name): - """Return an environment variable reference. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).environment_variable_string("foo") - '$(foo)' - """ - return "$(" + name + ")" - - def shell_command_strings(self, command): - """Return strings used to get the output of a shell command. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).shell_command_strings("echo bar") - (None, '$(shell echo bar)', None) - """ - return (None, "$(shell " + command + ")", None) - - def variable_string(self, name): - """Return a string to refer to a variable with the given name. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).variable_string("foo") - '$(foo)' - """ - return "$(" + name + ")" - - def set_variable(self, name, value): - """Write out a statement setting a variable to some value. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).set_variable("foo", "bar") - >>> s.getvalue() - u'foo := bar\\n' - """ - # Note that ":=" is used so that we can control the behavior for - # both Makefile and CMake variables similarly. - self.write_line(name + " := " + value) - - def start_ifeq(self, left, right): - """Write out a statement to start a conditional block. - - >>> import io - >>> s = io.StringIO() - >>> MakeMacroWriter(s).start_ifeq("foo", "bar") - >>> s.getvalue() - u'ifeq (foo,bar)\\n' - """ - self.write_line("ifeq (" + left + "," + right + ")") - self.indent_right() - - def end_ifeq(self): - """Write out a statement to end a block started with start_ifeq. - - >>> import io - >>> s = io.StringIO() - >>> writer = MakeMacroWriter(s) - >>> writer.start_ifeq("foo", "bar") - >>> writer.set_variable("foo2", "bar2") - >>> writer.end_ifeq() - >>> s.getvalue() - u'ifeq (foo,bar)\\n foo2 := bar2\\nendif\\n' - """ - self.indent_left() - self.write_line("endif") From 44d1d2df79c94067f048bc92ed461138573bc0bd Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 21 Nov 2016 11:08:01 -0700 Subject: [PATCH 03/20] improve configure program flow --- cime_config/acme/machines/Makefile | 2 +- cime_config/buildlib.gptl | 2 +- cime_config/cesm/config_files.xml | 4 +- cime_config/cesm/machines/Makefile | 2 +- share/timing/Makefile | 2 +- tools/configure | 59 +----------------------------- utils/python/CIME/XML/compilers.py | 25 +++++++++---- utils/python/CIME/case.py | 37 ------------------- utils/python/CIME/case_setup.py | 19 ++++------ 9 files changed, 33 insertions(+), 119 deletions(-) diff --git a/cime_config/acme/machines/Makefile b/cime_config/acme/machines/Makefile index 00072733330..0cf53f99fac 100644 --- a/cime_config/acme/machines/Makefile +++ b/cime_config/acme/machines/Makefile @@ -137,7 +137,7 @@ ifeq (,$(SHAREDPATH)) INSTALL_SHAREDPATH = $(EXEROOT)/$(SHAREDPATH) endif -include $(CASEROOT)/Macros +include $(CASEROOT)/Macros.make # Decide whether to use a C++ or Fortran linker, based on whether we # are using any C++ code and the compiler-dependent CXX_LINKER variable ifeq ($(USE_CXX), true) diff --git a/cime_config/buildlib.gptl b/cime_config/buildlib.gptl index 42dc281db9d..1269c3fd4cc 100755 --- a/cime_config/buildlib.gptl +++ b/cime_config/buildlib.gptl @@ -18,6 +18,6 @@ setenv SHAREDPATH $2 cd $GPTL_LIBDIR -$GMAKE -f $GPTL_DIR/Makefile install MACFILE=$CASEROOT/Macros MODEL=gptl || exit 1 +$GMAKE -f $GPTL_DIR/Makefile install MACFILE=$CASEROOT/Macros.make MODEL=gptl || exit 1 exit 0 diff --git a/cime_config/cesm/config_files.xml b/cime_config/cesm/config_files.xml index ff6f3f07d67..42d126bc870 100644 --- a/cime_config/cesm/config_files.xml +++ b/cime_config/cesm/config_files.xml @@ -43,8 +43,7 @@ char - $CIMEROOT/cime_config/$MODEL/machines/config_build.xml - $CIMEROOT/cime_config/xml_schemas/config_build.xsd + $CIMEROOT/cime_config/$MODEL/machines/config_compilers.xml case_last env_case.xml file containing compiler specifications for target model primary component (for documentation only - DO NOT EDIT) @@ -333,3 +332,4 @@ + diff --git a/cime_config/cesm/machines/Makefile b/cime_config/cesm/machines/Makefile index 3cbf9943965..33fc9220f1f 100644 --- a/cime_config/cesm/machines/Makefile +++ b/cime_config/cesm/machines/Makefile @@ -137,7 +137,7 @@ ifeq (,$(SHAREDPATH)) endif INSTALL_SHAREDPATH = $(EXEROOT)/$(SHAREDPATH) -include $(CASEROOT)/Macros +include $(CASEROOT)/Macros.make # Decide whether to use a C++ or Fortran linker, based on whether we # are using any C++ code and the compiler-dependent CXX_LINKER variable ifeq ($(USE_CXX), true) diff --git a/share/timing/Makefile b/share/timing/Makefile index 85e456d209e..e2bc675d0c4 100644 --- a/share/timing/Makefile +++ b/share/timing/Makefile @@ -19,7 +19,7 @@ endif ifeq ($(strip $(MACFILE)),) - MACFILE := Macros + MACFILE := Macros.make endif # Machine specific macros file diff --git a/tools/configure b/tools/configure index c5140d40e6f..34b20702185 100755 --- a/tools/configure +++ b/tools/configure @@ -16,17 +16,15 @@ COMPILER, MPILIB, and DEBUG, respectively. """ import os -import shutil import sys _CIMEROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") sys.path.append(os.path.join(_CIMEROOT, "scripts", "Tools")) +sys.path.append(os.path.join(_CIMEROOT, "scripts", "utils", "python")) from standard_script_setup import * from CIME.utils import expect -from CIME.XML.build import Build -from CIME.XML.env_mach_specific import EnvMachSpecific -from CIME.XML.machines import Machines +from CIME.BuildTools.configure import configure logger = logging.getLogger(__name__) @@ -117,59 +115,6 @@ def parse_command_line(args): return opts -def configure(machobj, output_dir, macros_format, compiler, mpilib, debug, sysos): - """Add Macros, Depends, and env_mach_specific files to a directory. - - Arguments: - machobj - Machines argument for this machine. - output_dir - Directory in which to place output. - macros_format - Container containing the string 'Makefile' to produce - Makefile Macros output, and/or 'CMake' for CMake output. - compiler - String containing the compiler vendor to configure for. - mpilib - String containing the MPI implementation to configure for. - debug - Boolean specifying whether debugging options are enabled. - """ - # Macros generation. - suffixes = {'Makefile': '.make', 'CMake': '.cmake'} - macro_maker = Build(machobj) - build_file_name = os.path.join(machobj.machines_dir, "config_build.xml") - for form in macros_format: - out_file_name = os.path.join(output_dir, - "Macros"+suffixes[form]) - with open(out_file_name, "w") as macros_file: - macro_maker.write_macros(form, build_file_name, macros_file) - - # Depends file copy. - mach_depends = os.path.join(machobj.machines_dir, - "Depends."+machobj.get_machine_name()) - if os.path.isfile(mach_depends): - shutil.copy(mach_depends, output_dir) - compiler_depends = os.path.join(machobj.machines_dir, "Depends."+compiler) - if os.path.isfile(compiler_depends): - shutil.copy(compiler_depends, output_dir) - - # env_mach_specific generation. - ems_path = os.path.join(output_dir, "env_mach_specific.xml") - if os.path.exists(ems_path): - os.remove(ems_path) - ems_file = EnvMachSpecific(output_dir) - ems_file.populate(machobj) - ems_file.write() - for shell in ('sh', 'csh'): - ems_file.make_env_mach_specific_file(compiler, debug, mpilib, shell) - shell_path = os.path.join(output_dir, ".env_mach_specific." + shell) - with open(shell_path, 'a') as shell_file: - if shell == 'sh': - shell_file.write("\nexport COMPILER=%s\n" % compiler) - shell_file.write("export MPILIB=%s\n" % mpilib) - shell_file.write("export DEBUG=%s\n" % repr(debug).upper()) - shell_file.write("export OS=%s\n" % sysos) - else: - shell_file.write("\nsetenv COMPILER %s\n" % compiler) - shell_file.write("setenv MPILIB %s\n" % mpilib) - shell_file.write("setenv DEBUG %s\n" % repr(debug).upper()) - shell_file.write("setenv OS %s\n" % sysos) - def _main(): opts = parse_command_line(sys.argv) configure(opts['machobj'], opts['output_dir'], opts['macros_format'], diff --git a/utils/python/CIME/XML/compilers.py b/utils/python/CIME/XML/compilers.py index 9b533868395..32ab5ac71fc 100644 --- a/utils/python/CIME/XML/compilers.py +++ b/utils/python/CIME/XML/compilers.py @@ -11,7 +11,7 @@ class Compilers(GenericXML): - def __init__(self, compiler=None, machine=None, os_= None, mpilib=None, infile=None, files=None): + def __init__(self, machobj, infile=None, compiler=None, mpilib=None, files=None): """ initialize an object """ @@ -24,11 +24,16 @@ def __init__(self, compiler=None, machine=None, os_= None, mpilib=None, infile=N GenericXML.__init__(self, infile, schema) self._version = self.get_version() - self.machine = machine - self.os = os_ - self.mpilib = mpilib - self.compiler_nodes = None # Listed from last to first + self.machine = machobj.get_machine_name() + self.os = machobj.get_value("OS") + if mpilib is None: + mpilib = machobj.get_default_MPIlib() + self.mpilib = mpilib + if compiler is None: + compiler = machobj.get_default_compiler() self.compiler = compiler + + self.compiler_nodes = None # Listed from last to first #Append the contents of $HOME/.cime/config_compilers.xml if it exists #This could cause problems if node matchs are repeated when only one is expected infile = os.path.join(os.environ.get("HOME"),".cime","config_compilers.xml") @@ -133,12 +138,16 @@ def write_macros_file(self, macros_file="Macros", output_format="make"): # Do worst matches first for compiler_node in reversed(self.compiler_nodes): _add_to_macros(compiler_node, macros) - return write_macros_file_v1(macros, self.compiler, self.os, + write_macros_file_v1(macros, self.compiler, self.os, self.machine, macros_file, output_format) else: - expect(False, "Need to fix this") -# return write_macros_file_v2(macros_file, output_format) + if output_format == "make": + format = "Makefile" + elif output_format == "cmake": + format = "CMake" + with open(macros_file, "w") as macros: + write_macros_file_v2(format, self._root, macros) def _add_to_macros(node, macros): for child in node: diff --git a/utils/python/CIME/case.py b/utils/python/CIME/case.py index e45fc10c21f..4dde1f94901 100644 --- a/utils/python/CIME/case.py +++ b/utils/python/CIME/case.py @@ -11,7 +11,6 @@ from CIME.utils import expect, get_cime_root, append_status from CIME.utils import convert_to_type, get_model, get_project from CIME.utils import get_build_threaded, get_current_commit -from CIME.XML.build import Build from CIME.XML.machines import Machines from CIME.XML.pes import Pes from CIME.XML.files import Files @@ -812,42 +811,6 @@ def _create_caseroot_tools(self): except Exception as e: logger.warning("FAILED to set up toolfiles: %s %s %s" % (str(e), toolfile, destfile)) - # Create Macros file. - machine = self.get_value("MACH") - files = Files() - # Use config_build if the environment variable is set, or if there is no - # config_compilers file. - if os.getenv("CIME_USE_CONFIG_BUILD") == "TRUE" or \ - files.get_value("COMPILERS_SPEC_FILE") is None: - build_file = files.get_value("BUILD_SPEC_FILE") - machobj = Machines(machine=machine, files=files) - macro_maker = Build(machobj) - macros_path = os.path.join(self._caseroot, "Macros") - with open(macros_path, "w") as macros_file: - macro_maker.write_macros('Makefile', build_file, macros_file) - - # Copy any system or compiler Depends files to the case. - compiler = self.get_value("COMPILER") - for dep in (machine, compiler): - dfile = "Depends.%s"%dep - if os.path.isfile(os.path.join(machines_dir,dfile)): - shutil.copyfile(os.path.join(machines_dir,dfile), os.path.join(self._caseroot,dfile)) - dfile = "Depends.%s.%s"%(machine,compiler) - if os.path.isfile(os.path.join(machines_dir,dfile)): - shutil.copyfile(os.path.join(machines_dir,dfile), os.path.join(self._caseroot, dfile)) - # set up infon files - # infofiles = os.path.join(os.path.join(toolsdir, README.post_process") - #FIXME - the following does not work - # print "DEBUG: infofiles are ",infofiles - # try: - # for infofile in infofiles: - # print "DEBUG: infofile is %s, %s" %(infofile, os.path.basename(infofile)) - # dst_file = caseroot + "/" + os.path.basename(infofile) - # shutil.copyfile(infofile, dst_file) - # os.chmod(dst_file, os.stat(dst_file).st_mode | stat.S_IXUSR | stat.S_IXGRP) - # except Exception as e: - # logger.warning("FAILED to set up infofiles: %s" % str(e)) - def _create_caseroot_sourcemods(self): components = self.get_compset_components() for component in components: diff --git a/utils/python/CIME/case_setup.py b/utils/python/CIME/case_setup.py index 57b3aa8fb5b..c763940d3b8 100644 --- a/utils/python/CIME/case_setup.py +++ b/utils/python/CIME/case_setup.py @@ -7,7 +7,8 @@ from CIME.check_lockedfiles import check_lockedfiles from CIME.preview_namelists import create_dirs, create_namelists from CIME.XML.env_mach_pes import EnvMachPes -from CIME.XML.compilers import Compilers +from CIME.XML.machines import Machines +from CIME.BuildTools.configure import configure from CIME.utils import append_status, get_cime_root from CIME.test_status import * @@ -145,18 +146,14 @@ def _case_setup_impl(case, caseroot, clean=False, test_mode=False, reset=False): case.load_env() models = case.get_values("COMP_CLASSES") - - mach, compiler, debug, mpilib = \ - case.get_value("MACH"), case.get_value("COMPILER"), case.get_value("DEBUG"), case.get_value("MPILIB") + mach = case.get_value("MACH") + compiler = case.get_value("COMPILER") + debug = case.get_value("DEBUG") + mpilib = case.get_value("MPILIB") + sysos = case.get_value("OS") expect(mach is not None, "xml variable MACH is not set") - # Create Macros file only if it does not exist - if not os.path.exists("Macros"): - logger.debug("Creating Macros file for %s" % mach) - compilers = Compilers(compiler=compiler, machine=mach, os_=case.get_value("OS"), mpilib=mpilib) - compilers.write_macros_file() - else: - logger.debug("Macros script already created ...skipping") + configure(Machines(machine=mach), caseroot, ["Makefile"], compiler, mpilib, debug, sysos) # Set tasks to 1 if mpi-serial library if mpilib == "mpi-serial": From b450b102728e79ad5e03d12d2829571328864db6 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 21 Nov 2016 11:11:12 -0700 Subject: [PATCH 04/20] move into CIME --- utils/python/CIME/BuildTools/configure.py | 88 +++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 utils/python/CIME/BuildTools/configure.py diff --git a/utils/python/CIME/BuildTools/configure.py b/utils/python/CIME/BuildTools/configure.py new file mode 100644 index 00000000000..d5406f8519f --- /dev/null +++ b/utils/python/CIME/BuildTools/configure.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python + +"""This script writes CIME build information to a directory. + +The pieces of information that will be written include: + +1. Machine-specific build settings (i.e. the "Macros" file). +2. File-specific build settings (i.e. "Depends" files). +3. Environment variable loads (i.e. the env_mach_specific files). + +The .env_mach_specific.sh and .env_mach_specific.csh files are specific to a +given compiler, MPI library, and DEBUG setting. By default, these will be the +machine's default compiler, the machine's default MPI library, and FALSE, +respectively. These can be changed by setting the environment variables +COMPILER, MPILIB, and DEBUG, respectively. +""" + +import shutil +from CIME.XML.standard_module_setup import * +from CIME.utils import expect +from CIME.XML.compilers import Compilers +from CIME.XML.files import Files +from CIME.XML.env_mach_specific import EnvMachSpecific +from CIME.XML.machines import Machines + +logger = logging.getLogger(__name__) + +def configure(machobj, output_dir, macros_format, compiler, mpilib, debug, sysos): + """Add Macros, Depends, and env_mach_specific files to a directory. + + Arguments: + machobj - Machines argument for this machine. + output_dir - Directory in which to place output. + macros_format - Container containing the string 'Makefile' to produce + Makefile Macros output, and/or 'CMake' for CMake output. + compiler - String containing the compiler vendor to configure for. + mpilib - String containing the MPI implementation to configure for. + debug - Boolean specifying whether debugging options are enabled. + """ + # Macros generation. + suffixes = {'Makefile': 'make', 'CMake': 'cmake'} + macro_maker = Compilers(machobj) + for form in macros_format: + out_file_name = os.path.join(output_dir,"Macros."+suffixes[form]) + macro_maker.write_macros_file(macros_file=out_file_name, output_format=suffixes[form]) + + _copy_depends_files(machobj.get_machine_name(), machobj.machines_dir, output_dir, compiler) + _generate_env_mach_specific(output_dir, compiler, mpilib, debug, sysos) + +def _copy_depends_files(machine_name, machines_dir, output_dir, compiler): + """ + Copy any system or compiler Depends files if they do not exist in the output directory + """ + for dep in (machine_name, compiler): + dfile = os.path.join(machines_dir, "Depends.%s"%dep) + outputdfile = os.path.join(output_dir, "Depends.%s"%dep) + if os.path.isfile(dfile) and not os.path.isfile(outputdfile): + shutil.copyfile(dfile, outputdfile) + dfile = os.path.join(machines_dir, "Depends.%s.%s"%(machine_name,compiler)) + outputdfile = os.path.join(output_dir, "Depends.%s.%s"%(machine_name,compiler)) + if os.path.isfile(dfile) and not os.path.isfile(outputdfile): + shutil.copyfile(dfile, outputdfile) + +def _generate_env_mach_specific(output_dir, compiler, mpilib, debug, sysos): + """ + env_mach_specific generation. + """ + ems_path = os.path.join(output_dir, "env_mach_specific.xml") + if os.path.exists(ems_path): + logger.warn("%s already exists, delete to replace"%ems_path) + return + ems_file = EnvMachSpecific(output_dir) + ems_file.populate(machobj) + ems_file.write() + for shell in ('sh', 'csh'): + ems_file.make_env_mach_specific_file(compiler, debug, mpilib, shell) + shell_path = os.path.join(output_dir, ".env_mach_specific." + shell) + with open(shell_path, 'a') as shell_file: + if shell == 'sh': + shell_file.write("\nexport COMPILER=%s\n" % compiler) + shell_file.write("export MPILIB=%s\n" % mpilib) + shell_file.write("export DEBUG=%s\n" % repr(debug).upper()) + shell_file.write("export OS=%s\n" % sysos) + else: + shell_file.write("\nsetenv COMPILER %s\n" % compiler) + shell_file.write("setenv MPILIB %s\n" % mpilib) + shell_file.write("setenv DEBUG %s\n" % repr(debug).upper()) + shell_file.write("setenv OS %s\n" % sysos) From 450c6e3129ef2c2b1fee651855d0f8d905756eb7 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 21 Nov 2016 14:45:08 -0700 Subject: [PATCH 05/20] merge build into compilers --- cime_config/cesm/config_files.xml | 12 +- driver_cpl/cime_config/config_component.xml | 2 +- utils/python/CIME/XML/build.py | 180 -------------------- utils/python/CIME/XML/compilers.py | 86 +++++++++- utils/python/CIME/case_setup.py | 2 + 5 files changed, 82 insertions(+), 200 deletions(-) delete mode 100644 utils/python/CIME/XML/build.py diff --git a/cime_config/cesm/config_files.xml b/cime_config/cesm/config_files.xml index 42d126bc870..4e536666839 100644 --- a/cime_config/cesm/config_files.xml +++ b/cime_config/cesm/config_files.xml @@ -42,19 +42,12 @@ - char - $CIMEROOT/cime_config/$MODEL/machines/config_compilers.xml - case_last - env_case.xml - file containing compiler specifications for target model primary component (for documentation only - DO NOT EDIT) - - - char $CIMEROOT/cime_config/$MODEL/machines/config_build.xml case_last env_case.xml - file containing build specifications for target model primary component (for documentation only - DO NOT EDIT) + file containing compiler specifications for target model primary component (for documentation only - DO NOT EDIT) + $CIMEROOT/cime_config/xml_schemas/config_build.xsd @@ -332,4 +325,3 @@ - diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index b867b3813db..985f3596477 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -3503,7 +3503,7 @@ TRUE TRUE + feedbacks for a TG compset, this will give us additional diagnostics --> TRUE run_glc diff --git a/utils/python/CIME/XML/build.py b/utils/python/CIME/XML/build.py deleted file mode 100644 index f4ef6869af3..00000000000 --- a/utils/python/CIME/XML/build.py +++ /dev/null @@ -1,180 +0,0 @@ -""" -Classes used to build the CIME Macros file. - -The main "public" class here is Build. It is initialized with machine-specific -information, and its write_macros method is the driver for translating the -config_build.xml file into a Makefile or CMake-format Macros file. - -For developers, here's the role of the other classes in the process: - -- A CompilerBlock is responsible for translating the XML code in a - tag into Python data structures. - -- A PossibleValues object keeps track of all the settings that could affect a - particular variable, and is the main way that these settings are stored. - -- A MacroConditionTree is the structure that is responsible for writing out the - settings. While the PossibleValues objects are organized by variable name, the - MacroConditionTree is organized by conditional blocks, and thus roughly - plays the role of a syntax tree corresponding to the Makefile/CMake output. - -In more detail: - -- Build.write_macros immediately creates a MakeMacroWriter or CMakeMacroWriter - to translate strings for the build system. - -- It also creates value_lists, a dictionary of PossibleValues objects, with - variable names as the keys. Each variable has a single PossibleValues object - associated with it. - -- For each element, Build.write_macros creates a CompilerBlock - instance. This object is responsible for translating the XML in its block, in - order to populate the PossibleValues instances. This includes handling the - // tags, and keeping track of dependencies induced by one - variable referencing another's value. - -- The PossibleValues object holds the information about how one variable can be - set, based on various build options. It has two main roles: - 1. As we iterate through the XML input file, each setting is added to the - relevant PossibleValues object. The PossibleValues object contains lists - of settings sorted by how machine-specific those settings are. - 2. The PossibleValues object iterates through the list of settings to check - for ambiguities. E.g. if there is a setting for DEBUG=TRUE, and another - setting for MPILIB=mpi-serial, it is ambiguous in the case where both - conditions hold. - -- A ValueSetting object is a simple struct that a setting from the XML file is - translated to. The lists in the PossibleValues class contain these objects. - -- Once the XML has all been read in and the PossibleValues objects are - populated, the dependencies among variables are checked in Build.write_macros. - For each variable, if all its dependencies have been handled, it is converted - to a MacroConditionTree merged with all other trees for variables that are - ready, and written out. Then we loop through the variable list again to check - for variables whose dependencies are all handled. - -- The MacroConditionTree acts as a primitive syntax tree. Its __init__ method - reorganizes the data into conditional blocks, and its write_out method writes - uses the MakeMacroWriter/CMakeMacroWrite object to write to the Macros file. - MacroConditionTree objects can be merged to reduce the length of the output. -""" - -# These don't seem to be particularly useful checks. -# pylint: disable=invalid-name,too-few-public-methods,unused-wildcard-import -# pylint: disable=wildcard-import - -from CIME.utils import get_cime_root -from CIME.XML.standard_module_setup import * -from CIME.BuildTools.cmakemacroswriter import CMakeMacroWriter -from CIME.BuildTools.makemacroswriter import MakeMacroWriter -from CIME.XML.compilerblock import CompilerBlock -from CIME.BuildTools.macroconditiontree import merge_optional_trees - -__all__ = ["Build"] - -class Build(object): - - """Class to convert config_build.xml input into a macros file. - - Public attributes: - os - Operating system used in config_build lookup and ranking. - machobj - Machines object used in config_build lookup. - flag_vars - A set of all variables in config_build that contain "flag- - like" data (i.e. a space-separated list of arguments). - - Public methods: - write_macros - """ - - def __init__(self, machobj, schema_path=None): - """Construct a Build given machine-specific information. - - In the process some information about possible variables is read in - from the schema file. - - Arguments: - machobj - A Machines object for this machine. - schema_path (optional) - Path to config_build.xsd within CIME. - - >>> "CFLAGS" in Build('MyMach').flag_vars - True - >>> "MPICC" in Build('MyMach').flag_vars - False - """ - self.machobj = machobj - - # The schema is used to figure out which variables contain - # command-line arguments (e.g. compiler flags), since these are - # processed in a more complex manner than other variables. - if schema_path is None: - schema_path = os.path.join(get_cime_root(), "cime_config", - "xml_schemas", "config_build.xsd") - - # Run an XPath query to extract the list of flag variable names. - ns = {"xs": "http://www.w3.org/2001/XMLSchema"} - flag_xpath = ".//xs:group[@name='compilerVars']/xs:choice/xs:element[@type='flagsVar']" - flag_elems = ET.parse(schema_path).getroot().findall(flag_xpath, ns) - self.flag_vars = set(elem.get('name') for elem in flag_elems) - - def write_macros(self, build_system, xml_file, output): - """Write a Macros file for this machine. - - Arguments: - build_system - Format of the file to be written. Currently the only - valid values are "Makefile" and "CMake". - xml_file - File name or file object containing the config_build - specification of machine-specific settings. - output - Text I/O object (inheriting from io.TextIOBase) that - output should be written to. Typically, this will be the - Macros file, opened for writing. - """ - # Set up writer for this build system. - if build_system == "Makefile": - writer = MakeMacroWriter(output) - elif build_system == "CMake": - writer = CMakeMacroWriter(output) - else: - expect(False, - "Unrecognized build system provided to write_macros: " + - build_system) - - # Start processing the file. - value_lists = dict() - for compiler_elem in ET.parse(xml_file).findall("compiler"): - block = CompilerBlock(writer, compiler_elem, self.machobj) - # If this block matches machine settings, use it. - if block.matches_machine(): - block.add_settings_to_lists(self.flag_vars, value_lists) - - # Now that we've scanned through the input, output the variable - # settings. - vars_written = set() - while value_lists: - # Variables that are ready to be written. - ready_variables = [ - var_name for var_name in value_lists.keys() - if value_lists[var_name].depends <= vars_written - ] - expect(len(ready_variables) > 0, - "The config_build XML has bad references. " - "Check for circular references or variables that " - "are in a tag but not actually defined.") - big_normal_tree = None - big_append_tree = None - for var_name in ready_variables: - # Note that we're writing this variable. - vars_written.add(var_name) - # Make the conditional trees and write them out. - normal_tree, append_tree = \ - value_lists[var_name].to_cond_trees() - big_normal_tree = merge_optional_trees(normal_tree, - big_normal_tree) - big_append_tree = merge_optional_trees(append_tree, - big_append_tree) - # Remove this variable from the list of variables to handle - # next iteration. - del value_lists[var_name] - if big_normal_tree is not None: - big_normal_tree.write_out(writer) - if big_append_tree is not None: - big_append_tree.write_out(writer) diff --git a/utils/python/CIME/XML/compilers.py b/utils/python/CIME/XML/compilers.py index 32ab5ac71fc..2779b15d496 100644 --- a/utils/python/CIME/XML/compilers.py +++ b/utils/python/CIME/XML/compilers.py @@ -5,7 +5,11 @@ from CIME.XML.standard_module_setup import * from CIME.XML.generic_xml import GenericXML from CIME.XML.files import Files -from CIME.BuildTools.macrowriterbase import write_macros_file_v1 #write_macros_file_v2 +from CIME.XML.compilerblock import CompilerBlock +from CIME.BuildTools.macrowriterbase import write_macros_file_v1 +from CIME.BuildTools.makemacroswriter import MakeMacroWriter +from CIME.BuildTools.cmakemacroswriter import CMakeMacroWriter +from CIME.BuildTools.macroconditiontree import merge_optional_trees logger = logging.getLogger(__name__) @@ -22,12 +26,13 @@ def __init__(self, machobj, infile=None, compiler=None, mpilib=None, files=None) schema = files.get_schema("COMPILERS_SPEC_FILE") GenericXML.__init__(self, infile, schema) + self._machobj = machobj self._version = self.get_version() - self.machine = machobj.get_machine_name() - self.os = machobj.get_value("OS") + self.machine = machobj.get_machine_name() + self.os = machobj.get_value("OS") if mpilib is None: - mpilib = machobj.get_default_MPIlib() + mpilib = machobj.get_default_MPIlib() self.mpilib = mpilib if compiler is None: compiler = machobj.get_default_compiler() @@ -80,10 +85,10 @@ def _is_compatible(self, compiler_node, compiler, machine, os_, mpilib): def set_compiler(self, compiler, machine=None, os_=None, mpilib=None): """ Sets the compiler block in the Compilers object - - >>> machobj = Compilers(machine="melvin") - >>> machobj.set_compiler("gnu") - >>> machobj.get_compiler() + >>> from CIME.XML.machines import Machines + >>> compobj = Compilers(Machines(machine="melvin")) + >>> compobj.set_compiler("gnu") + >>> compobj.get_compiler() 'gnu' """ machine = machine if machine else self.machine @@ -147,7 +152,70 @@ def write_macros_file(self, macros_file="Macros", output_format="make"): elif output_format == "cmake": format = "CMake" with open(macros_file, "w") as macros: - write_macros_file_v2(format, self._root, macros) + self._write_macros_file_v2(format, macros) + + def _write_macros_file_v2(self, build_system, output): + """Write a Macros file for this machine. + + Arguments: + build_system - Format of the file to be written. Currently the only + valid values are "Makefile" and "CMake". + output - Text I/O object (inheriting from io.TextIOBase) that + output should be written to. Typically, this will be the + Macros file, opened for writing. + """ + # Set up writer for this build system. + if build_system == "Makefile": + writer = MakeMacroWriter(output) + elif build_system == "CMake": + writer = CMakeMacroWriter(output) + else: + expect(False, + "Unrecognized build system provided to write_macros: " + + build_system) + + # Start processing the file. + value_lists = dict() + for compiler_elem in self.get_nodes("compiler"): + block = CompilerBlock(writer, compiler_elem, self._machobj) + # If this block matches machine settings, use it. + if block.matches_machine(): + block.add_settings_to_lists(self.flag_vars, value_lists) + + # Now that we've scanned through the input, output the variable + # settings. + vars_written = set() + while value_lists: + # Variables that are ready to be written. + ready_variables = [ + var_name for var_name in value_lists.keys() + if value_lists[var_name].depends <= vars_written + ] + expect(len(ready_variables) > 0, + "The config_build XML has bad references. " + "Check for circular references or variables that " + "are in a tag but not actually defined.") + big_normal_tree = None + big_append_tree = None + for var_name in ready_variables: + # Note that we're writing this variable. + vars_written.add(var_name) + # Make the conditional trees and write them out. + normal_tree, append_tree = \ + value_lists[var_name].to_cond_trees() + big_normal_tree = merge_optional_trees(normal_tree, + big_normal_tree) + big_append_tree = merge_optional_trees(append_tree, + big_append_tree) + # Remove this variable from the list of variables to handle + # next iteration. + del value_lists[var_name] + if big_normal_tree is not None: + big_normal_tree.write_out(writer) + if big_append_tree is not None: + big_append_tree.write_out(writer) + + def _add_to_macros(node, macros): for child in node: diff --git a/utils/python/CIME/case_setup.py b/utils/python/CIME/case_setup.py index c763940d3b8..6c4f8e256d5 100644 --- a/utils/python/CIME/case_setup.py +++ b/utils/python/CIME/case_setup.py @@ -153,6 +153,8 @@ def _case_setup_impl(case, caseroot, clean=False, test_mode=False, reset=False): sysos = case.get_value("OS") expect(mach is not None, "xml variable MACH is not set") + # creates the Macros.make, Depends.compiler, Depends.machine, Depends.machine.compiler + # and env_mach_specific.xml if they don't already exist. configure(Machines(machine=mach), caseroot, ["Makefile"], compiler, mpilib, debug, sysos) # Set tasks to 1 if mpi-serial library From 999ca40146fd9798de6db76d8556073095e7237c Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 22 Nov 2016 09:41:08 -0700 Subject: [PATCH 06/20] fix tests --- utils/python/CIME/BuildTools/configure.py | 7 +++--- utils/python/CIME/XML/compilers.py | 18 ++++++++++----- .../python/tests/scripts_regression_tests.py | 23 ++++++++++++++----- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/utils/python/CIME/BuildTools/configure.py b/utils/python/CIME/BuildTools/configure.py index d5406f8519f..359df7cda12 100644 --- a/utils/python/CIME/BuildTools/configure.py +++ b/utils/python/CIME/BuildTools/configure.py @@ -19,9 +19,7 @@ from CIME.XML.standard_module_setup import * from CIME.utils import expect from CIME.XML.compilers import Compilers -from CIME.XML.files import Files from CIME.XML.env_mach_specific import EnvMachSpecific -from CIME.XML.machines import Machines logger = logging.getLogger(__name__) @@ -45,7 +43,8 @@ def configure(machobj, output_dir, macros_format, compiler, mpilib, debug, sysos macro_maker.write_macros_file(macros_file=out_file_name, output_format=suffixes[form]) _copy_depends_files(machobj.get_machine_name(), machobj.machines_dir, output_dir, compiler) - _generate_env_mach_specific(output_dir, compiler, mpilib, debug, sysos) + _generate_env_mach_specific(output_dir, machobj, compiler, mpilib, + debug, sysos) def _copy_depends_files(machine_name, machines_dir, output_dir, compiler): """ @@ -61,7 +60,7 @@ def _copy_depends_files(machine_name, machines_dir, output_dir, compiler): if os.path.isfile(dfile) and not os.path.isfile(outputdfile): shutil.copyfile(dfile, outputdfile) -def _generate_env_mach_specific(output_dir, compiler, mpilib, debug, sysos): +def _generate_env_mach_specific(output_dir, machobj, compiler, mpilib, debug, sysos): """ env_mach_specific generation. """ diff --git a/utils/python/CIME/XML/compilers.py b/utils/python/CIME/XML/compilers.py index 2779b15d496..993fc341fc5 100644 --- a/utils/python/CIME/XML/compilers.py +++ b/utils/python/CIME/XML/compilers.py @@ -133,7 +133,7 @@ def get_value(self, name, attribute=None, resolved=True, subgroup=None): return value - def write_macros_file(self, macros_file="Macros", output_format="make"): + def write_macros_file(self, macros_file="Macros", output_format="make", xml=None): if self._version == "1.0": # Parse the xml settings into the $macros hash structure # put conditional settings in the _COND_ portion of the hash @@ -148,13 +148,16 @@ def write_macros_file(self, macros_file="Macros", output_format="make"): output_format) else: if output_format == "make": - format = "Makefile" + format_ = "Makefile" elif output_format == "cmake": - format = "CMake" + format_ = "CMake" + if isinstance(macros_file, basestring): with open(macros_file, "w") as macros: - self._write_macros_file_v2(format, macros) + self._write_macros_file_v2(format_, macros) + else: + self._write_macros_file_v2(format_, macros_file, xml) - def _write_macros_file_v2(self, build_system, output): + def _write_macros_file_v2(self, build_system, output, xml=None): """Write a Macros file for this machine. Arguments: @@ -176,12 +179,15 @@ def _write_macros_file_v2(self, build_system, output): # Start processing the file. value_lists = dict() + if xml is None: + node_list = self.get_nodes("compiler") + else: + node_list = ET.parse(xml).findall("compiler") for compiler_elem in self.get_nodes("compiler"): block = CompilerBlock(writer, compiler_elem, self._machobj) # If this block matches machine settings, use it. if block.matches_machine(): block.add_settings_to_lists(self.flag_vars, value_lists) - # Now that we've scanned through the input, output the variable # settings. vars_written = set() diff --git a/utils/python/tests/scripts_regression_tests.py b/utils/python/tests/scripts_regression_tests.py index 1e59da5a9f7..63a099ada86 100755 --- a/utils/python/tests/scripts_regression_tests.py +++ b/utils/python/tests/scripts_regression_tests.py @@ -15,7 +15,7 @@ import update_acme_tests import CIME.test_scheduler, CIME.wait_for_tests from CIME.test_scheduler import TestScheduler -from CIME.XML.build import Build +from CIME.XML.compilers import Compilers from CIME.XML.machines import Machines from CIME.XML.files import Files from CIME.case import Case @@ -1252,6 +1252,12 @@ def is_valid_MPIlib(self, _): """Assume all MPILIB settings are valid.""" return True + def get_default_MPIlib(self): + return "mpich2" + + def get_default_compiler(self): + return "intel" + def get_macros(macro_maker, build_xml, build_system): """Generate build system ("Macros" file) output from config_build XML. @@ -1267,7 +1273,12 @@ def get_macros(macro_maker, build_xml, build_system): # we need to wrap the strings in StringIO objects. xml = io.StringIO(unicode(build_xml)) output = io.StringIO() - macro_maker.write_macros(build_system, xml, output) + if build_system == "Makefile": + output_format = "make" + else: + output_format = "cmake" + macro_maker.write_macros_file(macros_file=output, + output_format=output_format, xml=xml) return str(output.getvalue()) @@ -1488,19 +1499,19 @@ class G_TestMacrosBasic(unittest.TestCase): def test_script_is_callable(self): """The test script can be called on valid output without dying.""" # This is really more a smoke test of this script than anything else. - maker = Build(MockMachines("mymachine", "SomeOS")) + maker = Compilers(MockMachines("mymachine", "SomeOS")) test_xml = _wrap_config_build_xml("FALSE") get_macros(maker, test_xml, "Makefile") def test_script_rejects_bad_xml(self): """The macro writer rejects input that's not valid XML.""" - maker = Build(MockMachines("mymachine", "SomeOS")) + maker = Compilers(MockMachines("mymachine", "SomeOS")) with self.assertRaises(ParseError): get_macros(maker, "This is not valid XML.", "Makefile") def test_script_rejects_bad_build_system(self): """The macro writer rejects a bad build system string.""" - maker = Build(MockMachines("mymachine", "SomeOS")) + maker = Compilers(MockMachines("mymachine", "SomeOS")) bad_string = "argle-bargle." with self.assertRaisesRegexp( SystemExit, @@ -1524,7 +1535,7 @@ class H_TestMakeMacros(unittest.TestCase): test_machine = "mymachine" def setUp(self): - self._maker = Build(MockMachines(self.test_machine, self.test_os)) + self._maker = Compilers(MockMachines(self.test_machine, self.test_os)) def xml_to_tester(self, xml_string): """Helper that directly converts an XML string to a MakefileTester.""" From a4e0e0cc714b581334e7a43284da70b9d6149022 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 22 Nov 2016 14:45:42 -0700 Subject: [PATCH 07/20] fix unit tests --- utils/python/CIME/XML/compilers.py | 17 +++++++++++------ utils/python/tests/scripts_regression_tests.py | 6 +++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/utils/python/CIME/XML/compilers.py b/utils/python/CIME/XML/compilers.py index 993fc341fc5..19a603b1dd9 100644 --- a/utils/python/CIME/XML/compilers.py +++ b/utils/python/CIME/XML/compilers.py @@ -151,11 +151,14 @@ def write_macros_file(self, macros_file="Macros", output_format="make", xml=None format_ = "Makefile" elif output_format == "cmake": format_ = "CMake" - if isinstance(macros_file, basestring): - with open(macros_file, "w") as macros: - self._write_macros_file_v2(format_, macros) - else: - self._write_macros_file_v2(format_, macros_file, xml) + else: + format_ = output_format + + if isinstance(macros_file, basestring): + with open(macros_file, "w") as macros: + self._write_macros_file_v2(format_, macros) + else: + self._write_macros_file_v2(format_, macros_file, xml) def _write_macros_file_v2(self, build_system, output, xml=None): """Write a Macros file for this machine. @@ -179,11 +182,13 @@ def _write_macros_file_v2(self, build_system, output, xml=None): # Start processing the file. value_lists = dict() + node_list = [] if xml is None: node_list = self.get_nodes("compiler") else: node_list = ET.parse(xml).findall("compiler") - for compiler_elem in self.get_nodes("compiler"): + + for compiler_elem in node_list: block = CompilerBlock(writer, compiler_elem, self._machobj) # If this block matches machine settings, use it. if block.matches_machine(): diff --git a/utils/python/tests/scripts_regression_tests.py b/utils/python/tests/scripts_regression_tests.py index 63a099ada86..6938b844ab7 100755 --- a/utils/python/tests/scripts_regression_tests.py +++ b/utils/python/tests/scripts_regression_tests.py @@ -1273,10 +1273,14 @@ def get_macros(macro_maker, build_xml, build_system): # we need to wrap the strings in StringIO objects. xml = io.StringIO(unicode(build_xml)) output = io.StringIO() + output_format = None if build_system == "Makefile": output_format = "make" - else: + elif build_system == "CMake": output_format = "cmake" + else: + output_format = build_system + macro_maker.write_macros_file(macros_file=output, output_format=output_format, xml=xml) return str(output.getvalue()) From f117402c0ecb6767e6c8ddf9a582e3a41b9d3e2d Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 22 Nov 2016 16:36:44 -0700 Subject: [PATCH 08/20] rearrange some files --- cime_config/acme/config_files.xml | 9 +- cime_config/acme/machines/config_build.xml | 1625 ----------- .../acme/machines/config_compilers.xml | 2469 ++++++++++------- cime_config/cesm/config_files.xml | 4 +- cime_config/cesm/machines/config_build.xml | 1370 --------- .../cesm/machines/config_compilers.xml | 1943 +++++++------ ...nfig_build.xsd => config_compilers_v2.xsd} | 0 7 files changed, 2558 insertions(+), 4862 deletions(-) delete mode 100644 cime_config/acme/machines/config_build.xml delete mode 100644 cime_config/cesm/machines/config_build.xml rename cime_config/xml_schemas/{config_build.xsd => config_compilers_v2.xsd} (100%) diff --git a/cime_config/acme/config_files.xml b/cime_config/acme/config_files.xml index 139fef06fb0..932deb21c7e 100644 --- a/cime_config/acme/config_files.xml +++ b/cime_config/acme/config_files.xml @@ -38,6 +38,7 @@ case_last env_case.xml file containing compiler specifications for target model primary component (for documentation only - DO NOT EDIT) + $CIMEROOT/cime_config/xml_schemas/config_compilers_v2.xsd @@ -48,14 +49,6 @@ file containing machine specifications for target model primary component (for documentation only - DO NOT EDIT) - - char - $CIMEROOT/cime_config/$MODEL/machines/config_build.xml - case_last - env_case.xml - file containing build specifications for target model primary component (for documentation only - DO NOT EDIT) - - char $CIMEROOT/cime_config/$MODEL/machines/config_pio.xml diff --git a/cime_config/acme/machines/config_build.xml b/cime_config/acme/machines/config_build.xml deleted file mode 100644 index d48e46f2db9..00000000000 --- a/cime_config/acme/machines/config_build.xml +++ /dev/null @@ -1,1625 +0,0 @@ - - - - - - - -D_USE_FLOW_CONTROL - - FALSE - - - - - -h noomp - - - - -DFORTRANUNDERSCORE -DNO_R16 - -DDIR=NOOP - -DDIR=NOOP - - - -s real64 - - - -O2 -f free -N 255 -h byteswapio -em - -h noomp - -g -trapuv -Wuninitialized - - - -O0 - -h noomp - - TRUE - - -Wl,--allow-multiple-definition -h byteswapio - -h noomp - - - - - - -mcmodel=medium - -fopenmp - -g -Wall - -O - - - -D CISM_GNU=ON - - - - -DFORTRANUNDERSCORE -DNO_R16 - - FORTRAN - - -fdefault-real-8 - - - - -mcmodel=medium -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none - -fopenmp - -g -Wall - -O - - - -O0 - - - -ffixed-form - - - -ffree-form - - FALSE - - -fopenmp - - mpicc - mpicxx - mpif90 - gcc - g++ - gfortran - TRUE - - - - - -g -qfullpath -qmaxmem=-1 - -O3 - -qsmp=omp:nested_par - -qsmp=omp:nested_par:noopt - - - - -DFORTRAN_SAME - - -WF,-D - - -qrealsize=8 - - - -g -qfullpath -qmaxmem=-1 - -O2 -qstrict -Q - -qsmp=omp:nested_par - -qsmp=omp:nested_par:noopt - -qinitauto=7FF7FFFF -qflttrap=ov:zero:inv:en - -C - - - -qsuffix=f=f -qfixed=132 - - - -qsuffix=f=f90:cpp=F90 - - TRUE - - - - - -O2 -fp-model precise -std=gnu99 - -openmp - -O2 -debug minimal - -O0 -g - - - - -DFORTRANUNDERSCORE -DNO_R16 - - - -cxxlib - - FORTRAN - - -r8 - - - -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source - -openmp - - -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created - -O2 -debug minimal - - - -O0 - -openmp - - - -fixed -132 - - - -free - - TRUE - - -openmp - - mpicc - mpicxx - mpif90 - icc - icpc - ifort - TRUE - - - - - -O2 -fp-model precise - -openmp - - - - -DFORTRANUNDERSCORE -DNO_R16 - -DCPRINTEL - - - -cxxlib - - FORTRAN - - -r8 - - - -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs - -openmp - -O0 -g -check uninit -check bounds -check pointers -fpe0 - -O2 - - - -O0 - - - -fixed -132 - - - -free - - TRUE - - -openmp - - mpicc - mpicxx - mpif90 - icc - icpc - ifort - - NETCDF_PATH/bin/nf-config --flibs - - TRUE - - - - - -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR - -openmp - - - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - - - - -DFORTRANUNDERSCORE -DNO_R16 - -DCPRINTEL - - - -cxxlib - - FORTRAN - - -r8 - - - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs - -openmp - -O0 -g -check uninit -check bounds -check pointers -fpe0 - -O2 - - - -O0 -mmic - - - -fixed -132 - - - -free - - TRUE - - -openmp - -mmic - - mpiicc - mpiicpc - mpiifort - icc - icpc - ifort - - NETCDF_PATH/bin/nf-config --flibs - - TRUE - - - - - -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR - -openmp - - - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - - - - -DFORTRANUNDERSCORE -DNO_R16 - -DCPRINTEL - - - -cxxlib - - FORTRAN - - -r8 - - - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs - -openmp - -O0 -g -check uninit -check bounds -check pointers -fpe0 - -O2 - - - -O0 -mmic - - - -fixed -132 - - - -free - - TRUE - - -openmp - -mmic - - mpiicc - mpiicpc - mpiifort - icc - icpc - ifort - - NETCDF_PATH/bin/nf-config --flibs - - TRUE - - - - - -g - - - -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH - - - -r8 - - - - - - - - -wmismatch=mpi_send,mpi_recv,mpi_bcast,mpi_allreduce,mpi_reduce,mpi_isend,mpi_irecv,mpi_irsend,mpi_rsend,mpi_gatherv,mpi_gather,mpi_scatterv,mpi_allgather,mpi_alltoallv,mpi_file_read_all,mpi_file_write_all,mpibcast,mpiscatterv,mpi_alltoallw,nfmpi_get_vara_all,NFMPI_IPUT_VARA,NFMPI_GET_VAR_ALL,NFMPI_PUT_VARA,NFMPI_PUT_ATT_REAL,NFMPI_PUT_ATT_DOUBLE,NFMPI_PUT_ATT_INT,NFMPI_GET_ATT_REAL,NFMPI_GET_ATT_INT,NFMPI_GET_ATT_DOUBLE,NFMPI_PUT_VARA_DOUBLE_ALL,NFMPI_PUT_VARA_REAL_ALL,NFMPI_PUT_VARA_INT_ALL -convert=BIG_ENDIAN - - -ieee=full -O2 - -g -time -f2003 -ieee=stop - - - -C=all -g -time -f2003 -ieee=stop - -gline - -openmp - - - FFLAGS - -ieee=full - - - - -g -time -f2003 -ieee=stop - -gline - -openmp - - - -fixed - - - -free - - FALSE - - -openmp - - mpicc - mpif90 - gcc - nagfor - - - - - -mp - - - - -DFORTRANUNDERSCORE -DNO_R16 -DCPRPATHSCALE - - - -r8 - - - -O -extend_source -ftpp -fno-second-underscore -funderscoring -byteswapio - -mp - -g -trapuv -Wuninitialized - - - -O0 - - FALSE - - -mp - - mpicc - mpif90 - - - - - -gopt -Mlist -time - - -mp - - - - - - - - - - - - - - - - - - - - - - - - - - - - -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 - - CXX - - -r8 - - - -i4 -gopt -time -Mextend -byteswapio -Mflushz -Kieee - - -mp - -O0 -g -Ktrap=fp -Mbounds -Kieee - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - - - -O0 -g -Ktrap=fp -Mbounds -Kieee - - -mp - - - -Mfixed - - - -Mfree - - - - FALSE - - -time -Wl,--allow-multiple-definition - - -mp - - mpicc - mpicxx - mpif90 - pgcc - pgc++ - pgf95 - - - - - -Mlist -time - - -mp - - - - - - - - - - - - - - - - - - - - - - - - - - - - -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 -DUSE_CUDA_FORTRAN -DCPRPGI - - CXX - - -r8 - - - -i4 -Mlist -time -Mextend -byteswapio -Mflushz -Kieee - - -mp - -acc -ta=tesla,pin,cuda7.0,cc35,ptxinfo -Minfo=accel -DUSE_OPENACC=1 - -O0 -g -Ktrap=fp -Mbounds -Kieee - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - - - -O0 -g -Ktrap=fp -Mbounds -Kieee - - -mp - - - -Mfixed - - - -Mfree - - - - FALSE - - -time -Wl,--allow-multiple-definition -acc -ta=tesla,pin,cuda7.0,cc35,ptxinfo - - -mp - - mpicc - mpicxx - mpif90 - pgcc - pgc++ - pgf95 - - - - - -qarch=auto -qtune=auto -qcache=auto - - /usr/bin/bash - - -qarch=auto -qtune=auto -qcache=auto -qsclk=micro - -qspill=6000 - - - -qsigtrap=xl__trcedump - -bdatapsize:64K -bstackpsize:64K -btextpsize:32K - - mpcc_r - mpxlf2003_r - cc_r - xlf2003_r - - -lmassv -lessl - -lmass - - - - - - -O3 -qstrict - -qtune=440 -qarch=440d - - - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - - - -DLINUX -DnoI8 - - - -qtune=440 -qarch=440d - -O3 -qstrict -Q - -qinitauto=FF911299 -qflttrap=ov:zero:inv:en - -qextname=flush - - - -Wl,--relax -Wl,--allow-multiple-definition - - - -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts - - blrts_xlc - blrts_xlf2003 - mpich.rts - /bgl/BlueLight/ppcfloor/bglsys - blrts_xlc - blrts_xlf2003 - - - - - -qtune=450 -qarch=450 -I/bgsys/drivers/ppcfloor/arch/include/ - - - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - - - -DLINUX -DnoI8 - - - -qspillsize=2500 -qtune=450 -qarch=450 - -qextname=flush - - - -Wl,--relax -Wl,--allow-multiple-definition - - - - - - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - - - -DLINUX - - - -g -qfullpath -qmaxmem=-1 -qspillsize=2500 -qextname=flush - -O3 -qstrict -Q - - - -Wl,--relax -Wl,--allow-multiple-definition - - - - - - -DCMAKE_SYSTEM_NAME=Catamount - - - -DLINUX - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - - cc - CC - ftn - mpich - MPICH_DIR - NETCDF_DIR - lustre - PARALLEL_NETCDF_DIR - cc - CC - ftn - - - - - -DSYSDARWIN - - - -all_load - - - - - - -heap-arrays - - - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - - - -mcmodel medium -shared-intel - - - - - /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install - - -O2 - - - --host=Linux - - - -lstdc++ -lmpi_cxx - - - -O2 - - NETCDFROOT - PNETCDFROOT - - NETCDF_PATH/bin/nf-config --flibs -lblas -llapack - - - - - mpi - /soft/mvapich2/2.2b_psm/gnu-5.2/ - NETCDFROOT - gpfs - PNETCDFROOT - - NETCDF_PATH/bin/nc-config --flibs -llapack -lblas - - - - - mpi - /soft/mvapich2/2.2b_psm/intel-15.0 - NETCDFROOT - gpfs - PNETCDFROOT - - NETCDF_PATH/bin/nc-config --flibs -llapack -lblas - -Wl,-rpath -Wl,NETCDFROOT/lib - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - - mpi - mpich - /soft/openmpi/1.8.2/intel-13.1 - /soft/mpich2/1.4.1-intel-13.1 - NETCDFROOT - gpfs - PNETCDFROOT - - NETCDF_PATH/bin/nc-config --flibs -llapack -lblas - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - - mpi - /home/robl/soft/mpich-3.1.4-nag-6.0 - NETCDFROOT - gpfs - PNETCDFROOT - - NETCDF_PATH/bin/nc-config --flibs -llapack -lblas - - - - - mpi - mpi - mpich - /soft/openmpi/1.8.2/pgi-13.9 - /soft/mpich2/1.4.1-pgi-13.9/ - NETCDFROOT - gpfs - PNETCDFROOT - - NETCDF_PATH/bin/nc-config --flibs -llapack -lblas - -rpath NETCDFROOT/lib - - - - - - - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - - NETCDF - gpfs - PNETCDF - - - - - --host=Linux --enable-filesystem-hints=lustre - - - -DLINUX - - - -g -traceback -O0 -fpe0 -check all -check noarg_temp_created -ftrapuv - - NETCDF_LIB/.. - lustre - PNETCDFROOT - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi -LMKL_PATH -lmkl_rt - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - - - -DnoI8 - - - - -gline -C=all -g -O0 -v - -gline -C=all -g -nan -O0 -v - - - - - MPI_LIB - NETCDF_ROOT - lustre - PNETCDFROOT - - -LNETCDF_ROOT/lib -lnetcdf -lnetcdff -LMKL_PATH -lmkl_rt - - - - - /projects/ccsm/libs/AlbanyTrilinos/Albany/build/install - - -DMPASLI_EXTERNAL_INTERFACE_DISABLE_MANGLING - - - -llapack -lblas -LIBM_MAIN_DIR/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -LIBM_MAIN_DIR/xlsmp/bg/3.1/bglib64 -lxlsmp - - CXX - - -L/soft/libraries/hdf5/1.8.10/cnk-xl/current/lib -lhdf5 -lhdf5_hl - - mpixlc_r - /soft/compilers/bgclang/mpi/bgclang/bin/mpic++11 - mpixlf2003_r - /soft/libraries/netcdf/4.3.0-f4.2/cnk-xl/V1R2M0-20131211/ - /soft/libraries/petsc/3.5.3.1 - /home/santos/pFUnit/pFUnit_IBM - gpfs - /soft/libraries/pnetcdf/1.3.1/cnk-xl/current/ - mpixlc_r - mpixlf2003_r - - -LNETCDF_PATH/lib -lnetcdff -lnetcdf -L/soft/libraries/hdf5/1.8.10/cnk-xl/current/lib -lhdf5 -lhdf5_hl -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib - -LIBM_MAIN_DIR/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -LIBM_MAIN_DIR/xlsmp/bg/3.1/bglib64 -lxlsmp - - TRUE - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - -g -traceback -O0 -fpe0 -check all -check noarg_temp_created -ftrapuv - - NETCDF_HOME - lustre - PNETCDFROOT - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi -LMKL_PATH -lmkl_rt - - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - -C -Mbounds -traceback -Mchkfpstk -Mchkstk -Mdalign -Mdepchk -Mextend -Miomutex -Mrecursive -Ktrap=fp -O0 -g -byteswapio -Meh_frame - - NETCDF_HOME - lustre - PNETCDFROOT - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi -LMPI_LIB -lmpich - - - - - - -xCORE-AVX2 - -O2 - - - --host=Linux - - - -DHAVE_SLASHPROC - -DHAVE_PAPI - - - -xCORE-AVX2 - -O2 - - cc - CC - ftn - PETSC_DIR - - -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf - MKLROOT/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group MKLROOT/lib/intel64/libmkl_intel_lp64.a MKLROOT/lib/intel64/libmkl_core.a MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group MKLROOT/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm - - - - - - -xMIC-AVX512 - -O2 - - - --host=Linux - - - -DHAVE_SLASHPROC - -DHAVE_PAPI - - - -xMIC-AVX512 - -O2 - - cc - CC - ftn - PETSC_DIR - - -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf - MKLROOT/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group MKLROOT/lib/intel64/libmkl_intel_lp64.a MKLROOT/lib/intel64/libmkl_core.a MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group MKLROOT/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm - - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - - NETCDF_HOME - lustre - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi - - - - - /global/project/projectdirs/acme/software/AlbanyTrilinos_09232015/Albany/build/install - - -O2 - - - --host=Linux - - - -DHAVE_PAPI - - - -O2 - - cc - CC - ftn - PETSC_DIR - - -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf - MKLROOT/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group MKLROOT/lib/intel64/libmkl_intel_lp64.a MKLROOT/lib/intel64/libmkl_core.a MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group MKLROOT/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm - - - - - - -O2 - - - --host=Linux - - - -DHAVE_PAPI - - - -O2 - - cc - CC - ftn - - -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf - MKLROOT/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group MKLROOT/lib/intel64/libmkl_intel_lp64.a MKLROOT/lib/intel64/libmkl_core.a MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group MKLROOT/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm - - - - - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-gnu/install - - - - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libO/Unicos.intel.64.mpi.default/ - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libg/Unicos.intel.64.mpi.default/ - - NETCDF_PATH/bin/nf-config --flibs - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - - - -O2 - - - -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o - - - -O2 - - TRUE - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-pgi/install - - - - - -DHAVE_VPRINTF -DHAVE_GETTIMEOFDAY - - - -lnetcdff -lnetcdf -mkl - - - - - - -DHAVE_VPRINTF -DHAVE_GETTIMEOFDAY - - - -lnetcdff -lnetcdf -mkl - - - - - NETCDF_PATH - PNETCDF_PATH - - NETCDF_PATH/bin/nc-config --flibs - - - - - - -framework Accelerate - - NETCDF_PATH - - -LNETCDF_PATH/lib -lnetcdff -lnetcdf - - - - - /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install - - -O2 - - - --host=Linux - - - -lstdc++ -lmpi_cxx - - - -O2 - - NETCDFROOT - PNETCDFROOT - - NETCDF_PATH/bin/nf-config --flibs -lblas -llapack - - - - - /projects/ccsm/libs/AlbanyTrilinos/Albany/build/install - - -DMPASLI_EXTERNAL_INTERFACE_DISABLE_MANGLING - - - -llapack -lblas -LIBM_MAIN_DIR/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -LIBM_MAIN_DIR/xlsmp/bg/3.1/bglib64 -lxlsmp - - CXX - /soft/libraries/hdf5/1.8.14/cnk-xl/current/ - - - mpixlf77_r - mpixlc_r - /soft/compilers/bgclang/mpi/bgclang/bin/mpic++11 - mpixlf2003_r - /soft/libraries/netcdf/4.3.3-f4.4.1/cnk-xl/current/ - /soft/libraries/petsc/3.5.3.1 - /home/santos/pFUnit/pFUnit_IBM - gpfs - /soft/libraries/pnetcdf/1.6.0/cnk-xl/current/ - mpixlc_r - mpixlf2003_r - - -LNETCDF_PATH/lib -lnetcdff -lnetcdf -L/soft/libraries/hdf5/1.8.14/cnk-xl/current/lib -lhdf5_hl -lhdf5 -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib - -LIBM_MAIN_DIR/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -LIBM_MAIN_DIR/xlsmp/bg/3.1/bglib64 -lxlsmp - - TRUE - - - - ALBANY_PATH - - -lstdc++ -lmpi_cxx - - mpicc - mpic++ - mpif90 - gcc - g++ - gfortran - - NETCDF_PATH/bin/nf-config --flibs -llapack -lblas - - TRILINOS_PATH - - - - mpicc - mpic++ - mpif90 - icc - icpc - ifort - - NETCDF_PATH/bin/nf-config --flibs -llapack -lblas - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - TRILINOS_PATH - - - - mpicc - mpic++ - mpif90 - pgcc - pgc++ - pgfortran - - NETCDF_PATH/bin/nf-config --flibs -llapack -lblas - - TRILINOS_PATH - - - - /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpicc - /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpif90 - /projects/cesm/devtools/netcdf-4.1.3-gcc4.8.1-mpich3.0.4/ - /projects/cesm/devtools/gcc-4.8.1/bin/gcc - /projects/cesm/devtools/gcc-4.8.1/bin/g++ - /projects/cesm/devtools/gcc-4.8.1/bin/gfortran - - -L/user/lib64 -llapack -lblas -lnetcdff - - - - - /home/zdr/opt/netcdf-4.1.3_pgf95 - - - - /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpicc - /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpif90 - /projects/cesm/devtools/netcdf-4.1.3-gcc4.8.1-mpich3.0.4/ - /projects/cesm/devtools/gcc-4.8.1/bin/gcc - /projects/cesm/devtools/gcc-4.8.1/bin/g++ - /projects/cesm/devtools/gcc-4.8.1/bin/gfortran - - -L/user/lib64 -llapack -lblas -lnetcdff - - - - - /home/zdr/opt/netcdf-4.1.3_pgf95 - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - - NETCDF_LIB/.. - lustre - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi - - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - - NETCDF_LIB/.. - lustre - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi - - - - - /projects/ccsm/AlbanyTrilinos/Albany/build/install - - -O2 - - - --host=Linux - - /projects/ccsm/esmf-6.3.0rp1/lib/libO/Linux.intel.64.openmpi.default - - -O2 - - NETCDFROOT - lustre - PNETCDFROOT - - NETCDF_PATH/bin/nf-config --flibs -L/projects/ccsm/BLAS-intel -lblas_LINUX - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - - /projects/ccsm/AlbanyTrilinos/Albany/build/install - - -O2 - - - --host=Linux - - /projects/ccsm/esmf-6.3.0rp1/lib/libO/Linux.intel.64.openmpi.default - - -O2 - - NETCDFROOT - lustre - PNETCDFROOT - - NETCDF_PATH/bin/nf-config --flibs -L/projects/ccsm/BLAS-intel -lblas_LINUX - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - - NETCDF - lustre - - -LNETCDF_PATH/lib -lnetcdf -lpmi - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - - NETCDF_LIB/.. - lustre - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi - - - - - - -O2 - - - --host=Linux - - - -O2 - - lustre - - NETCDF_PATH/bin/nf-config --flibs - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - TRUE - - - - /ccs/proj/cli106/AlbanyTrilinos/Albany/build/install - - -O2 - - - --host=Linux - - - -lfmpich -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o /opt/gcc/default/snos/lib64/libstdc++.a - - - -O2 - - cc - /opt/cray/craype/2.4.0/bin/CC - ftn - lustre - - nf-config --flibs - - TRUE - /lustre/atlas/world-shared/cli900/cesm/software/Trilinos/Trilinos-11.10.2_gptl/titan-pgi-ci-nophal/install - - - - - -O2 - - - --host=Linux - - - -lfmpich -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o - - - -O2 - - lustre - - NETCDF_PATH/bin/nf-config --flibs - - TRUE - - - - - - - - - - - - - USERDEFINED_MUST_EDIT_THIS - - - # USERDEFINED NETCDF_PATH/bin/nc-config --flibs - - - - - ALBANY_PATH - - -lstdc++ -lmpi_cxx - - mpicc - mpic++ - mpif90 - gcc - g++ - gfortran - - NETCDF_PATH/bin/nf-config --flibs -llapack -lblas - - TRILINOS_PATH - - - - mpicc - mpic++ - mpif90 - icc - icpc - ifort - - NETCDF_PATH/bin/nf-config --flibs -llapack -lblas - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - TRILINOS_PATH - - - - mpicc - mpic++ - mpif90 - pgcc - pgc++ - pgfortran - - NETCDF_PATH/bin/nf-config --flibs -llapack -lblas - - TRILINOS_PATH - - - diff --git a/cime_config/acme/machines/config_compilers.xml b/cime_config/acme/machines/config_compilers.xml index d649fe2a9cd..d48e46f2db9 100644 --- a/cime_config/acme/machines/config_compilers.xml +++ b/cime_config/acme/machines/config_compilers.xml @@ -1,6 +1,5 @@ - - - + + + + -D_USE_FLOW_CONTROL + FALSE - -D_USE_FLOW_CONTROL + + + + + -h noomp + + + + -DFORTRANUNDERSCORE -DNO_R16 + -DDIR=NOOP + -DDIR=NOOP + + + -s real64 + + + -O2 -f free -N 255 -h byteswapio -em + -h noomp + -g -trapuv -Wuninitialized + + + -O0 + -h noomp + + TRUE + + -Wl,--allow-multiple-definition -h byteswapio + -h noomp + + + + + + -mcmodel=medium + -fopenmp + -g -Wall + -O + + + -D CISM_GNU=ON + + + + -DFORTRANUNDERSCORE -DNO_R16 + + FORTRAN + + -fdefault-real-8 + + + + -mcmodel=medium -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none + -fopenmp + -g -Wall + -O + + + -O0 + + + -ffixed-form + + + -ffree-form + + FALSE + + -fopenmp + + mpicc + mpicxx + mpif90 + gcc + g++ + gfortran + TRUE - - -DFORTRAN_SAME + -DFORTRAN_SAME + -WF,-D - -g -qfullpath -qmaxmem=-1 - -qsuffix=f=f -qfixed=132 - -qsuffix=f=f90:cpp=F90 - -g -qfullpath -qmaxmem=-1 - -qrealsize=8 - -O2 -qstrict -Q - -O3 - -qsmp=omp:nested_par - -qsmp=omp:nested_par - -qsmp=omp:nested_par:noopt - -qsmp=omp:nested_par:noopt - -qinitauto=7FF7FFFF -qflttrap=ov:zero:inv:en - -C + + -qrealsize=8 + + + -g -qfullpath -qmaxmem=-1 + -O2 -qstrict -Q + -qsmp=omp:nested_par + -qsmp=omp:nested_par:noopt + -qinitauto=7FF7FFFF -qflttrap=ov:zero:inv:en + -C + + + -qsuffix=f=f -qfixed=132 + + + -qsuffix=f=f90:cpp=F90 + TRUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 - -gopt -Mlist -time - - - - - -mp - -mp - -mp - - -Mfixed - -Mfree - -r8 - - -i4 -gopt -time -Mstack_arrays -Mextend -byteswapio -Mflushz -Kieee - -O0 -g -Ktrap=fp -Mbounds -Kieee - - -mp - - -O0 -g -Ktrap=fp -Mbounds -Kieee - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -time -Wl,--allow-multiple-definition - pgcc - pgf95 - pgc++ - mpicc - mpif90 - mpicxx - - CXX - - - - FALSE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 -DUSE_CUDA_FORTRAN -DCPRPGI - -Mlist -time - - - - - -mp - -mp - -mp - - -Mfixed - -Mfree - -r8 - - -i4 -Mlist -time -Mstack_arrays -Mextend -byteswapio -Mflushz -Kieee - -acc -ta=tesla,pin,cuda7.0,cc35,ptxinfo -Minfo=accel -DUSE_OPENACC=1 - -O0 -g -Ktrap=fp -Mbounds -Kieee - - -mp - - -O0 -g -Ktrap=fp -Mbounds -Kieee - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -time -Wl,--allow-multiple-definition -acc -ta=tesla,pin,cuda7.0,cc35,ptxinfo - pgcc - pgf95 - pgc++ - mpicc - mpif90 - mpicxx - - CXX - - - FALSE - - -DFORTRANUNDERSCORE -DNO_R16 - -openmp - -openmp - -openmp - -free - -fixed -132 - + -DFORTRANUNDERSCORE -DNO_R16 + + + -cxxlib + + FORTRAN + + -r8 + + + -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source + -openmp + - -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created - -O2 -debug minimal - -O2 -debug minimal - -O0 -g - -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source - -O2 -fp-model precise -std=gnu99 - -O0 - -openmp - -r8 - ifort - icc - icpc - mpif90 + -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created + -O2 -debug minimal + + + -O0 + -openmp + + + -fixed -132 + + + -free + + TRUE + + -openmp + mpicc mpicxx - FORTRAN - -cxxlib + mpif90 + icc + icpc + ifort TRUE - TRUE - - - - - -mcmodel medium -shared-intel - - -DFORTRANUNDERSCORE -DNO_R16 - -openmp - -openmp - -openmp - -free - -fixed -132 - -O0 -g -check uninit -check bounds -check pointers -fpe0 - -O2 - -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs - -O2 -fp-model precise - -O0 - -r8 - ifort - icc - icpc - mpif90 + + -O2 -fp-model precise + -openmp + + + + -DFORTRANUNDERSCORE -DNO_R16 + -DCPRINTEL + + + -cxxlib + + FORTRAN + + -r8 + + + -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs + -openmp + -O0 -g -check uninit -check bounds -check pointers -fpe0 + -O2 + + + -O0 + + + -fixed -132 + + + -free + + TRUE + + -openmp + mpicc mpicxx - FORTRAN - -cxxlib - -DCPRINTEL + mpif90 + icc + icpc + ifort + + NETCDF_PATH/bin/nf-config --flibs + TRUE - TRUE - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - - -DFORTRANUNDERSCORE -DNO_R16 - -openmp - -openmp - -openmp - -free - -fixed -132 - -O0 -g -check uninit -check bounds -check pointers -fpe0 - -O2 - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs - -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - -O0 -mmic - -r8 - ifort - icc - icpc - mpiifort + + -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR + -openmp + + + --host=x86_64-k1om-linux --build=x86_64-unknown-linux + + + + -DFORTRANUNDERSCORE -DNO_R16 + -DCPRINTEL + + + -cxxlib + + FORTRAN + + -r8 + + + -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs + -openmp + -O0 -g -check uninit -check bounds -check pointers -fpe0 + -O2 + + + -O0 -mmic + + + -fixed -132 + + + -free + + TRUE + + -openmp + -mmic + mpiicc mpiicpc - FORTRAN - -cxxlib + mpiifort + icc + icpc + ifort + + NETCDF_PATH/bin/nf-config --flibs + TRUE - TRUE - -DCPRINTEL - -mmic - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - - -DFORTRANUNDERSCORE -DNO_R16 - -openmp - -openmp - -openmp - -free - -fixed -132 - -O0 -g -check uninit -check bounds -check pointers -fpe0 - -O2 - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs - -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - -O0 -mmic - -r8 - ifort - icc - icpc - mpiifort + + -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR + -openmp + + + --host=x86_64-k1om-linux --build=x86_64-unknown-linux + + + + -DFORTRANUNDERSCORE -DNO_R16 + -DCPRINTEL + + + -cxxlib + + FORTRAN + + -r8 + + + -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs + -openmp + -O0 -g -check uninit -check bounds -check pointers -fpe0 + -O2 + + + -O0 -mmic + + + -fixed -132 + + + -free + + TRUE + + -openmp + -mmic + mpiicc mpiicpc - FORTRAN - -cxxlib + mpiifort + icc + icpc + ifort + + NETCDF_PATH/bin/nf-config --flibs + TRUE - TRUE - -DCPRINTEL - -mmic - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - - - -DFORTRANUNDERSCORE -DNO_R16 - -fopenmp - -fopenmp - -fopenmp - -D CISM_GNU=ON - -ffixed-form - -ffree-form - -g -Wall - -O - -g -Wall - -O - - -mcmodel=medium -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none - -mcmodel=medium - -O0 - -fdefault-real-8 - gfortran - gcc - g++ - mpif90 - mpicc - mpicxx - FORTRAN - TRUE + + + -g + + + -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH + + + -r8 + + + + + + + + -wmismatch=mpi_send,mpi_recv,mpi_bcast,mpi_allreduce,mpi_reduce,mpi_isend,mpi_irecv,mpi_irsend,mpi_rsend,mpi_gatherv,mpi_gather,mpi_scatterv,mpi_allgather,mpi_alltoallv,mpi_file_read_all,mpi_file_write_all,mpibcast,mpiscatterv,mpi_alltoallw,nfmpi_get_vara_all,NFMPI_IPUT_VARA,NFMPI_GET_VAR_ALL,NFMPI_PUT_VARA,NFMPI_PUT_ATT_REAL,NFMPI_PUT_ATT_DOUBLE,NFMPI_PUT_ATT_INT,NFMPI_GET_ATT_REAL,NFMPI_GET_ATT_INT,NFMPI_GET_ATT_DOUBLE,NFMPI_PUT_VARA_DOUBLE_ALL,NFMPI_PUT_VARA_REAL_ALL,NFMPI_PUT_VARA_INT_ALL -convert=BIG_ENDIAN + + -ieee=full -O2 + -g -time -f2003 -ieee=stop + + + -C=all -g -time -f2003 -ieee=stop + -gline + -openmp + + + FFLAGS + -ieee=full + + + + -g -time -f2003 -ieee=stop + -gline + -openmp + + + -fixed + + + -free + FALSE + + -openmp + + mpicc + mpif90 + gcc + nagfor - - -DFORTRANUNDERSCORE -DNO_R16 -DCPRPATHSCALE - -mp - -mp - -mp - -g -trapuv -Wuninitialized - -O -extend_source -ftpp -fno-second-underscore -funderscoring -byteswapio - -O0 - -r8 - mpif90 - mpicc + + -mp + + + + -DFORTRANUNDERSCORE -DNO_R16 -DCPRPATHSCALE + + + -r8 + + + -O -extend_source -ftpp -fno-second-underscore -funderscoring -byteswapio + -mp + -g -trapuv -Wuninitialized + + + -O0 + FALSE - - - - - -DFORTRANUNDERSCORE -DNO_R16 - -DDIR=NOOP - -h noomp - -h noomp - -h noomp - -DDIR=NOOP - -g -trapuv -Wuninitialized - -O2 -f free -N 255 -h byteswapio -em - -O0 - -h noomp - -s real64 - -Wl,--allow-multiple-definition -h byteswapio - TRUE - - - - - - nagfor + + -mp + + mpicc mpif90 - gcc - mpicc + - -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH - - - - - - - -wmismatch=mpi_send,mpi_recv,mpi_bcast,mpi_allreduce,mpi_reduce,mpi_isend,mpi_irecv,mpi_irsend,mpi_rsend,mpi_gatherv,mpi_gather,mpi_scatterv,mpi_allgather,mpi_alltoallv,mpi_file_read_all,mpi_file_write_all,mpibcast,mpiscatterv,mpi_alltoallw,nfmpi_get_vara_all,NFMPI_IPUT_VARA,NFMPI_GET_VAR_ALL,NFMPI_PUT_VARA,NFMPI_PUT_ATT_REAL,NFMPI_PUT_ATT_DOUBLE,NFMPI_PUT_ATT_INT,NFMPI_GET_ATT_REAL,NFMPI_GET_ATT_INT,NFMPI_GET_ATT_DOUBLE,NFMPI_PUT_VARA_DOUBLE_ALL,NFMPI_PUT_VARA_REAL_ALL,NFMPI_PUT_VARA_INT_ALL -convert=BIG_ENDIAN - $(FFLAGS) - - - -ieee=full -O2 - -ieee=full - - -g -time -f2003 -ieee=stop - -g - - - - -C=all -g -time -f2003 -ieee=stop - -gline - - - - -g -time -f2003 -ieee=stop - -gline - - -openmp - -openmp - -openmp - - -r8 - -fixed - -free + + + -gopt -Mlist -time + + -mp + + + + + + + + + + + + + + + + + + + + + + + + + + + + -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 + + CXX + + -r8 + + + -i4 -gopt -time -Mextend -byteswapio -Mflushz -Kieee + + -mp + -O0 -g -Ktrap=fp -Mbounds -Kieee + -Mnovect + -Mnovect + -Mnovect + -Mnovect + -Mnovect + -Mnovect + + + -O0 -g -Ktrap=fp -Mbounds -Kieee + + -mp + + + -Mfixed + + + -Mfree + + + FALSE + + -time -Wl,--allow-multiple-definition + + -mp + + mpicc + mpicxx + mpif90 + pgcc + pgc++ + pgf95 - - -DSYSDARWIN - -all_load + + + -Mlist -time + + -mp + + + + + + + + + + + + + + + + + + + + + + + + + + + + -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 -DUSE_CUDA_FORTRAN -DCPRPGI + + CXX + + -r8 + + + -i4 -Mlist -time -Mextend -byteswapio -Mflushz -Kieee + + -mp + -acc -ta=tesla,pin,cuda7.0,cc35,ptxinfo -Minfo=accel -DUSE_OPENACC=1 + -O0 -g -Ktrap=fp -Mbounds -Kieee + -Mnovect + -Mnovect + -Mnovect + -Mnovect + -Mnovect + -Mnovect + + + -O0 -g -Ktrap=fp -Mbounds -Kieee + + -mp + + + -Mfixed + + + -Mfree + + + + FALSE + + -time -Wl,--allow-multiple-definition -acc -ta=tesla,pin,cuda7.0,cc35,ptxinfo + + -mp + + mpicc + mpicxx + mpif90 + pgcc + pgc++ + pgf95 - - -heap-arrays - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl + + + -qarch=auto -qtune=auto -qcache=auto + + /usr/bin/bash + + -qarch=auto -qtune=auto -qcache=auto -qsclk=micro + -qspill=6000 + + + -qsigtrap=xl__trcedump + -bdatapsize:64K -bstackpsize:64K -btextpsize:32K + + mpcc_r + mpxlf2003_r + cc_r + xlf2003_r + + -lmassv -lessl + -lmass + + + + + + -O3 -qstrict + -qtune=440 -qarch=440d + + + --build=powerpc-bgp-linux --host=powerpc64-suse-linux + + + -DLINUX -DnoI8 + + + -qtune=440 -qarch=440d + -O3 -qstrict -Q + -qinitauto=FF911299 -qflttrap=ov:zero:inv:en + -qextname=flush + + + -Wl,--relax -Wl,--allow-multiple-definition + + + -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts + + blrts_xlc + blrts_xlf2003 + mpich.rts + /bgl/BlueLight/ppcfloor/bglsys + blrts_xlc + blrts_xlf2003 - - USERDEFINED_MUST_EDIT_THIS - - # USERDEFINED $(shell $(NETCDF_PATH)/bin/nc-config --flibs) - - - - - + + + -qtune=450 -qarch=450 -I/bgsys/drivers/ppcfloor/arch/include/ + + + --build=powerpc-bgp-linux --host=powerpc64-suse-linux + + + -DLINUX -DnoI8 + + + -qspillsize=2500 -qtune=450 -qarch=450 + -qextname=flush + + + -Wl,--relax -Wl,--allow-multiple-definition + + + + + + --build=powerpc-bgp-linux --host=powerpc64-suse-linux + + + -DLINUX + + + -g -qfullpath -qmaxmem=-1 -qspillsize=2500 -qextname=flush + -O3 -qstrict -Q + + + -Wl,--relax -Wl,--allow-multiple-definition + - ftn - cc - CC - ftn + + -DCMAKE_SYSTEM_NAME=Catamount + + + -DLINUX + -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + cc CC + ftn mpich - $(MPICH_DIR) - $(NETCDF_DIR) - $(PARALLEL_NETCDF_DIR) + MPICH_DIR + NETCDF_DIR lustre - -DLINUX - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - -DCMAKE_SYSTEM_NAME=Catamount + PARALLEL_NETCDF_DIR + cc + CC + ftn + + + -DSYSDARWIN + + + -all_load + + + + + + -heap-arrays + + + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + + + + + -mcmodel medium -shared-intel + + + + + /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install + + -O2 + + + --host=Linux + + + -lstdc++ -lmpi_cxx + + + -O2 + + NETCDFROOT + PNETCDFROOT + + NETCDF_PATH/bin/nf-config --flibs -lblas -llapack + + + + + mpi + /soft/mvapich2/2.2b_psm/gnu-5.2/ + NETCDFROOT + gpfs + PNETCDFROOT + + NETCDF_PATH/bin/nc-config --flibs -llapack -lblas + + - - -O2 - -O2 - --host=Linux - -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf - ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm - -DHAVE_PAPI - ftn - cc - CC - $(PETSC_DIR) - /global/project/projectdirs/acme/software/AlbanyTrilinos_09232015/Albany/build/install + + mpi + /soft/mvapich2/2.2b_psm/intel-15.0 + NETCDFROOT + gpfs + PNETCDFROOT + + NETCDF_PATH/bin/nc-config --flibs -llapack -lblas + -Wl,-rpath -Wl,NETCDFROOT/lib + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + + + + mpi + mpich + /soft/openmpi/1.8.2/intel-13.1 + /soft/mpich2/1.4.1-intel-13.1 + NETCDFROOT + gpfs + PNETCDFROOT + + NETCDF_PATH/bin/nc-config --flibs -llapack -lblas + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + + + + mpi + /home/robl/soft/mpich-3.1.4-nag-6.0 + NETCDFROOT + gpfs + PNETCDFROOT + + NETCDF_PATH/bin/nc-config --flibs -llapack -lblas + - - -xCORE-AVX2 - -xCORE-AVX2 - -O2 -qno-opt-dynamic-align - -O2 - -qopenmp - -qopenmp - -qopenmp - -qopenmp - --host=Linux - -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf - ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm - - -DHAVE_PAPI - -DHAVE_SLASHPROC - ftn + + mpi + mpi + mpich + /soft/openmpi/1.8.2/pgi-13.9 + /soft/mpich2/1.4.1-pgi-13.9/ + NETCDFROOT + gpfs + PNETCDFROOT + + NETCDF_PATH/bin/nc-config --flibs -llapack -lblas + -rpath NETCDFROOT/lib + + + + + + + -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + + NETCDF + gpfs + PNETCDF + + + + + --host=Linux --enable-filesystem-hints=lustre + + + -DLINUX + + + -g -traceback -O0 -fpe0 -check all -check noarg_temp_created -ftrapuv + + NETCDF_LIB/.. + lustre + PNETCDFROOT + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi -LMKL_PATH -lmkl_rt + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + + + + + -DnoI8 + + + + -gline -C=all -g -O0 -v + -gline -C=all -g -nan -O0 -v + + + + + MPI_LIB + NETCDF_ROOT + lustre + PNETCDFROOT + + -LNETCDF_ROOT/lib -lnetcdf -lnetcdff -LMKL_PATH -lmkl_rt + + + + + /projects/ccsm/libs/AlbanyTrilinos/Albany/build/install + + -DMPASLI_EXTERNAL_INTERFACE_DISABLE_MANGLING + + + -llapack -lblas -LIBM_MAIN_DIR/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -LIBM_MAIN_DIR/xlsmp/bg/3.1/bglib64 -lxlsmp + + CXX + + -L/soft/libraries/hdf5/1.8.10/cnk-xl/current/lib -lhdf5 -lhdf5_hl + + mpixlc_r + /soft/compilers/bgclang/mpi/bgclang/bin/mpic++11 + mpixlf2003_r + /soft/libraries/netcdf/4.3.0-f4.2/cnk-xl/V1R2M0-20131211/ + /soft/libraries/petsc/3.5.3.1 + /home/santos/pFUnit/pFUnit_IBM + gpfs + /soft/libraries/pnetcdf/1.3.1/cnk-xl/current/ + mpixlc_r + mpixlf2003_r + + -LNETCDF_PATH/lib -lnetcdff -lnetcdf -L/soft/libraries/hdf5/1.8.10/cnk-xl/current/lib -lhdf5 -lhdf5_hl -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib + -LIBM_MAIN_DIR/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -LIBM_MAIN_DIR/xlsmp/bg/3.1/bglib64 -lxlsmp + + TRUE + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + -g -traceback -O0 -fpe0 -check all -check noarg_temp_created -ftrapuv + + NETCDF_HOME + lustre + PNETCDFROOT + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi -LMKL_PATH -lmkl_rt + + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + -C -Mbounds -traceback -Mchkfpstk -Mchkstk -Mdalign -Mdepchk -Mextend -Miomutex -Mrecursive -Ktrap=fp -O0 -g -byteswapio -Meh_frame + + NETCDF_HOME + lustre + PNETCDFROOT + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi -LMPI_LIB -lmpich + + + + + + -xCORE-AVX2 + -O2 + + + --host=Linux + + + -DHAVE_SLASHPROC + -DHAVE_PAPI + + + -xCORE-AVX2 + -O2 + cc CC - ifort - icc - icpc - $(PETSC_DIR) - - - - -xMIC-AVX512 - -xMIC-AVX512 - -O2 -qno-opt-dynamic-align - -O2 - -qopenmp - -qopenmp - -qopenmp - -qopenmp - --host=Linux - -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf - ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm - - - -DHAVE_PAPI - -DHAVE_SLASHPROC - ftn + PETSC_DIR + + -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf + MKLROOT/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group MKLROOT/lib/intel64/libmkl_intel_lp64.a MKLROOT/lib/intel64/libmkl_core.a MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group MKLROOT/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm + + + + + + -xMIC-AVX512 + -O2 + + + --host=Linux + + + -DHAVE_SLASHPROC + -DHAVE_PAPI + + + -xMIC-AVX512 + -O2 + cc CC - ifort - icc - icpc - $(PETSC_DIR) + ftn + PETSC_DIR + + -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf + MKLROOT/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group MKLROOT/lib/intel64/libmkl_intel_lp64.a MKLROOT/lib/intel64/libmkl_core.a MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group MKLROOT/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm + + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + + NETCDF_HOME + lustre + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi + - - -O2 - -g -traceback -O0 -fpe0 -check all -check noarg_temp_created -ftrapuv - -O2 - --host=Linux - -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf - ${MKLROOT}/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_lp64.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group ${MKLROOT}/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm - -DHAVE_PAPI - ftn + + /global/project/projectdirs/acme/software/AlbanyTrilinos_09232015/Albany/build/install + + -O2 + + + --host=Linux + + + -DHAVE_PAPI + + + -O2 + cc CC - - - ftn + PETSC_DIR + + -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf + MKLROOT/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group MKLROOT/lib/intel64/libmkl_intel_lp64.a MKLROOT/lib/intel64/libmkl_core.a MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group MKLROOT/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm + + + + + + -O2 + + + --host=Linux + + + -DHAVE_PAPI + + + -O2 + cc CC - -O2 -xMIC-AVX512 - -O2 -xMIC-AVX512 - -O0 -g -xMIC-AVX512 - -O0 -g -xMIC-AVX512 - -qopenmp - -qopenmp - -qopenmp - -qopenmp - --host=Linux - -L$(NETCDF_DIR)/lib -lnetcdff -L$(NETCDF_DIR)/lib -lnetcdf -Wl,-rpath -Wl,$(NETCDF_DIR)/lib - -mkl -lpthread -lm - -DHAVE_COMM_F2C - - - - $(NETCDF_PATH) - -framework Accelerate - -L$(NETCDF_PATH)/lib -lnetcdff -lnetcdf - - - - $(NETCDF_PATH) - $(PNETCDF_PATH) - $(shell $(NETCDF_PATH)/bin/nc-config --flibs) - - - - -O2 - -O2 - --host=Linux - $(NETCDFROOT) - $(PNETCDFROOT) - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -lblas -llapack - -lstdc++ -lmpi_cxx - /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install - - - - -O2 - -O2 - --host=Linux - $(NETCDFROOT) - $(PNETCDFROOT) - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -L/usr/lib64 -L/usr/lib64/atlas -lblas -llapack - -lstdc++ -lmpi_cxx - /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install - - - - -O2 - -O2 - --host=Linux - $(NETCDFROOT) - $(PNETCDFROOT) - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -lblas -llapack - -lstdc++ -lmpi_cxx - /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install - - - - -O2 - -O2 - $(NETCDFROOT) - $(PNETCDFROOT) - /opt/openmpi-1.8-intel - /projects/ccsm/esmf-6.3.0rp1/lib/libO/Linux.intel.64.openmpi.default - --host=Linux - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -L/projects/ccsm/BLAS-intel -lblas_LINUX - lustre - -mkl=cluster - -mkl - /projects/ccsm/AlbanyTrilinos/Albany/build/install - - - - -O2 - -O2 - $(NETCDFROOT) - $(PNETCDFROOT) - /projects/ccsm/esmf-6.3.0rp1/lib/libO/Linux.intel.64.openmpi.default - --host=Linux - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -L/projects/ccsm/BLAS-intel -lblas_LINUX - lustre - -mkl=cluster - -mkl - /projects/ccsm/AlbanyTrilinos/Albany/build/install - - - - /usr/local/tools/netcdf-pgi-4.1.3 - /usr/local/tools/mvapich2-pgi-1.7/ - mpich - -DNO_SHR_VMATH -DCNL - $(shell /usr/local/tools/netcdf-pgi-4.1.3/bin/nc-config --flibs) - -Wl,-rpath /usr/local/tools/netcdf-pgi-4.1.3/lib -llapack -lblas - - - - -O2 - -O2 - /usr/local/tools/netcdf-intel-4.1.3 - /usr/local/tools/parallel-netcdf-intel-1.6.1 - --host=Linux - /usr/local/tools/mvapich2-intel-2.1/ - mpich - -DNO_SHR_VMATH -DCNL - -g -traceback -O0 -fpe0 -check all -check noarg_temp_created -ftrapuv - $(shell /usr/local/tools/netcdf-intel-4.1.3/bin/nc-config --flibs) - -llapack -lblas - - - -D_USE_FLOW_CONTROL - - - - /projects/cesm/devtools/netcdf-4.1.3-gcc4.8.1-mpich3.0.4/ - -L/user/lib64 -llapack -lblas -lnetcdff - /projects/cesm/devtools/gcc-4.8.1/bin/gfortran - /projects/cesm/devtools/gcc-4.8.1/bin/gcc - /projects/cesm/devtools/gcc-4.8.1/bin/g++ - /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpicc - /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpif90 - - - - /home/zdr/opt/netcdf-4.1.3_pgf95 - - - - /projects/cesm/devtools/netcdf-4.1.3-gcc4.8.1-mpich3.0.4/ - -L/user/lib64 -llapack -lblas -lnetcdff - /projects/cesm/devtools/gcc-4.8.1/bin/gfortran - /projects/cesm/devtools/gcc-4.8.1/bin/gcc - /projects/cesm/devtools/gcc-4.8.1/bin/g++ - /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpicc - /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpif90 + ftn + + -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf + MKLROOT/lib/intel64/libmkl_scalapack_lp64.a -Wl,--start-group MKLROOT/lib/intel64/libmkl_intel_lp64.a MKLROOT/lib/intel64/libmkl_core.a MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group MKLROOT/lib/intel64/libmkl_blacs_intelmpi_lp64.a -lpthread -lm + - - /home/zdr/opt/netcdf-4.1.3_pgf95 + + /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-gnu/install - - -DFORTRANUNDERSCORE -DNO_R16 - -fopenmp - -fopenmp - -L$(GCC_ROOT)/lib64/gcc/x86_64-unknown-linux-gnu/5.3.0 -fopenmp - -D CISM_GNU=ON - -ffixed-form - -ffree-form - -g -Wall - - -O -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none -fno-range-check - -O0 - -fdefault-real-8 - - /software/tools/spack/opt/spack/linux-x86_64/gcc-4.8.5/gcc-5.3.0-5hy3c4b3xqemygnfwyl5dsc753gbvzrc/bin/gfortran - /software/tools/spack/opt/spack/linux-x86_64/gcc-4.8.5/gcc-5.3.0-5hy3c4b3xqemygnfwyl5dsc753gbvzrc/bin/gcc - /software/tools/spack/opt/spack/linux-x86_64/gcc-4.8.5/gcc-5.3.0-5hy3c4b3xqemygnfwyl5dsc753gbvzrc/bin/gcpp - /software/tools/spack/opt/spack/linux-x86_64/gcc-5.3.0/openmpi-1.10.2-w26llp27jmybo7wlgoqxjrtptltmripg/bin/mpif90 - /software/tools/spack/opt/spack/linux-x86_64/gcc-5.3.0/openmpi-1.10.2-w26llp27jmybo7wlgoqxjrtptltmripg/bin/mpicc - /software/tools/spack/opt/spack/linux-x86_64/gcc-5.3.0/openmpi-1.10.2-w26llp27jmybo7wlgoqxjrtptltmripg/bin/mpic++ - FORTRAN - TRUE - - /software/user_tools/current/cades-ccsi/netcdf4/4.4.0/openmpi-1.10.2-gcc-5.3 - /software/user_tools/current/cades-ccsi/hdf5/1.8.16/openmpi-1.10.2-gcc-5.3 - /software/tools/spack/opt/spack/linux-x86_64/gcc-5.3.0/netlib-lapack-3.5.0-ktb3cldqesiba6ndoiifvr3irojqhdhc/lib/ - /software/tools/spack/opt/spack/linux-x86_64/gcc-5.3.0/netlib-blas-3.5.0-cxsdr3okwvgr6u7kusa5ee5vhsyqxwgg/lib/ - -L$(NETCDF_PATH)/lib -Wl,-rpath=$(NETCDF_PATH)/lib -lnetcdff -lnetcdf \ - -L$(HDF5_ROOT)/lib -Wl,-rpath=$(HDF5_ROOT)/lib -lhdf5_hl -lhdf5 \ - -L$(LAPACK_LIBDIR) -Wl,-rpath=$(LAPACK_LIBDIR) \ - -L$(BLAS_LIBDIR) -Wl,-rpath=$(BLAS_LIBDIR) - - - - - - -O2 - -O2 - --host=Linux - lustre - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - TRUE - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - -O2 - -O2 - --host=Linux - lustre - $(shell nf-config --flibs) - /lustre/atlas/world-shared/cli900/cesm/software/Trilinos/Trilinos-11.10.2_gptl/titan-pgi-ci-nophal/install - -lfmpich -lmpichf90_pgi $(PGI_PATH)/linux86-64/$(PGI_VERSION)/lib/f90main.o /opt/gcc/default/snos/lib64/libstdc++.a + + /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libO/Unicos.intel.64.mpi.default/ + /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libg/Unicos.intel.64.mpi.default/ + + NETCDF_PATH/bin/nf-config --flibs + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + + + + + -O2 + + + -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o + + + -O2 + TRUE - ftn - cc - /opt/cray/craype/2.4.0/bin/CC - /ccs/proj/cli106/AlbanyTrilinos/Albany/build/install + /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-pgi/install - - -O2 - -O2 - --host=Linux - lustre - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - -lfmpich -lmpichf90_pgi $(PGI_PATH)/linux86-64/$(PGI_VERSION)/lib/f90main.o - TRUE + + + -DHAVE_VPRINTF -DHAVE_GETTIMEOFDAY + + + -lnetcdff -lnetcdf -mkl + - - /usr/bin/bash - xlf2003_r - mpxlf2003_r - cc_r - mpcc_r - -qarch=auto -qtune=auto -qcache=auto - -qarch=auto -qtune=auto -qcache=auto -qsclk=micro - -qsigtrap=xl__trcedump - -qspill=6000 - -bdatapsize:64K -bstackpsize:64K -btextpsize:32K - -lmassv -lessl - -lmass - - - - -qtune=440 -qarch=440d - -qtune=440 -qarch=440d - /bgl/BlueLight/ppcfloor/bglsys - mpich.rts - blrts_xlf2003 - blrts_xlf2003 - blrts_xlc - blrts_xlc - -O3 -qstrict - -O3 -qstrict -Q - -qinitauto=FF911299 -qflttrap=ov:zero:inv:en - -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts - -DLINUX -DnoI8 - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - -Wl,--relax -Wl,--allow-multiple-definition - -qextname=flush + + + -DHAVE_VPRINTF -DHAVE_GETTIMEOFDAY + + + -lnetcdff -lnetcdf -mkl + - - -qtune=450 -qarch=450 -I/bgsys/drivers/ppcfloor/arch/include/ - -qspillsize=2500 -qtune=450 -qarch=450 - -DLINUX -DnoI8 - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - -Wl,--relax -Wl,--allow-multiple-definition - -qextname=flush + + NETCDF_PATH + PNETCDF_PATH + + NETCDF_PATH/bin/nc-config --flibs + - - - -g -qfullpath -qmaxmem=-1 -qspillsize=2500 -qextname=flush - -O3 -qstrict -Q - -DLINUX - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - -Wl,--relax -Wl,--allow-multiple-definition + + + -framework Accelerate + + NETCDF_PATH + + -LNETCDF_PATH/lib -lnetcdff -lnetcdf + - - - mpixlf2003_r - mpixlf2003_r - mpixlc_r - mpixlc_r + + /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install + + -O2 + + + --host=Linux + + + -lstdc++ -lmpi_cxx + + + -O2 + + NETCDFROOT + PNETCDFROOT + + NETCDF_PATH/bin/nf-config --flibs -lblas -llapack + + + + + /projects/ccsm/libs/AlbanyTrilinos/Albany/build/install + + -DMPASLI_EXTERNAL_INTERFACE_DISABLE_MANGLING + + + -llapack -lblas -LIBM_MAIN_DIR/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -LIBM_MAIN_DIR/xlsmp/bg/3.1/bglib64 -lxlsmp + + CXX + /soft/libraries/hdf5/1.8.14/cnk-xl/current/ mpixlf77_r - /soft/libraries/netcdf/4.3.3-f4.4.1/cnk-xl/current/ - /soft/libraries/pnetcdf/1.6.0/cnk-xl/current/ - /home/santos/pFUnit/pFUnit_IBM - /soft/libraries/hdf5/1.8.14/cnk-xl/current/ - -L$(NETCDF_PATH)/lib -lnetcdff -lnetcdf -L/soft/libraries/hdf5/1.8.14/cnk-xl/current/lib -lhdf5_hl -lhdf5 -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib - -L$(IBM_MAIN_DIR)/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -L$(IBM_MAIN_DIR)/xlsmp/bg/3.1/bglib64 -lxlsmp - gpfs - /soft/libraries/petsc/3.5.3.1 - TRUE - CXX - -llapack -lblas -L$(IBM_MAIN_DIR)/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -L$(IBM_MAIN_DIR)/xlsmp/bg/3.1/bglib64 -lxlsmp - -DMPASLI_EXTERNAL_INTERFACE_DISABLE_MANGLING + mpixlc_r /soft/compilers/bgclang/mpi/bgclang/bin/mpic++11 - /projects/ccsm/libs/AlbanyTrilinos/Albany/build/install - - - - - mpixlf2003_r mpixlf2003_r - mpixlc_r - mpixlc_r - /soft/libraries/netcdf/4.3.0-f4.2/cnk-xl/V1R2M0-20131211/ - /soft/libraries/pnetcdf/1.3.1/cnk-xl/current/ + /soft/libraries/netcdf/4.3.3-f4.4.1/cnk-xl/current/ + /soft/libraries/petsc/3.5.3.1 /home/santos/pFUnit/pFUnit_IBM - -L/soft/libraries/hdf5/1.8.10/cnk-xl/current/lib -lhdf5 -lhdf5_hl - -L$(NETCDF_PATH)/lib -lnetcdff -lnetcdf -L/soft/libraries/hdf5/1.8.10/cnk-xl/current/lib -lhdf5 -lhdf5_hl -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib - -L$(IBM_MAIN_DIR)/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -L$(IBM_MAIN_DIR)/xlsmp/bg/3.1/bglib64 -lxlsmp gpfs - /soft/libraries/petsc/3.5.3.1 + /soft/libraries/pnetcdf/1.6.0/cnk-xl/current/ + mpixlc_r + mpixlf2003_r + + -LNETCDF_PATH/lib -lnetcdff -lnetcdf -L/soft/libraries/hdf5/1.8.14/cnk-xl/current/lib -lhdf5_hl -lhdf5 -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib + -LIBM_MAIN_DIR/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -LIBM_MAIN_DIR/xlsmp/bg/3.1/bglib64 -lxlsmp + TRUE - CXX - -llapack -lblas -L$(IBM_MAIN_DIR)/xlf/bg/14.1/bglib64 -lxlfmath -lxlf90_r -lxlopt -lxl -L$(IBM_MAIN_DIR)/xlsmp/bg/3.1/bglib64 -lxlsmp - -DMPASLI_EXTERNAL_INTERFACE_DISABLE_MANGLING - /soft/compilers/bgclang/mpi/bgclang/bin/mpic++11 - /projects/ccsm/libs/AlbanyTrilinos/Albany/build/install - - - - $(PNETCDFROOT) - $(NETCDFROOT) - /soft/openmpi/1.8.2/pgi-13.9 - /soft/mpich2/1.4.1-pgi-13.9/ - mpi - mpi - mpich - $(shell $(NETCDF_PATH)/bin/nc-config --flibs) -llapack -lblas - -rpath $(NETCDFROOT)/lib - gpfs - - $(PNETCDFROOT) - $(NETCDFROOT) - /soft/openmpi/1.8.2/intel-13.1 - /soft/mpich2/1.4.1-intel-13.1 - mpi - mpich - $(shell $(NETCDF_PATH)/bin/nc-config --flibs) -llapack -lblas - gpfs - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - $(PNETCDFROOT) - $(NETCDFROOT) - /soft/mvapich2/2.2b_psm/intel-15.0 - mpi - $(shell $(NETCDF_PATH)/bin/nc-config --flibs) -llapack -lblas - -Wl,-rpath -Wl,$(NETCDFROOT)/lib - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - gpfs + + ALBANY_PATH + + -lstdc++ -lmpi_cxx + + mpicc + mpic++ + mpif90 + gcc + g++ + gfortran + + NETCDF_PATH/bin/nf-config --flibs -llapack -lblas + + TRILINOS_PATH - - $(PNETCDFROOT) - $(NETCDFROOT) - /blues/gpfs/home/software/spack/opt/spack/linux-x86_64/gcc-5.3.0/mvapich2-2.2b-sdh7nhddicl4sh5mgxjyzxtxox3ajqey - mpi - $(shell $(NETCDF_PATH)/bin/nc-config --flibs) -llapack -lblas - -DHAVE_NANOTIME -DBIT64 -DHAVE_SLASHPROC -DHAVE_GETTIMEOFDAY - gpfs + + mpicc + mpic++ + mpif90 + icc + icpc + ifort + + NETCDF_PATH/bin/nf-config --flibs -llapack -lblas + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + TRILINOS_PATH - - $(PNETCDFROOT) - $(NETCDFROOT) - /home/robl/soft/mpich-3.1.4-nag-6.0 - mpi - $(shell $(NETCDF_PATH)/bin/nc-config --flibs) -llapack -lblas - gpfs + + mpicc + mpic++ + mpif90 + pgcc + pgc++ + pgfortran + + NETCDF_PATH/bin/nf-config --flibs -llapack -lblas + + TRILINOS_PATH - - $(PNETCDFROOT) - $(NETCDFROOT) - /blues/gpfs/home/software/spack-0.9.1/opt/spack/linux-centos6-x86_64/intel-16.0.3/mvapich2-2.2b-ow5ikyjehwemgdr4h6k7ii7da6hs6lfz - mpi - $(shell $(NETCDF_PATH)/bin/nc-config --flibs) -llapack -lblas - -Wl,-rpath -Wl,$(NETCDFROOT)/lib - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - gpfs + + /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpicc + /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpif90 + /projects/cesm/devtools/netcdf-4.1.3-gcc4.8.1-mpich3.0.4/ + /projects/cesm/devtools/gcc-4.8.1/bin/gcc + /projects/cesm/devtools/gcc-4.8.1/bin/g++ + /projects/cesm/devtools/gcc-4.8.1/bin/gfortran + + -L/user/lib64 -llapack -lblas -lnetcdff + - - $(PNETCDFROOT) - $(NETCDFROOT) - /soft/spack/opt/spack/linux-x86_64/gcc-4.4.7/gcc-5.3.0-fygfl7rvyuiteto27dlhmilp5cstw2o2 - mpi - $(shell $(NETCDF_PATH)/bin/nc-config --flibs) -llapack -lblas - -DHAVE_NANOTIME -DBIT64 -DHAVE_SLASHPROC -DHAVE_GETTIMEOFDAY - gpfs + + /home/zdr/opt/netcdf-4.1.3_pgf95 - - $(PNETCDFROOT) - $(NETCDFROOT) - soft/spack/opt/spack/linux-x86_64/pgi-16.3-0/mvapich2-2.2b-2t45yukj4ij6ek24fwimzydo2dg6i3n2 - mpi - $(shell $(NETCDF_PATH)/bin/nc-config --flibs) -llapack -lblas - -rpath $(NETCDFROOT)/lib - gpfs + + /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpicc + /projects/cesm/devtools/mpich-3.0.4-gcc4.8.1/bin/mpif90 + /projects/cesm/devtools/netcdf-4.1.3-gcc4.8.1-mpich3.0.4/ + /projects/cesm/devtools/gcc-4.8.1/bin/gcc + /projects/cesm/devtools/gcc-4.8.1/bin/g++ + /projects/cesm/devtools/gcc-4.8.1/bin/gfortran + + -L/user/lib64 -llapack -lblas -lnetcdff + - - -O2 - -O2 - $(NETCDF_HOME) - --host=Linux - lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi + + /home/zdr/opt/netcdf-4.1.3_pgf95 - - -O2 - -O2 - $(NETCDF_LIB)/.. - --host=Linux + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + + NETCDF_LIB/.. lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi - - - - -O2 - -O2 - $(NETCDF_LIB)/.. - --host=Linux + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi + + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + + NETCDF_LIB/.. lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi + - - -O2 - -O2 - $(NETCDF) - --host=Linux + + /projects/ccsm/AlbanyTrilinos/Albany/build/install + + -O2 + + + --host=Linux + + /projects/ccsm/esmf-6.3.0rp1/lib/libO/Linux.intel.64.openmpi.default + + -O2 + + NETCDFROOT + lustre + PNETCDFROOT + + NETCDF_PATH/bin/nf-config --flibs -L/projects/ccsm/BLAS-intel -lblas_LINUX + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + + + + /projects/ccsm/AlbanyTrilinos/Albany/build/install + + -O2 + + + --host=Linux + + /projects/ccsm/esmf-6.3.0rp1/lib/libO/Linux.intel.64.openmpi.default + + -O2 + + NETCDFROOT + lustre + PNETCDFROOT + + NETCDF_PATH/bin/nf-config --flibs -L/projects/ccsm/BLAS-intel -lblas_LINUX + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + + NETCDF lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lpmi - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - -O2 - -O2 - $(NETCDF_LIB)/.. - --host=Linux + + -LNETCDF_PATH/lib -lnetcdf -lpmi + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + + NETCDF_LIB/.. lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi - - - - $(NETCDF_LIB)/.. - $(PNETCDFROOT) + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi + + + + + + -O2 + + + --host=Linux + + + -O2 + lustre - --host=Linux --enable-filesystem-hints=lustre - -DLINUX - -g -traceback -O0 -fpe0 -check all -check noarg_temp_created -ftrapuv - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi -L$(MKL_PATH) -lmkl_rt - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - $(NETCDF_ROOT) - $(PNETCDFROOT) - lustre - $(MPI_LIB) - -DnoI8 - - - -gline -C=all -g -O0 -v - -gline -C=all -g -nan -O0 -v - -L$(NETCDF_ROOT)/lib -lnetcdf -lnetcdff -L$(MKL_PATH) -lmkl_rt + + NETCDF_PATH/bin/nf-config --flibs + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + TRUE - - -O2 - -O2 - $(NETCDF_LIB)/../ - $(PNETCDFROOT) - --host=Linux + + /ccs/proj/cli106/AlbanyTrilinos/Albany/build/install + + -O2 + + + --host=Linux + + + -lfmpich -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o /opt/gcc/default/snos/lib64/libstdc++.a + + + -O2 + + cc + /opt/cray/craype/2.4.0/bin/CC + ftn lustre - -DLINUX - -C -Mbounds -traceback -Mchkfpstk -Mchkstk -Mdalign -Mdepchk -Mextend -Miomutex -Mrecursive -Ktrap=fp -O0 -g -byteswapio -Meh_frame - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi -L$(MPI_LIB) -lmpich + + nf-config --flibs + + TRUE + /lustre/atlas/world-shared/cli900/cesm/software/Trilinos/Trilinos-11.10.2_gptl/titan-pgi-ci-nophal/install - - -O2 - -O2 - $(NETCDF_LIB)/../ - $(PNETCDFROOT) - --host=Linux + + + -O2 + + + --host=Linux + + + -lfmpich -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o + + + -O2 + lustre - -DLINUX - -g -traceback -O0 -fpe0 -check all -check noarg_temp_created -ftrapuv - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi -L$(MKL_LIB) -lmkl_rt - - - - - -O2 - -O2 - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-pgi/install - -lmpichf90_pgi $(PGI_PATH)/linux86-64/$(PGI_VERSION)/lib/f90main.o - TRUE - - - - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libO/Unicos.intel.64.mpi.default/ - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libg/Unicos.intel.64.mpi.default/ - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-gnu/install - - - - mpicc - mpif90 - mpic++ - pgfortran - pgcc - pgc++ - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -llapack -lblas - $(TRILINOS_PATH) - - - - mpicc - mpif90 - mpic++ - ifort - icc - icpc - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -llapack -lblas - $(TRILINOS_PATH) - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - mpicc - mpif90 - mpic++ - gfortran - gcc - g++ - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -llapack -lblas - -lstdc++ -lmpi_cxx - $(TRILINOS_PATH) - $(ALBANY_PATH) - - - - mpicc - mpif90 - mpic++ - pgfortran - pgcc - pgc++ - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -llapack -lblas - $(TRILINOS_PATH) + + NETCDF_PATH/bin/nf-config --flibs + + TRUE - - mpicc - mpif90 - mpic++ - ifort - icc - icpc - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -llapack -lblas - $(TRILINOS_PATH) - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl + + + + + + + + + + + USERDEFINED_MUST_EDIT_THIS + + + # USERDEFINED NETCDF_PATH/bin/nc-config --flibs + - mpicc - mpif90 - mpic++ - gfortran - gcc - g++ - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -llapack -lblas - -lstdc++ -lmpi_cxx - $(TRILINOS_PATH) - $(ALBANY_PATH) - - - - gpfs - $(NETCDF) - $(PNETCDF) - - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + ALBANY_PATH + + -lstdc++ -lmpi_cxx + + mpicc + mpic++ + mpif90 + gcc + g++ + gfortran + + NETCDF_PATH/bin/nf-config --flibs -llapack -lblas + + TRILINOS_PATH - - -lnetcdff -lnetcdf -mkl - -DHAVE_VPRINTF -DHAVE_GETTIMEOFDAY - - - - -lnetcdff -lnetcdf -mkl - -DHAVE_VPRINTF -DHAVE_GETTIMEOFDAY - - - - -std=c99 + + mpicc + mpic++ + mpif90 + icc + icpc + ifort + + NETCDF_PATH/bin/nf-config --flibs -llapack -lblas + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + + TRILINOS_PATH - + + mpicc + mpic++ + mpif90 + pgcc + pgc++ + pgfortran + + NETCDF_PATH/bin/nf-config --flibs -llapack -lblas + + TRILINOS_PATH + + + diff --git a/cime_config/cesm/config_files.xml b/cime_config/cesm/config_files.xml index 4e536666839..d3e9920a80a 100644 --- a/cime_config/cesm/config_files.xml +++ b/cime_config/cesm/config_files.xml @@ -43,11 +43,11 @@ char - $CIMEROOT/cime_config/$MODEL/machines/config_build.xml + $CIMEROOT/cime_config/$MODEL/machines/config_compilers.xml case_last env_case.xml file containing compiler specifications for target model primary component (for documentation only - DO NOT EDIT) - $CIMEROOT/cime_config/xml_schemas/config_build.xsd + $CIMEROOT/cime_config/xml_schemas/config_compilers_v2.xsd diff --git a/cime_config/cesm/machines/config_build.xml b/cime_config/cesm/machines/config_build.xml deleted file mode 100644 index ad363759b82..00000000000 --- a/cime_config/cesm/machines/config_build.xml +++ /dev/null @@ -1,1370 +0,0 @@ - - - - - - - -D_USE_FLOW_CONTROL - - FALSE - - - - - -h noomp - -g -O0 - -O2 - - - - -DFORTRANUNDERSCORE -DNO_R16 - -DDIR=NOOP - -DDIR=NOOP - - - -s real64 - - - -f free -N 255 -h byteswapio -x dir - -h noomp - -g -O0 -K trap=fp -m1 - -O2,ipa2 -em - - - -O1,fp2,ipa0,scalar0,vector0 - - TRUE - - -Wl,--allow-multiple-definition -h byteswapio - - - - - - -mcmodel=medium -std=gnu99 - -fopenmp - -g -Wall - -O - - - -D CISM_GNU=ON - - - - -DFORTRANUNDERSCORE -DNO_R16 - - FORTRAN - - -fdefault-real-8 - - - - -mcmodel=medium -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none - -fopenmp - -g -Wall - -O - - - -O0 - - - -ffixed-form - - - -ffree-form - - FALSE - - -fopenmp - - mpicc - mpicxx - mpif90 - gcc - g++ - gfortran - TRUE - - - - - -g -qfullpath -qmaxmem=-1 - -O3 - -qsmp=omp - -qsmp=omp:noopt - - - - -DFORTRAN_SAME - - -WF,-D - - -qrealsize=8 - - - -g -qfullpath -qmaxmem=-1 - -O2 -qstrict -qinline=auto - -qsmp=omp - -qinitauto=7FF7FFFF -qflttrap=ov:zero:inv:en - -qsmp=omp:noopt - -C - - - -qsuffix=f=f -qfixed=132 - - - -qsuffix=f=f90:cpp=F90 - - TRUE - - -qsmp=omp - -qsmp=omp:noopt - - - - - - -no-opt-dynamic-align -fp-model precise -std=gnu99 - -openmp - -O2 -debug minimal - -O0 -g - - - - -DFORTRANUNDERSCORE -DNO_R16 - - - -cxxlib - - FORTRAN - - -r8 - - - -no-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source - -openmp - - -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created - -O2 -debug minimal - - - -O0 - -openmp - - - -fixed -132 - - - -free - - TRUE - - -openmp - - mpicc - mpicxx - mpif90 - icc - icpc - ifort - - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - TRUE - - - - - -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR - -openmp - - - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - - - - -DFORTRANUNDERSCORE -DNO_R16 - -DCPRINTEL - - - -cxxlib - - FORTRAN - - -r8 - - - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs - -openmp - -O0 -g -check uninit -check bounds -check pointers -fpe0 - -O2 - - - -O0 -mmic - - - -fixed -132 - - - -free - - TRUE - - -openmp - -mmic - - mpiicc - mpiicpc - mpiifort - icc - icpc - ifort - - NETCDF_PATH/bin/nf-config --flibs - - TRUE - - - - - -std=gnu99 - -g - - - -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH - - - -r8 - - - - - -Wp,-macro=no_com -convert=BIG_ENDIAN -indirect CIMEROOT/cime_config/cesm/machines/nag_mpi_argument.txt - - -ieee=full -O2 - - - -C=all -g -time -f2003 -ieee=stop - -gline - -openmp - - -mismatch_all - - - FFLAGS - -ieee=full - - - - -g -time -f2003 -ieee=stop - -gline - -openmp - - - -fixed - - - -free - - FALSE - - -openmp - - mpicc - mpif90 - gcc - nagfor - - - - - -gopt -time - -mp - - - - - - - - - - - - - - - - - - - - - - - - - - - - -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 - - CXX - - -r8 - - - -i4 -gopt -time -Mextend -byteswapio -Mflushz -Kieee - -mp - -O0 -g -Ktrap=fp -Mbounds -Kieee - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - - - -O0 -g -Ktrap=fp -Mbounds -Kieee - -mp - - - -Mfixed - - - -Mfree - - - - FALSE - - -time -Wl,--allow-multiple-definition - -mp - - mpicc - mpicxx - mpif90 - pgcc - pgc++ - pgf95 - - - - - -gopt -time - - - - - - - - - - - - - - - - - - - - - - - - - - - - -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 -DUSE_CUDA_FORTRAN -DCPRPGI - - CXX - - -r8 - - - -i4 -gopt -time -Mextend -byteswapio -Mflushz -Kieee - -ta=nvidia -Mcuda=5.5,cc35 - -O0 -g -Ktrap=fp -Mbounds -Kieee - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - - - -O0 -g -Ktrap=fp -Mbounds -Kieee - -mp - - - -Mfixed - - - -Mfree - - - - FALSE - - -time -Wl,--allow-multiple-definition -ta=nvidia -Mcuda=5.0,cc35 - - mpicc - mpicxx - mpif90 - pgcc - pgc++ - pgf95 - - - - - -qarch=auto -qtune=auto -qcache=auto - - /usr/bin/bash - - -qarch=auto -qtune=auto -qcache=auto -qsclk=micro - -qspill=6000 - - - -qsigtrap=xl__trcedump - -bdatapsize:64K -bstackpsize:64K -btextpsize:32K - - mpcc_r - mpxlf2003_r - cc_r - xlf2003_r - - -lmassv -lessl - -lmass - - - - - - -O3 -qstrict - -qtune=440 -qarch=440d - - - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - - - -DLINUX -DnoI8 - - - -qtune=440 -qarch=440d - -O3 -qstrict -qinline=auto - -qinitauto=FF911299 -qflttrap=ov:zero:inv:en - -qextname=flush - - - -Wl,--relax -Wl,--allow-multiple-definition - - - -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts - - blrts_xlc - blrts_xlf2003 - mpich.rts - /bgl/BlueLight/ppcfloor/bglsys - blrts_xlc - blrts_xlf2003 - - - - - -qtune=450 -qarch=450 -I/bgsys/drivers/ppcfloor/arch/include/ - - - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - - - -DLINUX -DnoI8 - - - -qspillsize=2500 -qtune=450 -qarch=450 - -qextname=flush - - - -Wl,--relax -Wl,--allow-multiple-definition - - - - - - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - - - -DLINUX - - - -g -qfullpath -qmaxmem=-1 -qspillsize=2500 -qextname=flush - -O3 -qstrict -qinline=auto - -qsmp=omp - -qsmp=omp:noopt - - - -Wl,--relax -Wl,--allow-multiple-definition - - - - - - -DCMAKE_SYSTEM_NAME=Catamount - - - -DLINUX - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - - cc - CC - ftn - NETCDF_DIR - lustre - PARALLEL_NETCDF_DIR - cc - CC - ftn - - - - - -DSYSDARWIN - - - -all_load - - - - - - -heap-arrays - - - - - - -xHost -no-save-temps - - - --host=Linux - - - -DHAVE_NANOTIME -DCPRINTEL - - - -xHost -no-save-temps - - - NETCDF - - mpiicc - mpiicpc - mpiifort - - NETCDF_DIR - PNETCDF_DIR - icc - ifort - - NETCDf MKL - - - - - - -mmic -O3 -fp-model precise -DFORTRANUNDERSCORE -no-save-temps - - - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - - - -DHAVE_NANOTIME -DCPRINTELMIC -DCPRINTEL - - - - -O0 -g -check all -check noarg_temp_created - -O3 -mP2OPT_hpo_matrix_opt_framework=0 - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -no-save-temps -no-opt-dynamic-align - - - -O0 -mmic - - - NETCDF -mmic - - mpiicc - mpiicpc - mpiifort - - NETCDF_DIR - PNETCDF_DIR - icc - ifort - - NETCDF MKL - - - - - - -DHAVE_PAPI - - lustre - - - - - -O2 - -nofma - - - -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o - - - -O2 - -nofma - - TRUE - - - - - --host=LINUX - - mpich - mpi - MPI_ROOT - NETCDF - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - - NETCDF_HOME - lustre - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi -LMKL_PATH -lmkl_rt - - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - - NETCDF_HOME - lustre - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi - - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - - NETCDF_HOME - lustre - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi - - - - - - -O2 - -nomp - - - --host=Linux - - - -DLINUX - - - -O2 - -nomp - - - -nomp - - NETCDF_HOME - lustre - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi - - - - - - -O2 - - - --host=Linux - - - -DHAVE_PAPI - - - -O2 - - - -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf - - - - - - - -DNO_MPI2 - - NETCDF - gpfs - PNETCDF - mpicc - mpif90 - - - - - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - - /usr/lib64 - mpi - - NETCDF_PATH/bin/nf-config --flibs - - - - - - -Wl,-rpath,NETCDF_PATH/lib - -Wl,-rpath,COMPILER_PATH/lib/intel64 - -Wl,-rpath,COMPILER_PATH/mkl/lib/intel64 - - /home/santos/pFUnit/pFUnit_Intel_3_0 - - - - - -DNO_C_SIZEOF - - - - -kind=byte - - - - -L/home/santos/lib/fake_omp -lfake_omp -Wl,-Wl,,--rpath=/home/santos/lib/fake_omp - - /usr/local/openmpi-gcc-nag - /usr/local/netcdf-gcc-nag - /home/santos/pFUnit/pFUnit_NAG_3_0 - - - - - -O0 - - - -O0 - - - -lgomp - -Wl,-RNETCDF_PATH/lib - -Wl,-RCOMPILER_PATH/lib - -Wl,-RCOMPILER_PATH/libso - - - - - - -O2 - - - -O2 - - - -Wl,-rpath /usr/local/tools/netcdf-pgi-4.1.3/lib - - mpich - /usr/local/tools/mvapich2-pgi-1.7/ - /usr/local/tools/netcdf-pgi-4.1.3 - - /usr/local/tools/netcdf-pgi-4.1.3/bin/nc-config --flibs - - - - - - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - - /usr/lib64 - mpich - NETCDF_PATH - - NETCDF_PATH/bin/nf-config --flibs - - - - - - -lifcore - - - -lifcore - -mcmodel medium - - - -lquadmath - -Wl,-rpath,NETCDF_PATH/lib - -Wl,-rpath,COMPILER_PATH/lib/intel64 - -Wl,-rpath,COMPILER_PATH/mkl/lib/intel64 - -Wl,-rpath,MPI_PATH/lib - -lifcore - - /home/santos/pFUnit/pFUnit_Intel_3_0 - - -mkl=cluster - - - - - - - -DNO_C_SIZEOF - - - -lpthread - - /home/santos/pFUnit/pFUnit_NAG_3_0 - - - - - -O0 - - - -O0 - - - -lgomp - -Wl,-RNETCDF_PATH/lib - -Wl,-RCOMPILER_PATH/lib - -Wl,-RCOMPILER_PATH/libso - - - - - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-gnu/install - - - - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libO/Unicos.intel.64.mpi.default/ - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libg/Unicos.intel.64.mpi.default/ - - NETCDF_PATH/bin/nf-config --flibs - - - - - - -O2 - - - -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o - - - -O2 - - TRUE - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-pgi/install - - - - mpixlc_r - mpixlf2003_r - /bgsys/local/netcdf/ - gpfs - /bgsys/local/parallel-netcdf/v1.3.1 - mpixlc_r - mpixlf2003_r - - -L/bgsys/local/netcdf/lib -lnetcdf -L/bgsys/drivers/ppcfloor/comm/lib - - - - - /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install - - -O2 - - - --host=Linux - - - -lstdc++ -lmpi_cxx - - - -O2 - - NETCDFROOT - PNETCDFROOT - - NETCDF_PATH/bin/nf-config --flibs -lblas -llapack - - - - - - -qfloat=nomaf - - - -qfloat=nomaf - - HDF5 - - - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlf77_r - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlc_r - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlf2003_r - /soft/libraries/netcdf/4.3.3-f4.4.1/cnk-xl/current/ - /home/santos/pFUnit/pFUnit_IBM - gpfs - /soft/libraries/pnetcdf/1.6.1/cnk-xl/current/ - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlc_r - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlf2003_r - - -LNETCDF_PATH/lib -lnetcdff -lnetcdf -LHDF5/lib -lhdf5_hl -lhdf5 -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib - - - - - - -O2 - - - --host=Linux - - - -DLINUX - - - -O2 - - NETCDF_LIB/.. - lustre - - -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi - - - - - - -O2 -aCORE-AVX2 -align array32byte - - icc - mpi - MPI_ROOT - /nasa/netcdf/4.1.3/intel/mpt - - -LNETCDF_DIR/lib -lnetcdff -lnetcdf - - - - - - -O2 -xAVX - - icc - mpi - MPI_ROOT - /nasa/netcdf/4.1.3/intel/mpt - - -LNETCDF_DIR/lib -lnetcdff -lnetcdf - - - - - - -O2 -xAVX - - icc - mpi - MPI_ROOT - /nasa/netcdf/4.1.3/intel/mpt - - -LNETCDF_DIR/lib -lnetcdff -lnetcdf - - - - - - -O2 -xSSE4.2 - - icc - mpi - MPI_ROOT - /nasa/netcdf/4.1.3/intel/mpt - - -LNETCDF_DIR/lib -lnetcdff -lnetcdf - - - - - - -xHost - - - -xHost - - - -LTACC_HDF5_LIB -lhdf5 - - mpiicc - mpicpc - mpiifort - icc - icpc - ifort - - NETCDF_PATH/bin/nf-config --flibs -LTACC_HDF5_LIB -lhdf5 - - TRILINOS_PATH - - - - - -Wl,-rpath /usr/local/tools/netcdf-pgi-4.1.3/lib - - mpich - /usr/local/tools/mvapich2-pgi-1.7/ - /usr/local/tools/netcdf-pgi-4.1.3 - - /usr/local/tools/netcdf-pgi-4.1.3/bin/nc-config --flibs - - - - - - -O2 - - - --host=Linux - - /projects/ccsm/esmf-6.3.0rp1/lib/libO/Linux.intel.64.openmpi.default - - -O2 - - NETCDFROOT - lustre - PNETCDFROOT - - NETCDF_PATH/bin/nf-config --flibs -L/projects/ccsm/BLAS-intel -lblas_LINUX - - - - - - -DHAVE_NANOTIME - - TACC_NETCDF_DIR - lustre - TACC_PNETCDF_DIR - - - - - -xHost - - - -xHost - -mcmodel medium - - - -LTACC_HDF5_LIB -lhdf5 - - - NETCDF_PATH/bin/nf-config --flibs -LTACC_HDF5_LIB -lhdf5 - - TRILINOS_PATH - - - - - -O2 - - - --host=Linux - - - -O2 - - lustre - - NETCDF_PATH/bin/nf-config --flibs - - TRUE - - - - - -O2 - - - --host=Linux - - - -lfmpich -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o - - - -O2 - - lustre - - nf-config --flibs - - TRUE - /lustre/atlas1/cli900/world-shared/cesm/software/Trilinos/Trilinos-11.12.1/titan-pgi-cesm/install - - - - /soft/libraries/hdf5/1.8.10/cnk-xl/current/ - - - mpixlf77_r - mpixlc_r - mpixlf2003_r - /soft/libraries/netcdf/4.3.0-f4.2/cnk-xl/V1R2M0-20131211/ - /home/santos/pFUnit/pFUnit_IBM - gpfs - /soft/libraries/pnetcdf/1.3.1/cnk-xl/current/ - mpixlc_r - mpixlf2003_r - - -LNETCDF_PATH/lib -lnetcdff -lnetcdf -L/soft/libraries/hdf5/1.8.10/cnk-xl/current/lib -lhdf5_hl -lhdf5 -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib - - - - - - - - - - - - - - USERDEFINED_MUST_EDIT_THIS - - - # USERDEFINED NETCDF_PATH/bin/nc-config --flibs - - - - - - - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - - NETCDF - gpfs - PNETCDF - - - - /glade/apps/opt/lib - - - - - -xHost - - - -DINTEL_MKL -DHAVE_SSE2 - - - -xHost - - mpiicpc - /glade/apps/opt/papi/5.3.0/intel/12.1.5/include/ - /glade/apps/opt/papi/5.3.0/intel/12.1.5/lib64 - CESMDATAROOT/tools/pFUnit/pFUnit3.1_Intel15.0.1_MPI - - icc - ifort - MPICC - MPIFC - - -Wl,-rpath PAPI_LIB -LPAPI_LIB -lpapi - - TRILINOS_PATH - - - - - -DNO_MPIMOD - - pathcc - pathf95 - - - - - -O - - - -O - - - -llapack -lblas - - - - diff --git a/cime_config/cesm/machines/config_compilers.xml b/cime_config/cesm/machines/config_compilers.xml index 2779a9ea5a5..ad363759b82 100644 --- a/cime_config/cesm/machines/config_compilers.xml +++ b/cime_config/cesm/machines/config_compilers.xml @@ -1,6 +1,5 @@ - - - + + + + -D_USE_FLOW_CONTROL + FALSE - -D_USE_FLOW_CONTROL + + + + + -h noomp + -g -O0 + -O2 + + + + -DFORTRANUNDERSCORE -DNO_R16 + -DDIR=NOOP + -DDIR=NOOP + + + -s real64 + + + -f free -N 255 -h byteswapio -x dir + -h noomp + -g -O0 -K trap=fp -m1 + -O2,ipa2 -em + + + -O1,fp2,ipa0,scalar0,vector0 + + TRUE + + -Wl,--allow-multiple-definition -h byteswapio + + + + + + -mcmodel=medium -std=gnu99 + -fopenmp + -g -Wall + -O + + + -D CISM_GNU=ON + + + + -DFORTRANUNDERSCORE -DNO_R16 + + FORTRAN + + -fdefault-real-8 + + + + -mcmodel=medium -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none + -fopenmp + -g -Wall + -O + + + -O0 + + + -ffixed-form + + + -ffree-form + + FALSE + + -fopenmp + + mpicc + mpicxx + mpif90 + gcc + g++ + gfortran + TRUE - - -DFORTRAN_SAME + -DFORTRAN_SAME + -WF,-D - -g -qfullpath -qmaxmem=-1 - -qsuffix=f=f -qfixed=132 - -qsuffix=f=f90:cpp=F90 - -g -qfullpath -qmaxmem=-1 - -O2 -qstrict -qinline=auto - -O3 - -qsmp=omp - -qsmp=omp - -qsmp=omp - -qrealsize=8 - -qinitauto=7FF7FFFF -qflttrap=ov:zero:inv:en - -qsmp=omp:noopt - -qsmp=omp:noopt - -qsmp=omp:noopt - -C + + -qrealsize=8 + + + -g -qfullpath -qmaxmem=-1 + -O2 -qstrict -qinline=auto + -qsmp=omp + -qinitauto=7FF7FFFF -qflttrap=ov:zero:inv:en + -qsmp=omp:noopt + -C + + + -qsuffix=f=f -qfixed=132 + + + -qsuffix=f=f90:cpp=F90 + TRUE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 - -gopt -time - - -mp - -mp - -mp - - -Mfixed - -Mfree - -r8 - - -i4 -gopt -time -Mextend -byteswapio -Mflushz -Kieee - -O0 -g -Ktrap=fp -Mbounds -Kieee - -mp - - -O0 -g -Ktrap=fp -Mbounds -Kieee - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -time -Wl,--allow-multiple-definition - pgcc - pgf95 - pgc++ - mpicc - mpif90 - mpicxx - - CXX - - - - FALSE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 -DUSE_CUDA_FORTRAN -DCPRPGI - -gopt -time - - - -Mfixed - -Mfree - -r8 - - -i4 -gopt -time -Mextend -byteswapio -Mflushz -Kieee - -ta=nvidia -Mcuda=5.5,cc35 - -O0 -g -Ktrap=fp -Mbounds -Kieee - -mp - - -O0 -g -Ktrap=fp -Mbounds -Kieee - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -time -Wl,--allow-multiple-definition -ta=nvidia -Mcuda=5.0,cc35 - pgcc - pgf95 - pgc++ - mpicc - mpif90 - mpicxx - - CXX - - - FALSE + + -qsmp=omp + -qsmp=omp:noopt + - - -DFORTRANUNDERSCORE -DNO_R16 - -openmp - -openmp - -openmp - -free - -fixed -132 - + -DFORTRANUNDERSCORE -DNO_R16 + + + -cxxlib + + FORTRAN + + -r8 + + + -no-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source + -openmp + - -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created - -O2 -debug minimal - -O2 -debug minimal - -O0 -g - -no-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source - -no-opt-dynamic-align -fp-model precise -std=gnu99 - -O0 - -openmp - -r8 - ifort - icc - icpc - mpif90 + -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created + -O2 -debug minimal + + + -O0 + -openmp + + + -fixed -132 + + + -free + + TRUE + + -openmp + mpicc mpicxx - FORTRAN - -cxxlib - TRUE - TRUE - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl=cluster - -mkl - - - - - -DFORTRANUNDERSCORE -DNO_R16 - -openmp - -openmp - -openmp - -free - -fixed -132 - -O0 -g -check uninit -check bounds -check pointers -fpe0 - -O2 - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs - -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - -O0 -mmic - -r8 - ifort + mpif90 icc icpc - mpiifort - mpiicc - mpiicpc - FORTRAN - -cxxlib + ifort + + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl=cluster + -mkl + TRUE - TRUE - -DCPRINTEL - -mmic - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - - - - -DFORTRANUNDERSCORE -DNO_R16 - -fopenmp - -fopenmp - -fopenmp - -D CISM_GNU=ON - -ffixed-form - -ffree-form - -g -Wall - -O - -g -Wall - -O - - -mcmodel=medium -fconvert=big-endian -ffree-line-length-none -ffixed-line-length-none - -mcmodel=medium -std=gnu99 - -O0 - -fdefault-real-8 - gfortran - gcc - g++ - mpif90 - mpicc - mpicxx + + + -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR + -openmp + + + --host=x86_64-k1om-linux --build=x86_64-unknown-linux + + + + -DFORTRANUNDERSCORE -DNO_R16 + -DCPRINTEL + + + -cxxlib + FORTRAN - TRUE - FALSE - - - - - - -DFORTRANUNDERSCORE -DNO_R16 - -DDIR=NOOP - -h noomp - -h noomp - -DDIR=NOOP - -g -O0 -K trap=fp -m1 - -O2,ipa2 -em - -g -O0 - -O2 - -f free -N 255 -h byteswapio -x dir - -O1,fp2,ipa0,scalar0,vector0 - -s real64 - -Wl,--allow-multiple-definition -h byteswapio + + -r8 + + + -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs + -openmp + -O0 -g -check uninit -check bounds -check pointers -fpe0 + -O2 + + + -O0 -mmic + + + -fixed -132 + + + -free + TRUE + + -openmp + -mmic + + mpiicc + mpiicpc + mpiifort + icc + icpc + ifort + + NETCDF_PATH/bin/nf-config --flibs + + TRUE - - - nagfor - mpif90 - gcc - mpicc - - -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH - - - - -Wp,-macro=no_com -convert=BIG_ENDIAN -indirect $(CIMEROOT)/cime_config/cesm/machines/nag_mpi_argument.txt - $(FFLAGS) - -std=gnu99 - - - -ieee=full -O2 - -ieee=full - - -g - - - - -C=all -g -time -f2003 -ieee=stop - -gline - - - - -g -time -f2003 -ieee=stop - -gline - - -openmp - -openmp - -openmp - - + + -Wp,-macro=no_com -convert=BIG_ENDIAN -indirect CIMEROOT/cime_config/cesm/machines/nag_mpi_argument.txt + + -ieee=full -O2 + + + -C=all -g -time -f2003 -ieee=stop + -gline + -openmp + - -mismatch_all + -mismatch_all + + + FFLAGS + -ieee=full + + + + -g -time -f2003 -ieee=stop + -gline + -openmp + + + -fixed + + + -free + + FALSE + + -openmp + + mpicc + mpif90 + gcc + nagfor + - -r8 - -fixed - -free + + + -gopt -time + -mp + + + + + + + + + + + + + + + + + + + + + + + + + + + + -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 + + CXX + + -r8 + + + -i4 -gopt -time -Mextend -byteswapio -Mflushz -Kieee + -mp + -O0 -g -Ktrap=fp -Mbounds -Kieee + -Mnovect + -Mnovect + -Mnovect + -Mnovect + -Mnovect + -Mnovect + + + -O0 -g -Ktrap=fp -Mbounds -Kieee + -mp + + + -Mfixed + + + -Mfree + + + FALSE + + -time -Wl,--allow-multiple-definition + -mp + + mpicc + mpicxx + mpif90 + pgcc + pgc++ + pgf95 - - -DSYSDARWIN - -all_load + + + -gopt -time + + + + + + + + + + + + + + + + + + + + + + + + + + + + -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 -DUSE_CUDA_FORTRAN -DCPRPGI + + CXX + + -r8 + + + -i4 -gopt -time -Mextend -byteswapio -Mflushz -Kieee + -ta=nvidia -Mcuda=5.5,cc35 + -O0 -g -Ktrap=fp -Mbounds -Kieee + -Mnovect + -Mnovect + -Mnovect + -Mnovect + -Mnovect + -Mnovect + + + -O0 -g -Ktrap=fp -Mbounds -Kieee + -mp + + + -Mfixed + + + -Mfree + + + + FALSE + + -time -Wl,--allow-multiple-definition -ta=nvidia -Mcuda=5.0,cc35 + + mpicc + mpicxx + mpif90 + pgcc + pgc++ + pgf95 - - -heap-arrays + + + -qarch=auto -qtune=auto -qcache=auto + + /usr/bin/bash + + -qarch=auto -qtune=auto -qcache=auto -qsclk=micro + -qspill=6000 + + + -qsigtrap=xl__trcedump + -bdatapsize:64K -bstackpsize:64K -btextpsize:32K + + mpcc_r + mpxlf2003_r + cc_r + xlf2003_r + + -lmassv -lessl + -lmass + + + + + + -O3 -qstrict + -qtune=440 -qarch=440d + + + --build=powerpc-bgp-linux --host=powerpc64-suse-linux + + + -DLINUX -DnoI8 + + + -qtune=440 -qarch=440d + -O3 -qstrict -qinline=auto + -qinitauto=FF911299 -qflttrap=ov:zero:inv:en + -qextname=flush + + + -Wl,--relax -Wl,--allow-multiple-definition + + + -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts + + blrts_xlc + blrts_xlf2003 + mpich.rts + /bgl/BlueLight/ppcfloor/bglsys + blrts_xlc + blrts_xlf2003 - - USERDEFINED_MUST_EDIT_THIS - - # USERDEFINED $(shell $(NETCDF_PATH)/bin/nc-config --flibs) - - - - - + + + -qtune=450 -qarch=450 -I/bgsys/drivers/ppcfloor/arch/include/ + + + --build=powerpc-bgp-linux --host=powerpc64-suse-linux + + + -DLINUX -DnoI8 + + + -qspillsize=2500 -qtune=450 -qarch=450 + -qextname=flush + + + -Wl,--relax -Wl,--allow-multiple-definition + + + + + + --build=powerpc-bgp-linux --host=powerpc64-suse-linux + + + -DLINUX + + + -g -qfullpath -qmaxmem=-1 -qspillsize=2500 -qextname=flush + -O3 -qstrict -qinline=auto + -qsmp=omp + -qsmp=omp:noopt + + + -Wl,--relax -Wl,--allow-multiple-definition + - ftn - cc - CC - ftn + + -DCMAKE_SYSTEM_NAME=Catamount + + + -DLINUX + -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + cc CC - lustre - $(PARALLEL_NETCDF_DIR) - $(NETCDF_DIR) - -DLINUX - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - -DCMAKE_SYSTEM_NAME=Catamount --> - - - - - -O2 - -O2 - --host=Linux - -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf - -DHAVE_PAPI - - - - -O2 - -O2 - $(NETCDFROOT) - $(PNETCDFROOT) - /projects/ccsm/esmf-6.3.0rp1/lib/libO/Linux.intel.64.openmpi.default - --host=Linux - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -L/projects/ccsm/BLAS-intel -lblas_LINUX - lustre - - - ftn - cc - CC - -O2 -xMIC-AVX512 - -O2 -xMIC-AVX512 - -O0 -g -xMIC-AVX512 - -O0 -g -xMIC-AVX512 - -qopenmp - -qopenmp - -qopenmp - -qopenmp - --host=Linux - -L$(NETCDF_DIR)/lib -lnetcdff -L$(NETCDF_DIR)/lib -lnetcdf -Wl,-rpath -Wl,$(NETCDF_DIR)/lib - -mkl -lpthread -lm - -DHAVE_COMM_F2C - - - - -O2 - -O2 - --host=Linux - $(NETCDFROOT) - $(PNETCDFROOT) - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -lblas -llapack - -lstdc++ -lmpi_cxx - /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install + NETCDF_DIR + lustre + PARALLEL_NETCDF_DIR + cc + CC + ftn - - /glade/apps/opt/lib + + + -DSYSDARWIN + + + -all_load + - - gpfs - $(NETCDF) - $(PNETCDF) - - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + + + -heap-arrays + - - gpfs - $(NETCDF) - $(PNETCDF) - - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + + + -xHost -no-save-temps + + + --host=Linux + + + -DHAVE_NANOTIME -DCPRINTEL + + + -xHost -no-save-temps + + + NETCDF + + mpiicc + mpiicpc + mpiifort + + NETCDF_DIR + PNETCDF_DIR + icc + ifort + + NETCDf MKL + - - - - - $(MPICC) - $(MPIFC) - mpiicpc - -xHost - -xHost - -DINTEL_MKL -DHAVE_SSE2 - $(TRILINOS_PATH) - /glade/apps/opt/papi/5.3.0/intel/12.1.5/include/ - /glade/apps/opt/papi/5.3.0/intel/12.1.5/lib64 - -Wl,-rpath ${PAPI_LIB} -L${PAPI_LIB} -lpapi - -mcmodel medium + + + -mmic -O3 -fp-model precise -DFORTRANUNDERSCORE -no-save-temps + + + --host=x86_64-k1om-linux --build=x86_64-unknown-linux + + + -DHAVE_NANOTIME -DCPRINTELMIC -DCPRINTEL + + + + -O0 -g -check all -check noarg_temp_created + -O3 -mP2OPT_hpo_matrix_opt_framework=0 + -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -no-save-temps -no-opt-dynamic-align + + + -O0 -mmic + + + NETCDF -mmic + + mpiicc + mpiicpc + mpiifort + + NETCDF_DIR + PNETCDF_DIR + icc + ifort + + NETCDF MKL + - - - - $ENV{CESMDATAROOT}/tools/pFUnit/pFUnit3.1_Intel15.0.1_MPI + + + -DHAVE_PAPI + + lustre - - -O - -O - -llapack -lblas + + + -O2 + -nofma + + + -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o + + + -O2 + -nofma + + TRUE - - -DNO_MPIMOD - pathcc - pathf95 + + + --host=LINUX + + mpich + mpi + MPI_ROOT + NETCDF + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + + NETCDF_HOME + lustre + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi -LMKL_PATH -lmkl_rt + + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + + NETCDF_HOME + lustre + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi + + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + + NETCDF_HOME + lustre + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi + + + + + + -O2 + -nomp + + + --host=Linux + + + -DLINUX + + + -O2 + -nomp + + + -nomp + + NETCDF_HOME + lustre + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi + + + + + + -O2 + + + --host=Linux + + + -DHAVE_PAPI + + + -O2 + + + -LNETCDF_DIR -lnetcdff -Wl,--as-needed,-LNETCDF_DIR/lib -lnetcdff -lnetcdf + - -gpfs - $(NETCDF) - $(PNETCDF) - - -DNO_MPI2 + + + -DNO_MPI2 + + NETCDF + gpfs + PNETCDF mpicc mpif90 - - -O2 - -O2 - --host=Linux - lustre - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - TRUE - - - - -O2 - -O2 - --host=Linux - lustre - $(shell nf-config --flibs) - /lustre/atlas1/cli900/world-shared/cesm/software/Trilinos/Trilinos-11.12.1/titan-pgi-cesm/install - -lfmpich -lmpichf90_pgi $(PGI_PATH)/linux86-64/$(PGI_VERSION)/lib/f90main.o - TRUE - - - - -O2 - -O2 - -nofma - -nofma - -lmpichf90_pgi $(PGI_PATH)/linux86-64/$(PGI_VERSION)/lib/f90main.o - TRUE - - - - lustre - -DHAVE_PAPI + + + -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + + /usr/lib64 + mpi + + NETCDF_PATH/bin/nf-config --flibs + + + + + + -Wl,-rpath,NETCDF_PATH/lib + -Wl,-rpath,COMPILER_PATH/lib/intel64 + -Wl,-rpath,COMPILER_PATH/mkl/lib/intel64 + + /home/santos/pFUnit/pFUnit_Intel_3_0 + + + + + -DNO_C_SIZEOF + + + + -kind=byte + + + + -L/home/santos/lib/fake_omp -lfake_omp -Wl,-Wl,,--rpath=/home/santos/lib/fake_omp + + /usr/local/openmpi-gcc-nag + /usr/local/netcdf-gcc-nag + /home/santos/pFUnit/pFUnit_NAG_3_0 + + + + + -O0 + + + -O0 + + + -lgomp + -Wl,-RNETCDF_PATH/lib + -Wl,-RCOMPILER_PATH/lib + -Wl,-RCOMPILER_PATH/libso + + + + + + -O2 + + + -O2 + + + -Wl,-rpath /usr/local/tools/netcdf-pgi-4.1.3/lib + + mpich + /usr/local/tools/mvapich2-pgi-1.7/ + /usr/local/tools/netcdf-pgi-4.1.3 + + /usr/local/tools/netcdf-pgi-4.1.3/bin/nc-config --flibs + - - - /usr/bin/bash - xlf2003_r - mpxlf2003_r - cc_r - mpcc_r - -qarch=auto -qtune=auto -qcache=auto - -qarch=auto -qtune=auto -qcache=auto -qsclk=micro - -qsigtrap=xl__trcedump - -qspill=6000 - -bdatapsize:64K -bstackpsize:64K -btextpsize:32K - -lmassv -lessl - -lmass - - - - -qtune=440 -qarch=440d - -qtune=440 -qarch=440d - /bgl/BlueLight/ppcfloor/bglsys - mpich.rts - blrts_xlf2003 - blrts_xlf2003 - blrts_xlc - blrts_xlc - -O3 -qstrict - -O3 -qstrict -qinline=auto - -qinitauto=FF911299 -qflttrap=ov:zero:inv:en - -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts - -DLINUX -DnoI8 - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - -Wl,--relax -Wl,--allow-multiple-definition - -qextname=flush + + + -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + + /usr/lib64 + mpich + NETCDF_PATH + + NETCDF_PATH/bin/nf-config --flibs + + + + + + -lifcore + + + -lifcore + -mcmodel medium + + + -lquadmath + -Wl,-rpath,NETCDF_PATH/lib + -Wl,-rpath,COMPILER_PATH/lib/intel64 + -Wl,-rpath,COMPILER_PATH/mkl/lib/intel64 + -Wl,-rpath,MPI_PATH/lib + -lifcore + + /home/santos/pFUnit/pFUnit_Intel_3_0 + + -mkl=cluster + + + + + + + -DNO_C_SIZEOF + + + -lpthread + + /home/santos/pFUnit/pFUnit_NAG_3_0 + + + + + -O0 + + + -O0 + + + -lgomp + -Wl,-RNETCDF_PATH/lib + -Wl,-RCOMPILER_PATH/lib + -Wl,-RCOMPILER_PATH/libso + + + + + /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-gnu/install - - -qtune=450 -qarch=450 -I/bgsys/drivers/ppcfloor/arch/include/ - -qspillsize=2500 -qtune=450 -qarch=450 - -DLINUX -DnoI8 - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - -Wl,--relax -Wl,--allow-multiple-definition - -qextname=flush + + /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libO/Unicos.intel.64.mpi.default/ + /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libg/Unicos.intel.64.mpi.default/ + + NETCDF_PATH/bin/nf-config --flibs + + + + + + -O2 + + + -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o + + + -O2 + + TRUE + /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-pgi/install - - - -g -qfullpath -qmaxmem=-1 -qspillsize=2500 -qextname=flush - -O3 -qstrict -qinline=auto - -qsmp=omp - -qsmp=omp:noopt - -DLINUX - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - -Wl,--relax -Wl,--allow-multiple-definition + + mpixlc_r + mpixlf2003_r + /bgsys/local/netcdf/ + gpfs + /bgsys/local/parallel-netcdf/v1.3.1 + mpixlc_r + mpixlf2003_r + + -L/bgsys/local/netcdf/lib -lnetcdf -L/bgsys/drivers/ppcfloor/comm/lib + - - - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlf2003_r - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlf2003_r - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlc_r - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlc_r + + /projects/install/rhel6-x86_64/ACME/AlbanyTrilinos/Albany/build/install + + -O2 + + + --host=Linux + + + -lstdc++ -lmpi_cxx + + + -O2 + + NETCDFROOT + PNETCDFROOT + + NETCDF_PATH/bin/nf-config --flibs -lblas -llapack + + + + + + -qfloat=nomaf + + + -qfloat=nomaf + + HDF5 - /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlf77_r + /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlf77_r + /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlc_r + /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlf2003_r /soft/libraries/netcdf/4.3.3-f4.4.1/cnk-xl/current/ - /soft/libraries/pnetcdf/1.6.1/cnk-xl/current/ - /home/santos/pFUnit/pFUnit_IBM - $(HDF5) - -L$(NETCDF_PATH)/lib -lnetcdff -lnetcdf -L$(HDF5)/lib -lhdf5_hl -lhdf5 -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib - gpfs - -qfloat=nomaf - -qfloat=nomaf - - - - - mpixlf2003_r - mpixlf2003_r - mpixlc_r - mpixlc_r - - - mpixlf77_r - /soft/libraries/netcdf/4.3.0-f4.2/cnk-xl/V1R2M0-20131211/ - /soft/libraries/pnetcdf/1.3.1/cnk-xl/current/ /home/santos/pFUnit/pFUnit_IBM - /soft/libraries/hdf5/1.8.10/cnk-xl/current/ - -L$(NETCDF_PATH)/lib -lnetcdff -lnetcdf -L/soft/libraries/hdf5/1.8.10/cnk-xl/current/lib -lhdf5_hl -lhdf5 -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib - gpfs - - - - mpixlf2003_r - mpixlf2003_r - mpixlc_r - mpixlc_r - /bgsys/local/netcdf/ - /bgsys/local/parallel-netcdf/v1.3.1 - -L/bgsys/local/netcdf/lib -lnetcdf -L/bgsys/drivers/ppcfloor/comm/lib gpfs - - - - $(NETCDF) - $(MPI_ROOT) - mpich - mpi - --host=LINUX - - - - -O2 - -O2 - -nomp - -nomp - -nomp - $(NETCDF_HOME) - --host=Linux - lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi - - - - -O2 - -O2 - $(NETCDF_HOME) - --host=Linux - lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi - - - - -O2 - -O2 - $(NETCDF_HOME) - --host=Linux - lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi - - - - -O2 - -O2 - $(NETCDF_HOME) - --host=Linux - lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi -L$(MKL_PATH) -lmkl_rt - - - - -O2 - -O2 - $(NETCDF_LIB)/.. - --host=Linux + /soft/libraries/pnetcdf/1.6.1/cnk-xl/current/ + /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlc_r + /home/pkcoff/mpich-sandboxes/master/install-production/bin/mpixlf2003_r + + -LNETCDF_PATH/lib -lnetcdff -lnetcdf -LHDF5/lib -lhdf5_hl -lhdf5 -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib + + + + + + -O2 + + + --host=Linux + + + -DLINUX + + + -O2 + + NETCDF_LIB/.. lustre - -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi + + -LNETCDF_PATH/lib -lnetcdf -lnetcdff -lpmi + - - -O2 - -O2 - /usr/local/tools/netcdf-pgi-4.1.3 - /usr/local/tools/mvapich2-pgi-1.7/ - mpich - $(shell /usr/local/tools/netcdf-pgi-4.1.3/bin/nc-config --flibs) - -Wl,-rpath /usr/local/tools/netcdf-pgi-4.1.3/lib - - - - -O2 - -O2 - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-pgi/install - -lmpichf90_pgi $(PGI_PATH)/linux86-64/$(PGI_VERSION)/lib/f90main.o - TRUE - - - - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libO/Unicos.intel.64.mpi.default/ - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libg/Unicos.intel.64.mpi.default/ - - - - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-gnu/install + + + -O2 -aCORE-AVX2 -align array32byte + + icc + mpi + MPI_ROOT + /nasa/netcdf/4.1.3/intel/mpt + + -LNETCDF_DIR/lib -lnetcdff -lnetcdf + - - /nasa/netcdf/4.1.3/intel/mpt - $(MPI_ROOT) - mpi + + + -O2 -xAVX + icc - -O2 -xSSE4.2 - -L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf + mpi + MPI_ROOT + /nasa/netcdf/4.1.3/intel/mpt + + -LNETCDF_DIR/lib -lnetcdff -lnetcdf + - /nasa/netcdf/4.1.3/intel/mpt - $(MPI_ROOT) - mpi + + -O2 -xAVX + icc - -O2 -xAVX - -L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf + mpi + MPI_ROOT + /nasa/netcdf/4.1.3/intel/mpt + + -LNETCDF_DIR/lib -lnetcdff -lnetcdf + - - /nasa/netcdf/4.1.3/intel/mpt - $(MPI_ROOT) - mpi + + + -O2 -xSSE4.2 + icc - -O2 -xAVX - -L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf + mpi + MPI_ROOT + /nasa/netcdf/4.1.3/intel/mpt + + -LNETCDF_DIR/lib -lnetcdff -lnetcdf + - - /nasa/netcdf/4.1.3/intel/mpt - $(MPI_ROOT) - mpi - icc - -O2 -aCORE-AVX2 -align array32byte - -L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf + + + -xHost + + + -xHost + + + -LTACC_HDF5_LIB -lhdf5 + + mpiicc + mpicpc + mpiifort + icc + icpc + ifort + + NETCDF_PATH/bin/nf-config --flibs -LTACC_HDF5_LIB -lhdf5 + + TRILINOS_PATH - /usr/local/tools/netcdf-pgi-4.1.3 - /usr/local/tools/mvapich2-pgi-1.7/ + + -Wl,-rpath /usr/local/tools/netcdf-pgi-4.1.3/lib + mpich - $(shell /usr/local/tools/netcdf-pgi-4.1.3/bin/nc-config --flibs) - -Wl,-rpath /usr/local/tools/netcdf-pgi-4.1.3/lib + /usr/local/tools/mvapich2-pgi-1.7/ + /usr/local/tools/netcdf-pgi-4.1.3 + + /usr/local/tools/netcdf-pgi-4.1.3/bin/nc-config --flibs + + + + + + -O2 + + + --host=Linux + + /projects/ccsm/esmf-6.3.0rp1/lib/libO/Linux.intel.64.openmpi.default + + -O2 + + NETCDFROOT + lustre + PNETCDFROOT + + NETCDF_PATH/bin/nf-config --flibs -L/projects/ccsm/BLAS-intel -lblas_LINUX + + + + -DHAVE_NANOTIME + + TACC_NETCDF_DIR + lustre + TACC_PNETCDF_DIR + - - mpi - /usr/lib64 - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + + + -xHost + + + -xHost + -mcmodel medium + + + -LTACC_HDF5_LIB -lhdf5 + + + NETCDF_PATH/bin/nf-config --flibs -LTACC_HDF5_LIB -lhdf5 + + TRILINOS_PATH + + + + + -O2 + + + --host=Linux + + + -O2 + + lustre + + NETCDF_PATH/bin/nf-config --flibs + + TRUE - - -Wl,-rpath,$(NETCDF_PATH)/lib - -Wl,-rpath,$(COMPILER_PATH)/lib/intel64 - -Wl,-rpath,$(COMPILER_PATH)/mkl/lib/intel64 - /home/santos/pFUnit/pFUnit_Intel_3_0 + + + -O2 + + + --host=Linux + + + -lfmpich -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o + + + -O2 + + lustre + + nf-config --flibs + + TRUE + /lustre/atlas1/cli900/world-shared/cesm/software/Trilinos/Trilinos-11.12.1/titan-pgi-cesm/install - - -O0 - -O0 - -lgomp - -Wl,-R$(NETCDF_PATH)/lib - -Wl,-R$(COMPILER_PATH)/lib - -Wl,-R$(COMPILER_PATH)/libso + + /soft/libraries/hdf5/1.8.10/cnk-xl/current/ + + + mpixlf77_r + mpixlc_r + mpixlf2003_r + /soft/libraries/netcdf/4.3.0-f4.2/cnk-xl/V1R2M0-20131211/ + /home/santos/pFUnit/pFUnit_IBM + gpfs + /soft/libraries/pnetcdf/1.3.1/cnk-xl/current/ + mpixlc_r + mpixlf2003_r + + -LNETCDF_PATH/lib -lnetcdff -lnetcdf -L/soft/libraries/hdf5/1.8.10/cnk-xl/current/lib -lhdf5_hl -lhdf5 -L/soft/libraries/alcf/current/xl/ZLIB/lib -lz -L/soft/libraries/alcf/current/xl/LAPACK/lib -llapack -L/soft/libraries/alcf/current/xl/BLAS/lib -lblas -L/bgsys/drivers/ppcfloor/comm/sys/lib + - - mpich - /usr/lib64 - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - - - - -lquadmath - -Wl,-rpath,$(NETCDF_PATH)/lib - -Wl,-rpath,$(COMPILER_PATH)/lib/intel64 - -Wl,-rpath,$(COMPILER_PATH)/mkl/lib/intel64 - -Wl,-rpath,$(MPI_PATH)/lib - -mkl=cluster - -lifcore - -lifcore - -lifcore - /home/santos/pFUnit/pFUnit_Intel_3_0 - -mcmodel medium - - - - -O0 - -O0 - -lgomp - -Wl,-R$(NETCDF_PATH)/lib - -Wl,-R$(COMPILER_PATH)/lib - -Wl,-R$(COMPILER_PATH)/libso - - - - /home/santos/pFUnit/pFUnit_NAG_3_0 - - -DNO_C_SIZEOF - -lpthread - - - - - - /usr/local/netcdf-gcc-nag - /usr/local/openmpi-gcc-nag - /home/santos/pFUnit/pFUnit_NAG_3_0 - - -kind=byte - -DNO_C_SIZEOF - - -L/home/santos/lib/fake_omp -lfake_omp -Wl,-Wl,,--rpath=/home/santos/lib/fake_omp + + + + + + + + + + + USERDEFINED_MUST_EDIT_THIS + + + # USERDEFINED NETCDF_PATH/bin/nc-config --flibs + - - lustre - $(TACC_NETCDF_DIR) - $(TACC_PNETCDF_DIR) - -DHAVE_NANOTIME + + + + -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY + + NETCDF + gpfs + PNETCDF - - -xHost - -xHost - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -L$(TACC_HDF5_LIB) -lhdf5 - -L$(TACC_HDF5_LIB) -lhdf5 - $(TRILINOS_PATH) - -mcmodel medium + + /glade/apps/opt/lib - - mpiifort - mpiicc - mpiicpc - ifort - icc - -xHost -no-save-temps - -xHost -no-save-temps - - $(NETCDF_DIR) - $(PNETCDF_DIR) - -DHAVE_NANOTIME -DCPRINTEL - --host=Linux - $(NETCDf) $(MKL) - $(NETCDF) + + + -xHost + + + -DINTEL_MKL -DHAVE_SSE2 + + + -xHost + + mpiicpc + /glade/apps/opt/papi/5.3.0/intel/12.1.5/include/ + /glade/apps/opt/papi/5.3.0/intel/12.1.5/lib64 + CESMDATAROOT/tools/pFUnit/pFUnit3.1_Intel15.0.1_MPI + + icc + ifort + MPICC + MPIFC + + -Wl,-rpath PAPI_LIB -LPAPI_LIB -lpapi + + TRILINOS_PATH - - mpiifort - mpiicc - mpiicpc - ifort - icc - - $(NETCDF_DIR) - $(PNETCDF_DIR) - -DHAVE_NANOTIME -DCPRINTELMIC -DCPRINTEL - $(NETCDF) $(MKL) - $(NETCDF) -mmic - - -O0 -g -check all -check noarg_temp_created - -O3 -mP2OPT_hpo_matrix_opt_framework=0 - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -no-save-temps -no-opt-dynamic-align - -mmic -O3 -fp-model precise -DFORTRANUNDERSCORE -no-save-temps - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - -O0 -mmic + + + -DNO_MPIMOD + + pathcc + pathf95 - - mpiicc - mpiifort - mpicpc - ifort - icc - icpc - -xHost - -xHost - $(shell $(NETCDF_PATH)/bin/nf-config --flibs) -L$(TACC_HDF5_LIB) -lhdf5 - -L$(TACC_HDF5_LIB) -lhdf5 - $(TRILINOS_PATH) + + + -O + + + -O + + + -llapack -lblas + diff --git a/cime_config/xml_schemas/config_build.xsd b/cime_config/xml_schemas/config_compilers_v2.xsd similarity index 100% rename from cime_config/xml_schemas/config_build.xsd rename to cime_config/xml_schemas/config_compilers_v2.xsd From d39d236f98d556eab8f6c11e1dbc94379fb666f1 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 22 Nov 2016 17:03:52 -0700 Subject: [PATCH 09/20] file cleanup --- .../cesm/machines/config_compilers.xml | 427 +----------------- 1 file changed, 6 insertions(+), 421 deletions(-) diff --git a/cime_config/cesm/machines/config_compilers.xml b/cime_config/cesm/machines/config_compilers.xml index ad363759b82..eb8d93b228f 100644 --- a/cime_config/cesm/machines/config_compilers.xml +++ b/cime_config/cesm/machines/config_compilers.xml @@ -215,8 +215,8 @@ for mct, etc. - -no-opt-dynamic-align -fp-model precise -std=gnu99 - -openmp + -qno-opt-dynamic-align -fp-model precise -std=gnu99 + -qopenmp -O2 -debug minimal -O0 -g @@ -232,20 +232,14 @@ for mct, etc. -r8 - -no-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source - -openmp - + -qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source + -qopenmp -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created -O2 -debug minimal -O0 - -openmp + -qopenmp -fixed -132 @@ -255,7 +249,7 @@ for mct, etc. TRUE - -openmp + -qopenmp mpicc mpicxx @@ -276,58 +270,6 @@ for mct, etc. TRUE - - - -mmic -O2 -fp-model precise -DFORTRANUNDERSCOR - -openmp - - - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - - - - -DFORTRANUNDERSCORE -DNO_R16 - -DCPRINTEL - - - -cxxlib - - FORTRAN - - -r8 - - - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs - -openmp - -O0 -g -check uninit -check bounds -check pointers -fpe0 - -O2 - - - -O0 -mmic - - - -fixed -132 - - - -free - - TRUE - - -openmp - -mmic - - mpiicc - mpiicpc - mpiifort - icc - icpc - ifort - - NETCDF_PATH/bin/nf-config --flibs - - TRUE - - -std=gnu99 @@ -459,81 +401,6 @@ for mct, etc. pgf95 - - - -gopt -time - - - - - - - - - - - - - - - - - - - - - - - - - - - - -DFORTRANUNDERSCORE -DNO_SHR_VMATH -DNO_R16 -DUSE_CUDA_FORTRAN -DCPRPGI - - CXX - - -r8 - - - -i4 -gopt -time -Mextend -byteswapio -Mflushz -Kieee - -ta=nvidia -Mcuda=5.5,cc35 - -O0 -g -Ktrap=fp -Mbounds -Kieee - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - -Mnovect - - - -O0 -g -Ktrap=fp -Mbounds -Kieee - -mp - - - -Mfixed - - - -Mfree - - - - FALSE - - -time -Wl,--allow-multiple-definition -ta=nvidia -Mcuda=5.0,cc35 - - mpicc - mpicxx - mpif90 - pgcc - pgc++ - pgf95 - - -qarch=auto -qtune=auto -qcache=auto @@ -557,56 +424,6 @@ for mct, etc. - - - -O3 -qstrict - -qtune=440 -qarch=440d - - - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - - - -DLINUX -DnoI8 - - - -qtune=440 -qarch=440d - -O3 -qstrict -qinline=auto - -qinitauto=FF911299 -qflttrap=ov:zero:inv:en - -qextname=flush - - - -Wl,--relax -Wl,--allow-multiple-definition - - - -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts -lmsglayer.rts -lrts.rts -ldevices.rts - - blrts_xlc - blrts_xlf2003 - mpich.rts - /bgl/BlueLight/ppcfloor/bglsys - blrts_xlc - blrts_xlf2003 - - - - - -qtune=450 -qarch=450 -I/bgsys/drivers/ppcfloor/arch/include/ - - - --build=powerpc-bgp-linux --host=powerpc64-suse-linux - - - -DLINUX -DnoI8 - - - -qspillsize=2500 -qtune=450 -qarch=450 - -qextname=flush - - - -Wl,--relax -Wl,--allow-multiple-definition - - - --build=powerpc-bgp-linux --host=powerpc64-suse-linux @@ -659,70 +476,6 @@ for mct, etc. - - - -xHost -no-save-temps - - - --host=Linux - - - -DHAVE_NANOTIME -DCPRINTEL - - - -xHost -no-save-temps - - - NETCDF - - mpiicc - mpiicpc - mpiifort - - NETCDF_DIR - PNETCDF_DIR - icc - ifort - - NETCDf MKL - - - - - - -mmic -O3 -fp-model precise -DFORTRANUNDERSCORE -no-save-temps - - - --host=x86_64-k1om-linux --build=x86_64-unknown-linux - - - -DHAVE_NANOTIME -DCPRINTELMIC -DCPRINTEL - - - - -O0 -g -check all -check noarg_temp_created - -O3 -mP2OPT_hpo_matrix_opt_framework=0 - -mmic -fp-model source -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -no-save-temps -no-opt-dynamic-align - - - -O0 -mmic - - - NETCDF -mmic - - mpiicc - mpiicpc - mpiifort - - NETCDF_DIR - PNETCDF_DIR - icc - ifort - - NETCDF MKL - - - -DHAVE_PAPI @@ -745,16 +498,6 @@ for mct, etc. TRUE - - - --host=LINUX - - mpich - mpi - MPI_ROOT - NETCDF - - -O2 @@ -858,70 +601,6 @@ for mct, etc. - - - - -DNO_MPI2 - - NETCDF - gpfs - PNETCDF - mpicc - mpif90 - - - - - -DHAVE_NANOTIME -DBIT64 -DHAVE_VPRINTF -DHAVE_BACKTRACE -DHAVE_SLASHPROC -DHAVE_COMM_F2C -DHAVE_TIMES -DHAVE_GETTIMEOFDAY - - /usr/lib64 - mpi - - NETCDF_PATH/bin/nf-config --flibs - - - - - - -Wl,-rpath,NETCDF_PATH/lib - -Wl,-rpath,COMPILER_PATH/lib/intel64 - -Wl,-rpath,COMPILER_PATH/mkl/lib/intel64 - - /home/santos/pFUnit/pFUnit_Intel_3_0 - - - - - -DNO_C_SIZEOF - - - - -kind=byte - - - - -L/home/santos/lib/fake_omp -lfake_omp -Wl,-Wl,,--rpath=/home/santos/lib/fake_omp - - /usr/local/openmpi-gcc-nag - /usr/local/netcdf-gcc-nag - /home/santos/pFUnit/pFUnit_NAG_3_0 - - - - - -O0 - - - -O0 - - - -lgomp - -Wl,-RNETCDF_PATH/lib - -Wl,-RCOMPILER_PATH/lib - -Wl,-RCOMPILER_PATH/libso - - - -O2 @@ -1000,32 +679,6 @@ for mct, etc. - - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-gnu/install - - - - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libO/Unicos.intel.64.mpi.default/ - /project/projectdirs/ccsm1/esmf/ESMF_5_3_0_intel12.1.5/lib/libg/Unicos.intel.64.mpi.default/ - - NETCDF_PATH/bin/nf-config --flibs - - - - - - -O2 - - - -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o - - - -O2 - - TRUE - /project/projectdirs/ccsm1/Trilinos/trilinos-10.12.2/hopper-pgi/install - - mpixlc_r mpixlf2003_r @@ -1156,28 +809,6 @@ for mct, etc. - - - -xHost - - - -xHost - - - -LTACC_HDF5_LIB -lhdf5 - - mpiicc - mpicpc - mpiifort - icc - icpc - ifort - - NETCDF_PATH/bin/nf-config --flibs -LTACC_HDF5_LIB -lhdf5 - - TRILINOS_PATH - - -Wl,-rpath /usr/local/tools/netcdf-pgi-4.1.3/lib @@ -1235,44 +866,6 @@ for mct, etc. TRILINOS_PATH - - - -O2 - - - --host=Linux - - - -O2 - - lustre - - NETCDF_PATH/bin/nf-config --flibs - - TRUE - - - - - -O2 - - - --host=Linux - - - -lfmpich -lmpichf90_pgi PGI_PATH/linux86-64/PGI_VERSION/lib/f90main.o - - - -O2 - - lustre - - nf-config --flibs - - TRUE - /lustre/atlas1/cli900/world-shared/cesm/software/Trilinos/Trilinos-11.12.1/titan-pgi-cesm/install - - /soft/libraries/hdf5/1.8.10/cnk-xl/current/ @@ -1347,14 +940,6 @@ for mct, etc. TRILINOS_PATH - - - -DNO_MPIMOD - - pathcc - pathf95 - - -O From 0414f4744193249ad45d7cfd09fd8ad5513e8f8f Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 23 Nov 2016 15:31:57 +0000 Subject: [PATCH 10/20] update for theta --- .../cesm/machines/config_compilers.xml | 25 ++-- cime_config/cesm/machines/config_machines.xml | 122 +++++++++--------- tools/configure | 1 + 3 files changed, 78 insertions(+), 70 deletions(-) diff --git a/cime_config/cesm/machines/config_compilers.xml b/cime_config/cesm/machines/config_compilers.xml index eb8d93b228f..e8d3ec8b4e6 100644 --- a/cime_config/cesm/machines/config_compilers.xml +++ b/cime_config/cesm/machines/config_compilers.xml @@ -6,7 +6,6 @@ This file defines compiler flags for building CESM. General flags are listed fi followed by flags specific to particular operating systems, followed by particular machines. More general flags are replaced by more specific flags. -Flags of the sort ADD_FLAG indicate that the field should be appended to an already existing FLAG definition. Attributes indicate that an if clause should be added to the Macros so that these flags are added only under the conditions described by the attribute(s). @@ -14,8 +13,6 @@ only under the conditions described by the attribute(s). The env_mach_specific file may set environment variables or load modules which set environment variables which are then used in the Makefile. For example the NETCDF_PATH on many machines is set by a module. -Do not use variables CPPDEFS and SLIBS here, instead use ADD_CPPDEFS and ADD_SLIBS - ======================================================================== Serial/MPI compiler specification ======================================================================== @@ -67,12 +64,6 @@ a C++ linker. If CXX_LINKER=FORTRAN, then the above CXX_LDFLAGS line should specify extra LDFLAGS needed when linking C++ and fortran code using a fortran linker. -These should NOT be specified via or -, because those mess up the configure step -for mct, etc. - - -=========================== --> @@ -866,6 +857,22 @@ for mct, etc. TRILINOS_PATH + + + -xMIC-AVX512 + + + -xMIC-AVX512 + + + --host=Linux + + + -L$(NETCDF_DIR)/lib -lnetcdff -L$(NETCDF_DIR)/lib -lnetcdf -Wl,-rpath -Wl,$(NETCDF_DIR)/lib + + + + /soft/libraries/hdf5/1.8.10/cnk-xl/current/ diff --git a/cime_config/cesm/machines/config_machines.xml b/cime_config/cesm/machines/config_machines.xml index 1d009cc6ef1..85eb1d08835 100644 --- a/cime_config/cesm/machines/config_machines.xml +++ b/cime_config/cesm/machines/config_machines.xml @@ -39,7 +39,7 @@ The attributes used to choose the mpirun command are: mpilib: can either be 'default' the name of an mpi library, or a compiler name so one can choose the mpirun - based on the mpi library in use. + based on the mpi library in use. the 'executable' tag must have arguments required for the chosen mpirun, as well as the executable name. @@ -120,8 +120,8 @@ cmake/3.1.3 darshan - /sw/modulefiles/CESM - CESM-ENV + /sw/modulefiles/CESM + CESM-ENV @@ -218,18 +218,18 @@ srun - --mpi=none - --ntasks=$TOTALPES - --cpu_bind=sockets --cpu_bind=verbose - --kill-on-bad-exit + --mpi=none + --ntasks=$TOTALPES + --cpu_bind=sockets --cpu_bind=verbose + --kill-on-bad-exit srun - --ntasks=$TOTALPES - --cpu_bind=sockets --cpu_bind=verbose - --kill-on-bad-exit + --ntasks=$TOTALPES + --cpu_bind=sockets --cpu_bind=verbose + --kill-on-bad-exit @@ -357,7 +357,7 @@ esmf/6.3.0rp1-defio-intel2016-mpi-O - esmf/6.3.0rp1-defio-intel2016-mpiuni-O + esmf/6.3.0rp1-defio-intel2016-mpiuni-O @@ -458,7 +458,7 @@ esmf/6.3.0rp1-defio-intel2016-mpi-O - esmf/6.3.0rp1-defio-intel2016-mpiuni-O + esmf/6.3.0rp1-defio-intel2016-mpiuni-O @@ -509,7 +509,7 @@ $CIME_OUTPUT_ROOT/archive/$CASE /projects/EarlyPerf_theta/cesm/csm/$CASE /projects/EarlyPerf_theta/cesm/baselines - /projects/EarlyPerf_theta/cesm/tools/cprnc + /projects/EarlyPerf_theta/cesm/tools/cprnc/cprnc /projects/EarlyPerf_theta/cesm CNL cobalt_theta @@ -523,11 +523,11 @@ aprun - -n $TOTALPES - -N $PES_PER_NODE - --cc depth -d $OMP_NUM_THREADS - -e OMP_STACKSIZE=64M - -e OMP_NUM_THREADS=$OMP_NUM_THREADS + -n $TOTALPES + -N $PES_PER_NODE + --cc depth -d $OMP_NUM_THREADS + -e OMP_STACKSIZE=64M + -e OMP_NUM_THREADS=$OMP_NUM_THREADS @@ -540,51 +540,51 @@ module module - PrgEnv-intel - PrgEnv-cray - PrgEnv-gnu - intel - cce - cray-parallel-netcdf - cray-hdf5-parallel - pmi - cray-libsci - cray-mpich - cray-netcdf - cray-hdf5 - cray-netcdf-hdf5parallel - craype-mic-knl - craype + PrgEnv-intel + PrgEnv-cray + PrgEnv-gnu + intel + cce + cray-parallel-netcdf + cray-hdf5-parallel + pmi + cray-libsci + cray-mpich + cray-netcdf + cray-hdf5 + cray-netcdf-hdf5parallel + craype-mic-knl + craype - PrgEnv-intel/6.0.3 - intel intel/17.0.0.098 - cray-libsci + PrgEnv-intel/6.0.3 + intel intel/17.0.0.098 + cray-libsci - PrgEnv-cray/6.0.3 - cce cce/8.5.4 + PrgEnv-cray/6.0.3 + cce cce/8.5.4 - PrgEnv-gnu/6.0.3 - gcc gcc/6.2.0 + PrgEnv-gnu/6.0.3 + gcc gcc/6.2.0 - papi/5.4.3.3 - craype craype/2.5.7 + papi/5.4.3.3 + craype craype/2.5.7 - cray-libsci/16.09.1 + cray-libsci/16.09.1 - cray-mpich/7.4.4 + cray-mpich/7.4.4 - cray-netcdf-hdf5parallel/4.4.1 - cray-hdf5-parallel/1.10.0 - cray-parallel-netcdf/1.7.0 + cray-netcdf-hdf5parallel/4.4.1 + cray-hdf5-parallel/1.10.0 + cray-parallel-netcdf/1.7.0 @@ -634,9 +634,9 @@ module - perl/5.20.7 - cmake/3.0.0 - pgi/15.5 + perl/5.20.7 + cmake/3.0.0 + pgi/15.5 mpi/mvapich2/1.5.1p1/pgi11.3 netcdf/4.1.2/pgi @@ -711,7 +711,7 @@ esmf/6.3.0rp1-defio-intel15.0-mpi-O - esmf/6.3.0rp1-defio-intel15.0-mpiuni-O + esmf/6.3.0rp1-defio-intel15.0-mpiuni-O PrgEnv-cray @@ -941,7 +941,7 @@ netcdf/4.4.1 - netcdf-mpi/4.4.1 + netcdf-mpi/4.4.1 @@ -978,7 +978,7 @@ mpirun - -np $TOTALPES + -np $TOTALPES @@ -1128,7 +1128,7 @@ mpiexec_mpt - -n $TOTALPES + -n $TOTALPES @@ -1231,7 +1231,7 @@ mpiexec_mpt - -n $TOTALPES + -n $TOTALPES @@ -1283,7 +1283,7 @@ mpiexec_mpt - -n $TOTALPES + -n $TOTALPES @@ -1331,9 +1331,9 @@ aprun - -n $TOTALPES - -N $PES_PER_NODE - -d $ENV{OMP_NUM_THREADS} + -n $TOTALPES + -N $PES_PER_NODE + -d $ENV{OMP_NUM_THREADS} @@ -1374,8 +1374,8 @@ mpirun - -np $TOTALPES - -npernode $PES_PER_NODE + -np $TOTALPES + -npernode $PES_PER_NODE diff --git a/tools/configure b/tools/configure index 34b20702185..b731460fe5b 100755 --- a/tools/configure +++ b/tools/configure @@ -25,6 +25,7 @@ sys.path.append(os.path.join(_CIMEROOT, "scripts", "utils", "python")) from standard_script_setup import * from CIME.utils import expect from CIME.BuildTools.configure import configure +from CIME.XML.machines import Machines logger = logging.getLogger(__name__) From 7de9f18e435e84219ef3f6fa0c443e817e30eeaa Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 23 Nov 2016 09:08:33 -0800 Subject: [PATCH 11/20] rename corip1 cori-haswell --- cime_config/cesm/allactive/config_pes.xml | 4 +- cime_config/cesm/machines/config_batch.xml | 8 ++-- .../cesm/machines/config_compilers.xml | 39 +++++++++++++++++++ cime_config/cesm/machines/config_machines.xml | 2 +- utils/python/CIME/provenance.py | 6 +-- 5 files changed, 48 insertions(+), 11 deletions(-) diff --git a/cime_config/cesm/allactive/config_pes.xml b/cime_config/cesm/allactive/config_pes.xml index 31252ebd1a1..23f446bcbad 100644 --- a/cime_config/cesm/allactive/config_pes.xml +++ b/cime_config/cesm/allactive/config_pes.xml @@ -77,7 +77,7 @@ - + none @@ -1109,7 +1109,7 @@ - + none diff --git a/cime_config/cesm/machines/config_batch.xml b/cime_config/cesm/machines/config_batch.xml index a214a2e4cb2..cbd7ac9218a 100644 --- a/cime_config/cesm/machines/config_batch.xml +++ b/cime_config/cesm/machines/config_batch.xml @@ -10,7 +10,7 @@ batch_redirect: Whether a redirect character is needed to submit jobs. batch_directive: The string that prepends a batch directive for the batch system. jobid_pattern: A perl regular expression used to filter out the returned job id from a - queue submission. + queue submission. depend_pattern: =============================================================== @@ -180,7 +180,7 @@ -S {{ shell }} - regular + regular debug @@ -361,8 +361,7 @@ - - sbatch + -C haswell @@ -446,4 +445,3 @@ - diff --git a/cime_config/cesm/machines/config_compilers.xml b/cime_config/cesm/machines/config_compilers.xml index e8d3ec8b4e6..774a5d0ac5d 100644 --- a/cime_config/cesm/machines/config_compilers.xml +++ b/cime_config/cesm/machines/config_compilers.xml @@ -529,6 +529,45 @@ using a fortran linker. + + + --host=Linux + + + -xCORE-AVX2 + + + -xCORE-AVX2 + + + -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf -mkl -lpthread -lm + + + -DHAVE_PAPI -DHAVE_SLASHPROC + + + + + + + + --host=Linux + + + -xMIC-AVX512 + + + -xMIC-AVX512 + + + -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf -mkl -lpthread -lm + + + -DHAVE_PAPI -DHAVE_SLASHPROC xs + + + + -O2 diff --git a/cime_config/cesm/machines/config_machines.xml b/cime_config/cesm/machines/config_machines.xml index 85eb1d08835..b5c9a73ecf2 100644 --- a/cime_config/cesm/machines/config_machines.xml +++ b/cime_config/cesm/machines/config_machines.xml @@ -292,7 +292,7 @@ - + NERSC XC40 Haswell, os is CNL, 32 pes/node, batch system is Slurm cori intel,gnu,cray diff --git a/utils/python/CIME/provenance.py b/utils/python/CIME/provenance.py index 26db6093b10..eb419c257df 100644 --- a/utils/python/CIME/provenance.py +++ b/utils/python/CIME/provenance.py @@ -18,7 +18,7 @@ def _get_batch_job_id_for_syslog(case): mach = case.get_value("MACH") if mach == 'titan': return os.environ["PBS_JOBID"] - elif mach in ['edison', 'corip1', 'cori-haswell', 'cori-knl']: + elif mach in ['edison', 'cori-haswell', 'cori-knl']: return os.environ["SLURM_JOB_ID"] elif mach == 'mira': return os.environ["COBALT_JOBID"] @@ -118,7 +118,7 @@ def save_prerun_provenance_acme(case, lid=None): filename = "%s.%s" % (filename, lid) run_cmd_no_fail("%s > %s" % (cmd, filename), from_dir=full_timing_dir) gzip_existing_file(os.path.join(full_timing_dir, filename)) - elif mach in ["edison", "corip1", "cori-haswell", "cori-knl"]: + elif mach in ["edison", "cori-haswell", "cori-knl"]: for cmd, filename in [("sqs -f", "sqsf"), ("sqs -w -a", "sqsw"), ("sqs -f %s" % job_id, "sqsf_jobid"), ("squeue", "squeuef")]: filename = "%s.%s" % (filename, lid) run_cmd_no_fail("%s > %s" % (cmd, filename), from_dir=full_timing_dir) @@ -248,7 +248,7 @@ def save_postrun_provenance_acme(case, lid): elif mach == "mira": globs_to_copy.append("%s*output" % job_id) globs_to_copy.append("%s*cobaltlog" % job_id) - elif mach in ["edison", "corip1", "cori-haswell", "cori-knl"]: + elif mach in ["edison", "cori-haswell", "cori-knl"]: globs_to_copy.append("%s" % case.get_value("CASE")) globs_to_copy.append("logs/acme.log.%s.gz" % lid) From 019591706a563bd99b5f08ad36e04d4055e8cabf Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 23 Nov 2016 14:35:07 -0700 Subject: [PATCH 12/20] save this change for another PR --- driver_cpl/cime_config/config_component.xml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index 985f3596477..3b75316f6ec 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -2974,6 +2974,14 @@ Whether to clean the test after it is built/run + + char + /UNSET + test + env_test.xml + standard baselines root directory for testing + + char UNSET @@ -3503,7 +3511,7 @@ TRUE TRUE + feedbacks for a TG compset, this will give us additional diagnostics --> TRUE run_glc @@ -3641,3 +3649,5 @@ + + From 886720f4e8088ef2d30e076f19290dd739fcc1d2 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 28 Nov 2016 13:46:26 -0700 Subject: [PATCH 13/20] update for NAG --- cime_config/cesm/machines/config_compilers.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cime_config/cesm/machines/config_compilers.xml b/cime_config/cesm/machines/config_compilers.xml index 774a5d0ac5d..f43959444d3 100644 --- a/cime_config/cesm/machines/config_compilers.xml +++ b/cime_config/cesm/machines/config_compilers.xml @@ -267,7 +267,7 @@ using a fortran linker. -g - -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH + -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH -DCPRNAG -r8 @@ -545,7 +545,7 @@ using a fortran linker. -DHAVE_PAPI -DHAVE_SLASHPROC - + @@ -564,7 +564,7 @@ using a fortran linker. -DHAVE_PAPI -DHAVE_SLASHPROC xs - + From be4006544f6ddb955e65b69f2b7d35df92c73fbb Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 28 Nov 2016 14:35:44 -0700 Subject: [PATCH 14/20] fix issue in mct configure --- cime_config/acme/machines/Makefile | 62 +++++++++++++++--------------- cime_config/cesm/machines/Makefile | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/cime_config/acme/machines/Makefile b/cime_config/acme/machines/Makefile index 0cf53f99fac..a72d5d7c191 100644 --- a/cime_config/acme/machines/Makefile +++ b/cime_config/acme/machines/Makefile @@ -364,8 +364,8 @@ else # GCC needs to be able to link to # nagfor runtime to get autoconf # tests to work. - CFLAGS += -Wl,--as-needed,--allow-shlib-undefined - SLIBS += -L$(COMPILER_PATH)/lib/NAG_Fortran -lf60rts + CFLAGS += -Wl,--as-needed,--allow-shlib-undefined + SLIBS += -L$(COMPILER_PATH)/lib/NAG_Fortran -lf60rts endif endif endif @@ -399,10 +399,10 @@ INCLDIR += -I$(INSTALL_SHAREDPATH)/include -I$(CIMEROOT)/share/csm_share/shr \ CFLAGS+=$(CPPDEFS) CXXFLAGS := $(CFLAGS) -CONFIG_ARGS += CC="$(SCC)" FC="$(SFC)" MPICC="$(MPICC)" \ - MPIFC="$(MPIFC)" FCFLAGS="$(FFLAGS) $(FREEFLAGS) $(INCLDIR)" \ - CPPDEFS="$(CPPDEFS)" CFLAGS="$(CFLAGS) -I.. $(INCLDIR)" \ - NETCDF_PATH=$(NETCDF_PATH) LDFLAGS="$(LDFLAGS)" +CONFIG_ARGS += CC="$(CC)" FC="$(FC)" MPICC="$(MPICC)" \ + MPIFC="$(MPIFC)" FCFLAGS="$(FFLAGS) $(FREEFLAGS) $(INCLDIR)" \ + CPPDEFS="$(CPPDEFS)" CFLAGS="$(CFLAGS) -I.. $(INCLDIR)" \ + NETCDF_PATH=$(NETCDF_PATH) LDFLAGS="$(LDFLAGS)" ifeq ($(COMPILER),nag) CONFIG_ARGS += LIBS="$(SLIBS)" endif @@ -559,18 +559,18 @@ endif # doesn't seem to be able to differentiate between free & fixed # fortran flags) CMAKE_OPTS += -D CMAKE_Fortran_FLAGS:STRING="$(FFLAGS) $(INCLDIR)" \ - -D CMAKE_C_FLAGS:STRING="$(CFLAGS) $(INCLDIR)" \ - -D CMAKE_CXX_FLAGS:STRING="$(CXXFLAGS) $(INCLDIR)" \ - -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ - -D NETCDF_DIR:STRING=$(NETCDF_PATH) \ - -D GPTL_PATH:STRING=$(INSTALL_SHAREDPATH) \ - -D PIO_ENABLE_TESTS:BOOL=OFF \ - -D USER_CMAKE_MODULE_PATH:STRING=$(CIMEROOT)/externals/CMake + -D CMAKE_C_FLAGS:STRING="$(CFLAGS) $(INCLDIR)" \ + -D CMAKE_CXX_FLAGS:STRING="$(CXXFLAGS) $(INCLDIR)" \ + -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -D NETCDF_DIR:STRING=$(NETCDF_PATH) \ + -D GPTL_PATH:STRING=$(INSTALL_SHAREDPATH) \ + -D PIO_ENABLE_TESTS:BOOL=OFF \ + -D USER_CMAKE_MODULE_PATH:STRING=$(CIMEROOT)/externals/CMake ifdef PNETCDF_PATH CMAKE_OPTS += -D PNETCDF_DIR:STRING="$(PNETCDF_PATH)" else - CMAKE_OPTS += -D WITH_PNETCDF:LOGICAL=FALSE -D PIO_USE_MPIIO:LOGICAL=FALSE + CMAKE_OPTS += -D WITH_PNETCDF:LOGICAL=FALSE -D PIO_USE_MPIIO:LOGICAL=FALSE endif ifdef PIO_FILESYSTEM_HINTS CMAKE_OPTS += -D PIO_FILESYSTEM_HINTS:STRING="$(PIO_FILESYSTEM_HINTS)" @@ -586,9 +586,9 @@ ifndef CMAKE_ENV_VARS CMAKE_ENV_VARS := endif CMAKE_ENV_VARS += CC=$(CC) \ - CXX=$(CXX) \ - FC=$(FC) \ - LDFLAGS="$(LDFLAGS)" + CXX=$(CXX) \ + FC=$(FC) \ + LDFLAGS="$(LDFLAGS)" # We declare $(GLC_DIR)/Makefile to be a phony target so that cmake is @@ -675,25 +675,25 @@ ifeq ($(ULIBDEP),$(null)) ULIBDEP += $(LIBROOT)/libatm.a ULIBDEP += $(LIBROOT)/libice.a ifeq ($(findstring clm5_0,$(CLM_CONFIG_OPTS)),clm5_0) - LNDLIB := libclm.a + LNDLIB := libclm.a else - ifeq ($(findstring clm4_5,$(CLM_CONFIG_OPTS)),clm4_5) - LNDLIB := libclm.a - else - LNDLIB := liblnd.a - endif + ifeq ($(findstring clm4_5,$(CLM_CONFIG_OPTS)),clm4_5) + LNDLIB := libclm.a + else + LNDLIB := liblnd.a + endif endif ifeq ($(findstring libclm.a,$(LNDLIB)),libclm.a) - ULIBDEP += $(INSTALL_SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/lib/$(LNDLIB) + ULIBDEP += $(INSTALL_SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/lib/$(LNDLIB) else - ULIBDEP += $(LIBROOT)/$(LNDLIB) + ULIBDEP += $(LIBROOT)/$(LNDLIB) endif ifeq ($(MODEL),driver) - ifeq ($(findstring libclm.a,$(LNDLIB)),libclm.a) - INCLDIR += -I$(SHAREDLIBROOT)/$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/clm/obj - else - INCLDIR += -I$(EXEROOT)/lnd/obj - endif + ifeq ($(findstring libclm.a,$(LNDLIB)),libclm.a) + INCLDIR += -I$(SHAREDLIBROOT)/$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/clm/obj + else + INCLDIR += -I$(EXEROOT)/lnd/obj + endif endif @@ -705,7 +705,7 @@ ifeq ($(ULIBDEP),$(null)) ifeq ($(COMP_GLC), cism) ULIBDEP += $(CISM_LIBDIR)/libglimmercismfortran.a ifeq ($(CISM_USE_TRILINOS), TRUE) - ULIBDEP += $(CISM_LIBDIR)/libglimmercismcpp.a + ULIBDEP += $(CISM_LIBDIR)/libglimmercismcpp.a endif endif ifeq ($(OCN_SUBMODEL),moby) diff --git a/cime_config/cesm/machines/Makefile b/cime_config/cesm/machines/Makefile index 33fc9220f1f..85835206f31 100644 --- a/cime_config/cesm/machines/Makefile +++ b/cime_config/cesm/machines/Makefile @@ -360,7 +360,7 @@ INCLDIR += -I$(INSTALL_SHAREDPATH)/include -I$(CIMEROOT)/share/csm_share/shr \ CFLAGS+=$(CPPDEFS) CXXFLAGS := $(CFLAGS) -CONFIG_ARGS += CC="$(SCC)" FC="$(SFC)" MPICC="$(MPICC)" \ +CONFIG_ARGS += CC="$(CC)" FC="$(FC)" MPICC="$(MPICC)" \ MPIFC="$(MPIFC)" FCFLAGS="$(FFLAGS) $(FREEFLAGS) $(INCLDIR)" \ CPPDEFS="$(CPPDEFS)" CFLAGS="$(CFLAGS) -I.. $(INCLDIR)" \ NETCDF_PATH=$(NETCDF_PATH) LDFLAGS="$(LDFLAGS)" From bec57d1f95117d7e73ec5de3209585b74e3c2833 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 28 Nov 2016 14:46:51 -0700 Subject: [PATCH 15/20] remove whitespace difference --- cime_config/acme/machines/Makefile | 62 +++++++++++++++--------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/cime_config/acme/machines/Makefile b/cime_config/acme/machines/Makefile index a72d5d7c191..0df3169166c 100644 --- a/cime_config/acme/machines/Makefile +++ b/cime_config/acme/machines/Makefile @@ -137,7 +137,7 @@ ifeq (,$(SHAREDPATH)) INSTALL_SHAREDPATH = $(EXEROOT)/$(SHAREDPATH) endif -include $(CASEROOT)/Macros.make +include $(CASEROOT)/Macros # Decide whether to use a C++ or Fortran linker, based on whether we # are using any C++ code and the compiler-dependent CXX_LINKER variable ifeq ($(USE_CXX), true) @@ -364,8 +364,8 @@ else # GCC needs to be able to link to # nagfor runtime to get autoconf # tests to work. - CFLAGS += -Wl,--as-needed,--allow-shlib-undefined - SLIBS += -L$(COMPILER_PATH)/lib/NAG_Fortran -lf60rts + CFLAGS += -Wl,--as-needed,--allow-shlib-undefined + SLIBS += -L$(COMPILER_PATH)/lib/NAG_Fortran -lf60rts endif endif endif @@ -400,9 +400,9 @@ CFLAGS+=$(CPPDEFS) CXXFLAGS := $(CFLAGS) CONFIG_ARGS += CC="$(CC)" FC="$(FC)" MPICC="$(MPICC)" \ - MPIFC="$(MPIFC)" FCFLAGS="$(FFLAGS) $(FREEFLAGS) $(INCLDIR)" \ - CPPDEFS="$(CPPDEFS)" CFLAGS="$(CFLAGS) -I.. $(INCLDIR)" \ - NETCDF_PATH=$(NETCDF_PATH) LDFLAGS="$(LDFLAGS)" + MPIFC="$(MPIFC)" FCFLAGS="$(FFLAGS) $(FREEFLAGS) $(INCLDIR)" \ + CPPDEFS="$(CPPDEFS)" CFLAGS="$(CFLAGS) -I.. $(INCLDIR)" \ + NETCDF_PATH=$(NETCDF_PATH) LDFLAGS="$(LDFLAGS)" ifeq ($(COMPILER),nag) CONFIG_ARGS += LIBS="$(SLIBS)" endif @@ -559,18 +559,18 @@ endif # doesn't seem to be able to differentiate between free & fixed # fortran flags) CMAKE_OPTS += -D CMAKE_Fortran_FLAGS:STRING="$(FFLAGS) $(INCLDIR)" \ - -D CMAKE_C_FLAGS:STRING="$(CFLAGS) $(INCLDIR)" \ - -D CMAKE_CXX_FLAGS:STRING="$(CXXFLAGS) $(INCLDIR)" \ - -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ - -D NETCDF_DIR:STRING=$(NETCDF_PATH) \ - -D GPTL_PATH:STRING=$(INSTALL_SHAREDPATH) \ - -D PIO_ENABLE_TESTS:BOOL=OFF \ - -D USER_CMAKE_MODULE_PATH:STRING=$(CIMEROOT)/externals/CMake + -D CMAKE_C_FLAGS:STRING="$(CFLAGS) $(INCLDIR)" \ + -D CMAKE_CXX_FLAGS:STRING="$(CXXFLAGS) $(INCLDIR)" \ + -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \ + -D NETCDF_DIR:STRING=$(NETCDF_PATH) \ + -D GPTL_PATH:STRING=$(INSTALL_SHAREDPATH) \ + -D PIO_ENABLE_TESTS:BOOL=OFF \ + -D USER_CMAKE_MODULE_PATH:STRING=$(CIMEROOT)/externals/CMake ifdef PNETCDF_PATH CMAKE_OPTS += -D PNETCDF_DIR:STRING="$(PNETCDF_PATH)" else - CMAKE_OPTS += -D WITH_PNETCDF:LOGICAL=FALSE -D PIO_USE_MPIIO:LOGICAL=FALSE + CMAKE_OPTS += -D WITH_PNETCDF:LOGICAL=FALSE -D PIO_USE_MPIIO:LOGICAL=FALSE endif ifdef PIO_FILESYSTEM_HINTS CMAKE_OPTS += -D PIO_FILESYSTEM_HINTS:STRING="$(PIO_FILESYSTEM_HINTS)" @@ -586,9 +586,9 @@ ifndef CMAKE_ENV_VARS CMAKE_ENV_VARS := endif CMAKE_ENV_VARS += CC=$(CC) \ - CXX=$(CXX) \ - FC=$(FC) \ - LDFLAGS="$(LDFLAGS)" + CXX=$(CXX) \ + FC=$(FC) \ + LDFLAGS="$(LDFLAGS)" # We declare $(GLC_DIR)/Makefile to be a phony target so that cmake is @@ -675,25 +675,25 @@ ifeq ($(ULIBDEP),$(null)) ULIBDEP += $(LIBROOT)/libatm.a ULIBDEP += $(LIBROOT)/libice.a ifeq ($(findstring clm5_0,$(CLM_CONFIG_OPTS)),clm5_0) - LNDLIB := libclm.a + LNDLIB := libclm.a else - ifeq ($(findstring clm4_5,$(CLM_CONFIG_OPTS)),clm4_5) - LNDLIB := libclm.a - else - LNDLIB := liblnd.a - endif + ifeq ($(findstring clm4_5,$(CLM_CONFIG_OPTS)),clm4_5) + LNDLIB := libclm.a + else + LNDLIB := liblnd.a + endif endif ifeq ($(findstring libclm.a,$(LNDLIB)),libclm.a) - ULIBDEP += $(INSTALL_SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/lib/$(LNDLIB) + ULIBDEP += $(INSTALL_SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/lib/$(LNDLIB) else - ULIBDEP += $(LIBROOT)/$(LNDLIB) + ULIBDEP += $(LIBROOT)/$(LNDLIB) endif ifeq ($(MODEL),driver) - ifeq ($(findstring libclm.a,$(LNDLIB)),libclm.a) - INCLDIR += -I$(SHAREDLIBROOT)/$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/clm/obj - else - INCLDIR += -I$(EXEROOT)/lnd/obj - endif + ifeq ($(findstring libclm.a,$(LNDLIB)),libclm.a) + INCLDIR += -I$(SHAREDLIBROOT)/$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/clm/obj + else + INCLDIR += -I$(EXEROOT)/lnd/obj + endif endif @@ -705,7 +705,7 @@ ifeq ($(ULIBDEP),$(null)) ifeq ($(COMP_GLC), cism) ULIBDEP += $(CISM_LIBDIR)/libglimmercismfortran.a ifeq ($(CISM_USE_TRILINOS), TRUE) - ULIBDEP += $(CISM_LIBDIR)/libglimmercismcpp.a + ULIBDEP += $(CISM_LIBDIR)/libglimmercismcpp.a endif endif ifeq ($(OCN_SUBMODEL),moby) From c925d4127506f9543e7d049e36dfe550bbc9f1ea Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 28 Nov 2016 14:49:57 -0700 Subject: [PATCH 16/20] fix include file name --- cime_config/acme/machines/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/acme/machines/Makefile b/cime_config/acme/machines/Makefile index 0df3169166c..ea496356ae9 100644 --- a/cime_config/acme/machines/Makefile +++ b/cime_config/acme/machines/Makefile @@ -137,7 +137,7 @@ ifeq (,$(SHAREDPATH)) INSTALL_SHAREDPATH = $(EXEROOT)/$(SHAREDPATH) endif -include $(CASEROOT)/Macros +include $(CASEROOT)/Macros.make # Decide whether to use a C++ or Fortran linker, based on whether we # are using any C++ code and the compiler-dependent CXX_LINKER variable ifeq ($(USE_CXX), true) From d042b1c9bdb3f3e1bee24d39e980e69d83fadef3 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 29 Nov 2016 08:46:09 -0800 Subject: [PATCH 17/20] changes for cori-knl --- cime_config/cesm/machines/config_batch.xml | 12 ++++++++++++ cime_config/cesm/machines/config_machines.xml | 10 ++++++++-- driver_cpl/cime_config/config_component.xml | 12 +----------- utils/python/CIME/case_setup.py | 3 ++- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/cime_config/cesm/machines/config_batch.xml b/cime_config/cesm/machines/config_batch.xml index cbd7ac9218a..207e2ca8009 100644 --- a/cime_config/cesm/machines/config_batch.xml +++ b/cime_config/cesm/machines/config_batch.xml @@ -362,6 +362,7 @@ + sbatch -C haswell @@ -371,6 +372,17 @@ + + sbatch + + -C knl + + + regular + + + + sbatch diff --git a/cime_config/cesm/machines/config_machines.xml b/cime_config/cesm/machines/config_machines.xml index b5c9a73ecf2..1f04a8f6e7d 100644 --- a/cime_config/cesm/machines/config_machines.xml +++ b/cime_config/cesm/machines/config_machines.xml @@ -293,8 +293,10 @@ - NERSC XC40 Haswell, os is CNL, 32 pes/node, batch system is Slurm + + cori + NERSC XC40 Haswell, os is CNL, 32 pes/node, batch system is Slurm intel,gnu,cray mpt,mpi-serial $ENV{SCRATCH} @@ -396,6 +398,9 @@ + + + NERSC XC* KNL, os is CNL, 68 pes/node, batch system is Slurm intel,gnu,cray mpt,mpi-serial @@ -446,7 +451,7 @@ cray-netcdf-hdf5parallel craype-sandybridge craype-ivybridge - craype + craype-haswell PrgEnv-intel @@ -470,6 +475,7 @@ gcc gcc/6.1.0 + craype-mic-knl papi/5.4.3.2 craype craype/2.5.5 diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index 3b75316f6ec..985f3596477 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -2974,14 +2974,6 @@ Whether to clean the test after it is built/run - - char - /UNSET - test - env_test.xml - standard baselines root directory for testing - - char UNSET @@ -3511,7 +3503,7 @@ TRUE TRUE + feedbacks for a TG compset, this will give us additional diagnostics --> TRUE run_glc @@ -3649,5 +3641,3 @@ - - diff --git a/utils/python/CIME/case_setup.py b/utils/python/CIME/case_setup.py index 6c4f8e256d5..d5bab5e6b50 100644 --- a/utils/python/CIME/case_setup.py +++ b/utils/python/CIME/case_setup.py @@ -155,7 +155,8 @@ def _case_setup_impl(case, caseroot, clean=False, test_mode=False, reset=False): # creates the Macros.make, Depends.compiler, Depends.machine, Depends.machine.compiler # and env_mach_specific.xml if they don't already exist. - configure(Machines(machine=mach), caseroot, ["Makefile"], compiler, mpilib, debug, sysos) + if not os.path.isfile("Macros.make") or not os.path.isfile("env_mach_specific.xml"): + configure(Machines(machine=mach), caseroot, ["Makefile"], compiler, mpilib, debug, sysos) # Set tasks to 1 if mpi-serial library if mpilib == "mpi-serial": From c9405825cb4ad5181dad543480ed2143078399b2 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Sat, 3 Dec 2016 06:16:59 -0800 Subject: [PATCH 18/20] updates for cori-knl --- cime_config/cesm/machines/config_batch.xml | 2 +- .../cesm/machines/config_compilers.xml | 7 +++-- cime_config/cesm/machines/config_machines.xml | 26 +++++++++---------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/cime_config/cesm/machines/config_batch.xml b/cime_config/cesm/machines/config_batch.xml index 207e2ca8009..d3c76ca9b0c 100644 --- a/cime_config/cesm/machines/config_batch.xml +++ b/cime_config/cesm/machines/config_batch.xml @@ -378,7 +378,7 @@ -C knl - regular + regular diff --git a/cime_config/cesm/machines/config_compilers.xml b/cime_config/cesm/machines/config_compilers.xml index f43959444d3..473a844d19b 100644 --- a/cime_config/cesm/machines/config_compilers.xml +++ b/cime_config/cesm/machines/config_compilers.xml @@ -560,11 +560,14 @@ using a fortran linker. -xMIC-AVX512 - -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf -mkl -lpthread -lm + -L$(NETCDF_DIR) -lnetcdff -Wl,--as-needed,-L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf - -DHAVE_PAPI -DHAVE_SLASHPROC xs + -DHAVE_PAPI -DHAVE_SLASHPROC + + -mkl -lmemkind -ljemalloc -zmuldefs + diff --git a/cime_config/cesm/machines/config_machines.xml b/cime_config/cesm/machines/config_machines.xml index 1f04a8f6e7d..cf3cc9cb109 100644 --- a/cime_config/cesm/machines/config_machines.xml +++ b/cime_config/cesm/machines/config_machines.xml @@ -364,7 +364,7 @@ PrgEnv-cray - cce cce/8.5.1 + cce cce/8.5.4 PrgEnv-gnu @@ -381,12 +381,12 @@ cray-mpich/7.4.1 - cray-hdf5/1.8.16 - cray-netcdf/4.4.0 + cray-hdf5/1.10.0 + cray-netcdf/4.4.1 - cray-netcdf-hdf5parallel/4.4.0 - cray-hdf5-parallel/1.8.16 + cray-netcdf-hdf5parallel/4.4.1 + cray-hdf5-parallel/1.10.0 cray-parallel-netcdf/1.7.0 @@ -435,6 +435,8 @@ module module + craype-mic-knl + craype-haswell PrgEnv-intel PrgEnv-cray PrgEnv-gnu @@ -449,15 +451,13 @@ cray-netcdf cray-hdf5 cray-netcdf-hdf5parallel - craype-sandybridge - craype-ivybridge - craype-haswell PrgEnv-intel intel intel/17.0.0.098 cray-libsci /global/project/projectdirs/ccsm1/modulefiles/cori + memkind esmf/6.3.0rp1-defio-intel2016-mpi-O @@ -468,7 +468,7 @@ PrgEnv-cray - cce cce/8.5.1 + cce cce/8.5.4 PrgEnv-gnu @@ -486,12 +486,12 @@ cray-mpich/7.4.1 - cray-hdf5/1.8.16 - cray-netcdf/4.4.0 + cray-hdf5/1.10.0 + cray-netcdf/4.4.1 - cray-netcdf-hdf5parallel/4.4.0 - cray-hdf5-parallel/1.8.16 + cray-netcdf-hdf5parallel/4.4.1 + cray-hdf5-parallel/1.10.0 cray-parallel-netcdf/1.7.0 From a1a46fe4df886549ecfa95b8c54d8c53bd79fe80 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Sun, 4 Dec 2016 13:48:32 -0700 Subject: [PATCH 19/20] MP_MPILIB over defined --- cime_config/cesm/machines/config_machines.xml | 3 +-- utils/python/CIME/XML/env_mach_specific.py | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cime_config/cesm/machines/config_machines.xml b/cime_config/cesm/machines/config_machines.xml index cf3cc9cb109..378cd7e5cd4 100644 --- a/cime_config/cesm/machines/config_machines.xml +++ b/cime_config/cesm/machines/config_machines.xml @@ -457,7 +457,7 @@ intel intel/17.0.0.098 cray-libsci /global/project/projectdirs/ccsm1/modulefiles/cori - memkind + memkind esmf/6.3.0rp1-defio-intel2016-mpi-O @@ -1548,7 +1548,6 @@ 2 yes us - $MPILIB unordered yes diff --git a/utils/python/CIME/XML/env_mach_specific.py b/utils/python/CIME/XML/env_mach_specific.py index 0504447eeea..03b71a07bab 100644 --- a/utils/python/CIME/XML/env_mach_specific.py +++ b/utils/python/CIME/XML/env_mach_specific.py @@ -158,7 +158,6 @@ def list_modules(self): def make_env_mach_specific_file(self, compiler, debug, mpilib, shell): modules_to_load = self._get_modules_for_case(compiler, debug, mpilib) envs_to_set = self._get_envs_for_case(compiler, debug, mpilib) - filename = ".env_mach_specific.%s" % shell lines = [] if modules_to_load is not None: @@ -245,7 +244,7 @@ def _load_module_modules(self, modules_to_load): for cmd in self._get_module_commands(modules_to_load, "python"): logger.debug("module command is %s"%cmd) stat, py_module_code, errout = run_cmd(cmd) - expect(stat==0 and len(errout) == 0, + expect(stat==0 and len(errout) == 0, "module command %s failed with message:\n%s"%(cmd,errout)) exec(py_module_code) @@ -416,4 +415,3 @@ def get_mpirun(self, case, attribs, check_members=None, job="case.run"): executable = exec_node.text return executable, args - From c088677c40c37065fc68f4ce680f015787dd567e Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 7 Dec 2016 14:34:17 -0700 Subject: [PATCH 20/20] always code_check file if full path provided --- cime_config/cesm/machines/config_machines.xml | 8 ++++---- scripts/Tools/code_checker | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cime_config/cesm/machines/config_machines.xml b/cime_config/cesm/machines/config_machines.xml index 378cd7e5cd4..16ff1d13eff 100644 --- a/cime_config/cesm/machines/config_machines.xml +++ b/cime_config/cesm/machines/config_machines.xml @@ -385,8 +385,8 @@ cray-netcdf/4.4.1 - cray-netcdf-hdf5parallel/4.4.1 - cray-hdf5-parallel/1.10.0 + cray-netcdf-hdf5parallel/4.3.3.1 + cray-hdf5-parallel/1.8.16 cray-parallel-netcdf/1.7.0 @@ -490,8 +490,8 @@ cray-netcdf/4.4.1 - cray-netcdf-hdf5parallel/4.4.1 - cray-hdf5-parallel/1.10.0 + cray-netcdf-hdf5parallel/4.3.3.1 + cray-hdf5-parallel/1.8.16 cray-parallel-netcdf/1.7.0 diff --git a/scripts/Tools/code_checker b/scripts/Tools/code_checker index c51e4d351bc..c98b1e5b3a2 100755 --- a/scripts/Tools/code_checker +++ b/scripts/Tools/code_checker @@ -102,13 +102,15 @@ def check_code(dir_to_check, num_procs, files): Returns True if all files had no problems """ # Get list of files to check - files_to_check = run_cmd_no_fail('git ls-files --full-name %s' % dir_to_check, verbose=False).splitlines() - if files: - files_to_check = [item for item in files_to_check if matches(item, files)] - else: - files_to_check = [item for item in files_to_check if item.endswith(".py")] - if len(files_to_check) == 0: + if '/' in files: files_to_check = files + else: + files_to_check = run_cmd_no_fail('git ls-files --full-name %s' % dir_to_check, verbose=False).splitlines() + if files: + files_to_check = [item for item in files_to_check if matches(item, files)] + else: + files_to_check = [item for item in files_to_check if item.endswith(".py")] + pool = ThreadPool(num_procs) results = pool.map(run_pylint, files_to_check)