Fortran changes in GCC 10
mcalhoun at macports.org
Mon May 4 03:39:40 UTC 2020
By default, the about to be released GCC 10 is more strict about Fortran argument types .
Code that once only produced warnings now produce errors.
So far, I have run into this problem three times.
MPICH is aware of the issue but is unsure how they are going to proceed [2,3].
GetDP required a minor patch that has already be accepted upstream .
ScaLAPACK produced a deluge of error.
I submitted a bug report, but I have no desire to construct a patch .
As I recall from a summer working with legacy FORTRAN 77 code written by mathematicians, the priorities were roughly:
1. code produces output that looks good in a publication
2. code is fast
3. code produces correct results
42. code adheres to best programming practices
As such, I am sure that many Fortran based project will run into this issue.
Ideally, these kinds of things would be fixed upstream.
Until then, the workaround is to add `-fallow-argument-mismatch` to the gfortran compiler.
Unfortunately, the flag is not unrecognized by any GCC < 10 and hence produces an error.
We could design a separate PortGroup to address the problem, but it would have to be so tightly tied to the compilers PG that it made more sense to simply modify the compilers PG directly .
If anyone else runs into this problem and a patch is not feasible, `compilers.allow_arguments_mismatch yes` should hopefully fix the problem.
More information about the macports-dev