Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake errors on switch file with STAB3 and only one of ST4, ST3 #1082

Closed
camilleanne opened this issue Sep 21, 2023 · 4 comments · Fixed by #1086
Closed

cmake errors on switch file with STAB3 and only one of ST4, ST3 #1082

camilleanne opened this issue Sep 21, 2023 · 4 comments · Fixed by #1086
Labels
bug Something isn't working

Comments

@camilleanne
Copy link

camilleanne commented Sep 21, 2023

Describe the bug
When building with cmake, if the switch file includes STAB3 then ST3 and ST4 are both required, but it should allow just one.

To Reproduce
Steps to reproduce the behavior.
If you have a switch file that includes STAB3 ST4 and follow the cmake instructions cmake .. -DSWITCH=/path/to/switch_CMAKE_TEST you'll see the error: error: Switch 'STAB3' requires 'ST3' to be set

enumerated combinations:
switch file includes: STAB3 ST4
error: Switch 'STAB3' requires 'ST3' to be set

switch file includes: STAB3 ST3
error: Switch 'STAB3' requires 'ST4' to be set

switch file includes: STAB3 ST4 ST3
error: No valid sterm switches found, but one is required

switch file includes: ST4 ST3
error: No valid sterm switches found, but one is required

switch file includes: ST4
error: none

switch file includes: ST3
error: none

Expected behavior
I expect that either ST3 or ST4 would be required to be used with STAB3, not that both are required. I have no sense about whether it's appropriate to use both together with STAB3, but know that our use case only requires STAB3 and ST4.

The manual asserts either ST3 or ST4 can be used with STAB3, implying that both are not required:

The STAB3 switch, described above for use with ST3, may also be used with ST4.

This is corroborated by the older build_utils logic.

Additional context
I believe this behavior originates from this line in switches.json.

@camilleanne camilleanne added the bug Something isn't working label Sep 21, 2023
@camilleanne camilleanne changed the title cmake errors on switch file with STAB4 and only one of ST4, ST3 cmake errors on switch file with STAB3 and only one of ST4, ST3 Sep 21, 2023
@MatthewMasarik-NOAA
Copy link
Collaborator

@camilleanne Thanks for reporting and documenting this! I think your assessment is spot on, this is a bug, and either ST4 or ST3 need to be selected when STAB3 is present, (selecting both ST4 and ST3 should not be allowed). I did run into this earlier this year working with STAB3, but unfortunately it was lower priority at the time and fell off my plate.. We don't use the STAB3 switch in any of our regtests currently, so that was part of the lower priority.

This should be an easy fix of the logic though, in the switches.json file you pointed to, assuming no side effects that might not be obvious yet. I'll start on testing that fix. @JessicaMeixner-NOAA is back Monday, and I have some leave next week, so likely she can pick up with what I have. I see a timeline of getting something submitted & approved likely end of next week, or early the following. Monday we will have a better idea of timing.

@MatthewMasarik-NOAA
Copy link
Collaborator

@camilleanne I have fix that I believe corrects the build w.r.t. STAB3 using ST3 or ST4. I've confirmed it behaves correctly when each combination is selected, now I have the normal set of regression tests running to verify the fix did not change those. If all goes well I can submit a PR tomorrow, then @JessicaMeixner-NOAA will take over for the PR review.

@MatthewMasarik-NOAA
Copy link
Collaborator

Fyi @camilleanne, the PR was submitted. I'm on leave now till friday. @JessicaMeixner-NOAA will handle the review from here.

@MatthewMasarik-NOAA
Copy link
Collaborator

fyi @camilleanne. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants