NOAA-GFDL / mkmf

Other
10 stars 51 forks source link

GCC 10 requires two non-backward-compatible options #46

Closed ceblanton closed 2 years ago

ceblanton commented 2 years ago

Available GCC versions on C4 are: 6, 7, 8 (default), 9, 10 Available GCC versions on C5: 10, 11 (default)

Using the current ncrc-gcc.mk template with GCC 11 on T5, @mcallic2 encountered errors such as:


Error: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/LOGICAL(4)).
/lustre/f2/dev/Caitlyn.Mcallister/am5/2022.01/am5p0p1_2022.04-alpha3/src/FMS/mpp/include/mpp_comm_mpi.inc:355:44:

  355 |       if( mpp_npes().GT.1 ) call MPI_BCAST( data, length*size(data(:)), MPI_CHARACTER, from_rank, peset(n)%id, error )
      |                                            1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (CHARACTER(*)/LOGICAL(4)).
make[1]: *** [Makefile:151: mpp.o] Error 1
make[1]: Leaving directory '/lustre/f2/dev/gfdl/Caitlyn.Mcallister/am5/2022.01/am5p0p1_2022.04-alpha3/ncrc5.gcc-debug/exec/fms'
make: *** [Makefile:14: fms/libfms.a] Error 2

According to @thomas-robinson (and @rem1776 ), FFLAGS needs to have -fallow-invalid-boz -fallow-argument-mismatch for GCC versions 10 and later.

They are are described in the GCC 10 release notes (https://gcc.gnu.org/gcc-10/changes.html):

These two options are not backward compatible, so we'll need to have two GCC templates or drop support for GCC versions before 10.

thomas-robinson commented 2 years ago

It should be noted that I don't think -fallow-invalid-boz is required for the current code, but it would be needed to compile older versions of the models. We may encounter this type of issue when moving over to C5, so I think we should still include this compile option.