Skip to content

Unexpected behavior with parsing of config_compilers.xml into Macros.cmake (not overriding defaults) #3341

@ndkeen

Description

@ndkeen

In config_compilers.xml We have compiler-specific cases such as:

<compiler COMPILER="gnu">

where we have all GNU compiler basic flags/settings. If we need to make a change to those settings for a specific machine, my understanding is that we could so something like the following:

<compiler MACH="cori-knl" COMPILER="gnu">
  <ALBANY_PATH>/global/project/projectdirs/acme/software/AlbanyTrilinos20190823/albany-build/install</ALBANY_PATH>
  <CONFIG_ARGS>
    <base> --host=Linux </base>
  </CONFIG_ARGS>
  <CPPDEFS>
    <append> -DARCH_MIC_KNL </append>
  </CPPDEFS>
  <CFLAGS>
    <base DEBUG="TRUE"> -g </base>
    <base DEBUG="FALSE"> -O2</base>
    <append compile_threaded="TRUE"> -fopenmp </append>
    <append COMP_NAME="csm_share"> -std=c99 </append>
  </CFLAGS>
  <FFLAGS>
    <base DEBUG="TRUE"> -g</base>
    <base DEBUG="FALSE">  -O2</base>
    <append compile_threaded="TRUE"> -fopenmp </append>
  </FFLAGS>
...

Here in the example, I have made the changes more visible (ie wanting DEBUG flags to simply be -g for cori-knl with gnu) where in practice my desired change is more subtle.

It also looks any commands of a "section" in config_compilers.xml is simply added to other commands -- such that even now, I see multiple commands in Macros.cmake that were likely not what was intended (and only work as it's a simple flag append), such as:

   set(FFLAGS "${FFLAGS}  -O2 -debug minimal")
   set(FFLAGS "${FFLAGS}  -O2 -debug minimal -qno-opt-dynamic-align")

where the first command is coming from the <compiler COMPILER="intel"> section, and the second is coming from <compiler MACH="cori-knl" COMPILER="intel"> section. Again, it still works, but I would think the expectation is that the settings in <compiler MACH="cori-knl" COMPILER="intel"> would override the other default settings.

Note I see this in both Macros.cmake and Macros.make. But I sure thought this was NOT happening a while back. Would need to go back to older repos to test.

I hope I've made this clear, but can explain a practical issue to be more concrete.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions