FMS: Set Intel Fortran ifort / ifx compiler flags to not aggressively optimize floating exception code checks#5312
Open
rickgrubin-noaa wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
@spackbot fix style |
|
Let me see if I can fix that for you! |
|
I was able to run spack style --fixrepos/spack_repo/builtin/packages/fms/package.py
�[1;34m==> �[0mrunning ruff format
�[1;34m==> �[0mrunning ruff check
�[1m�[91minvalid-syntax: �[0m�[1mExpected `]`, found newline�[0m
�[1m�[94m-->�[0m repos/spack_repo/builtin/packages/fms/package.py:169:76
�[1m�[94m|�[0m
�[1m�[94m167 |�[0m self.define("64BIT", "precision=64" in self.spec),
�[1m�[94m168 |�[0m self.define_from_variant("FPIC", "pic"),
�[1m�[94m169 |�[0m self.define_from_variant("USE_DEPRECATED_IO", "deprecated_io"),
�[1m�[94m|�[0m �[1m�[91m^�[0m
�[1m�[94m170 |�[0m
�[1m�[94m171 |�[0m # oneapi ifort / ifx aggressively optimize floating point exception checks
�[1m�[94m|�[0m
�[1m�[91minvalid-syntax: �[0m�[1mUnexpected indentation�[0m
�[1m�[94m-->�[0m repos/spack_repo/builtin/packages/fms/package.py:172:1
�[1m�[94m|�[0m
�[1m�[94m171 |�[0m # oneapi ifort / ifx aggressively optimize floating point exception checks
�[1m�[94m172 |�[0m if self.spec.satisfies("%oneapi@2023:"):
�[1m�[94m|�[0m �[1m�[91m^^^^^^^^^^^^�[0m
�[1m�[94m173 |�[0m fflags = "-fp-model=precise -fp-speculation=safe"
�[1m�[94m174 |�[0m args.extend(["-DCMAKE_Fortran_FLAGS=%s" % fflags])
�[1m�[94m|�[0m
�[1m�[91minvalid-syntax: �[0m�[1mExpected a statement�[0m
�[1m�[94m-->�[0m repos/spack_repo/builtin/packages/fms/package.py:175:9
�[1m�[94m|�[0m
�[1m�[94m173 |�[0m fflags = "-fp-model=precise -fp-speculation=safe"
�[1m�[94m174 |�[0m args.extend(["-DCMAKE_Fortran_FLAGS=%s" % fflags])
�[1m�[94m175 |�[0m ]
�[1m�[94m|�[0m �[1m�[91m^�[0m
�[1m�[94m176 |�[0m
�[1m�[94m177 |�[0m return args
�[1m�[94m|�[0m
�[1m�[91minvalid-syntax: �[0m�[1mExpected a statement�[0m
�[1m�[94m-->�[0m repos/spack_repo/builtin/packages/fms/package.py:175:10
�[1m�[94m|�[0m
�[1m�[94m173 |�[0m fflags = "-fp-model=precise -fp-speculation=safe"
�[1m�[94m174 |�[0m args.extend(["-DCMAKE_Fortran_FLAGS=%s" % fflags])
�[1m�[94m175 |�[0m ]
�[1m�[94m|�[0m �[1m�[91m^�[0m
�[1m�[94m176 |�[0m
�[1m�[94m177 |�[0m return args
�[1m�[94m|�[0m
�[1m�[91minvalid-syntax: �[0m�[1mExpected a statement�[0m
�[1m�[94m-->�[0m repos/spack_repo/builtin/packages/fms/package.py:178:1
�[1m�[94m|�[0m
�[1m�[94m177 |�[0m return args
�[1m�[94m|�[0m �[1m�[91m^�[0m
�[1m�[94m|�[0m
Found 5 errors.
I wasn't able to make any further changes, but please see the message above for remaining issues you can fix locally! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per: FMS 2025.03 built with oneAPI@2025.{2,3}.1 ifx optimizes code to create a divide by zero error
#2041
ifxwill optimize away a check for dividing by zero.To Reproduce
See the reproducer code / FMS issue. Also tested against ifort@202{3,4}.x
Expected behavior
ifort / ifx does not optimize away checks for division by zero.
Additional context
Intel Fortran Compiler Developer Guides / References