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

Add stricter debugging flags when building MAPL as Debug #1871

Merged
merged 8 commits into from
Dec 16, 2022

Conversation

mathomp4
Copy link
Member

@mathomp4 mathomp4 commented Dec 13, 2022

Description

This PR adds some CMake code to apply additional flags when building MAPL as Debug.

This also updates the ESMA_cmake in the components.yaml to 3.22.0 which defines these new flags. Note that if you don't have this version of ESMA_cmake, then it's just a no-op as all the variables are empty.

Related Issue

Motivation and Context

The extra flags are good since Intel is often "too loose" and at least it will throw a lot of warnings and not allow things like if(integer) or setting a logical to an integer.

How Has This Been Tested?

Built and ran GEOS. If it builds...that's good enough!

I've also checked and the flags only appear if Debug.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

@mathomp4 mathomp4 added the 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. label Dec 13, 2022
@mathomp4 mathomp4 self-assigned this Dec 13, 2022
@mathomp4 mathomp4 requested review from a team as code owners December 13, 2022 19:16
@mathomp4 mathomp4 marked this pull request as draft December 13, 2022 19:17
@mathomp4 mathomp4 marked this pull request as ready for review December 13, 2022 20:02
tclune
tclune previously approved these changes Dec 14, 2022
Copy link
Collaborator

@tclune tclune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There has got to be a cleaner way to add a flag. When you have a chance you need to remind me why de-duplication is involved.

@mathomp4 mathomp4 requested a review from tclune December 15, 2022 20:36
@mathomp4
Copy link
Member Author

There has got to be a cleaner way to add a flag. When you have a chance you need to remind me why de-duplication is involved.

The reason is that we have flags like:

-diag-error 6188 -diag-error 6192

and when I tried it out, many of the CMake methods made them into:

-diag-error 6188 6192

per CMake:

The final set of options used for a target is constructed by accumulating options from the current target and the usage requirements of its dependencies. The set of options is de-duplicated to avoid repetition.

New in version 3.12: While beneficial for individual options, the de-duplication step can break up option groups. For example, -option A -option B becomes -option A B. One may specify a group of options using shell-like quoting along with a SHELL: prefix. The SHELL: prefix is dropped, and the rest of the option string is parsed using the separate_arguments() UNIX_COMMAND mode. For example, "SHELL:-option A" "SHELL:-option B" becomes -option A -option B.

I suppose my question was, should I "hide" this in a file. In the end, probably not worth it...

@mathomp4 mathomp4 merged commit d3c3c7e into develop Dec 16, 2022
@mathomp4 mathomp4 deleted the feature/mathomp4/add-additional-debug-flags branch December 16, 2022 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants