NASA-LIS / LISF

Land Information System Framework
Apache License 2.0
117 stars 155 forks source link

Removed -Wpedantic debug flag for gfortran. #1453

Closed emkemp closed 10 months ago

emkemp commented 10 months ago

Description

Removed -Wpedantic debug flag in arch/Config.pl for gfortran.

There are two reasons that chain together for this change.

First, Intel MPI doesn't seem to export Fortran interfaces for MPI subroutines and functions, which causes gfortran to complain when argument types change between MPI calls.

Second, the -Wpedantic flag elevates these mismatches to syntax errors with gfortran 11.2.0. (This may be a compiler bug, as there is a separate -pedantic-error that is supposed to do this.)

Taken together, -Wpedantic will cause gfortran 11.2.0 to halt when it encounters MPI calls in code, when using Intel MPI. By removing the flag, the compiler will downgrade this to a warning -- this would allow a developer to still identify actual bugs with argument mismatches when using gfortran.

(It may be worth adding explicit interfaces for MPI routines not provided by the MPI library. See https://www.scivision.dev/gfortran-type-mismatch-error/. But that's a lot of work.)