Merge branch 'gnu_argument_mismatch' into release-v4.3.1 (PR #187)release-v4.3.1
commitd9467d3bfbcc01b61e89a284b806d2602159c66e
authorMichael Duda <duda@ucar.edu>
Fri, 5 Nov 2021 17:32:00 +0000 (5 11:32 -0600)
committerMichael Duda <duda@ucar.edu>
Fri, 5 Nov 2021 17:32:00 +0000 (5 11:32 -0600)
tree567cd10b31f2146e23900407f90ecf0c901f3900
parent1f59913647acea225b67ca2df2e87a7f45cea1a4
parent67f43362ab7d98beb7687c540c90edaf359b8b3b
Merge branch 'gnu_argument_mismatch' into release-v4.3.1 (PR #187)

This merge addresses build failures when newer GNU compilers are used.

Newer GNU compilers (in particular, major versions later than 9) appear to
require the -fallow-argument-mismatch option in order to successfully compile
certain modules that make calls to Fortran 77 routines that operate on various
datatypes: for example, the MPI_Bcast call can broadcast various data types, and
without the Fortran 90+ module interface, there are no overloaded explicit
interfaces for supported argument types, leading newer GNU Fortran compiler
releases to generate errors about inconsistent/mismatched argument types.

The configure script now builds a test program that determines whether the
Fortran compiler being used is GNU Fortran with a major version later than 9,
and sets the FCCOMPAT variable to -fallow-argument-mismatch in the configure.wps
file if so (and sets FCCOMPAT to an empty string otherwise).

Since Make treats undefined variables as empty strings, the FCCOMPAT variable
only needs to be defined for configuration options where it will be needed,
i.e., configuration options that use the GNU Fortran compiler.

Other compiler could follow what has been done in this commit to define FCCOMPAT
as needed through the use of additional test programs (and through the addition
of FCCOMPAT to other configuration stanzas).

* gnu_argument_mismatch:
  Add FCCOMPAT flags to postamble and throughout Makefiles when compiling Fortran
  Allow configure script to define new FCCOMPAT flags for newer GNU compilers