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 GNU compiler flags to help build with GNU v10 and above #4817

Closed
wants to merge 3 commits into from

Conversation

ndkeen
Copy link
Contributor

@ndkeen ndkeen commented Feb 28, 2022

Specifically, adding -fallow-argument-mismatch -fallow-invalid-boz for any GNU build using version 10 or higher.

Fixes #3954

[bfb]

Specifically, adding -fallow-argument-mismatch -fallow-invalid-boz
@@ -40,6 +40,9 @@ endif()
if (NOT DEBUG)
string(APPEND FFLAGS " -O")
endif()
if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
string(APPEND FFLAGS " -fallow-argument-mismatch -fallow-invalid-boz")
Copy link
Contributor

Choose a reason for hiding this comment

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

We also found that we needed the "-fallow-argument-mismatch" flag for building SCORPIO with gnu 11

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suspect you need it for GNU v10 as well

@ndkeen
Copy link
Contributor Author

ndkeen commented Feb 28, 2022

Note it seems like these are work-around flags and there may be other ways to address. Or... we could only compile certain files (or components) with these flags.

The -fallow-argument-mismatch flag is used to make these warnings instead of errors (in cime/src/share/timing/perf_utils.F90 for example):

   22 |     call MPI_BCAST(vec,lsize,MPI_INTEGER,0,comm,ierr)
      |                   1
......
   31 |     call MPI_BCAST(vec,lsize,MPI_LOGICAL,0,comm,ierr)
      |                   2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/LOGICAL(4)).

The -fallow-invalid-boz flag is actually only needed for 2 places in e3sm:
In components/eam/src/control/cam_history.F90, there is this line:
integer, parameter :: gen_hash_key_offset = z'000053db'
And in elm/src/biogeochem/MEGANFactorsMod.F90 there is something similar.

Which looks to be used to init a hash before adding values. Not familiar with algorithm there, but perhaps there is way to change the code instead of using that flag.

I'm testing with adding something for those 2 files in Depends.gnu*

@jayeshkrishna
Copy link
Contributor

Are the changes BFB (BFB flag is missing in the PR desc, and the PR labels)?

@ndkeen ndkeen added BFB PR leaves answers BFB GNU GNU compiler related issues Machine Files labels Feb 28, 2022
@ndkeen
Copy link
Contributor Author

ndkeen commented Mar 1, 2022

I added a commit to the branch to change how we issue the -fallow-invalid-boz flag. Now it's only used for 2 specific files via Depends.gnu*. Re-tested e3sm_developer.

… Depends.gnu.cmake and add

the logic to work-around a certain problem with ICE by removing a specific optimization via compiler flag.
@ndkeen
Copy link
Contributor Author

ndkeen commented Mar 1, 2022

Closing this in favor of #4822

@ndkeen ndkeen closed this Mar 1, 2022
jonbob added a commit that referenced this pull request Mar 14, 2022
…into next (PR #4821)

Add -fallow-argument-mismatch to gfortran in MPAS standalone builds

This allows the code to build with gfortran >=10.0.0

Related to #4817, but for standalone MPAS builds

[BFB]
jonbob added a commit that referenced this pull request Mar 15, 2022
…(PR #4821)

Add -fallow-argument-mismatch to gfortran in MPAS standalone builds

This allows the code to build with gfortran >=10.0.0
Related to #4817, but for standalone MPAS builds

[BFB]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB GNU GNU compiler related issues Machine Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compile issue with GCC 10.1.0
2 participants