NOAA-GFDL / FMS

GFDL's Flexible Modeling System
Other
94 stars 136 forks source link

Compilation errors with gcc 10/11 and mpich #896

Open rem1776 opened 2 years ago

rem1776 commented 2 years ago

Describe the bug Fails compilation while using gcc 10/11 and mpich. Looks like the default kind sizes for the mpich mpi routines aren't matching up with the calls in mpp.

This happened on gaea with aquaplanet and I was able to reproduce it on the amd box. Only happens with both gcc 10/11 and mpich, gcc 10/11 and mpich compile fine with other compilers/mpi libraries.

Error: Type mismatch between actual argument at (1) and actual argument at (2) (LOGICAL(4)/LOGICAL(8)).
../../mpp/include/mpp_alltoall_mpi.h:70:23-23:

   70 |     call MPI_Alltoallv(sbuf, ssize, sdispl, MPI_TYPE_, &
      |                       1

To Reproduce Compile fms with gcc 10 or 11 and mpich

Expected behavior Compile successfully

System Environment

amd dev box (gcc 10.2.0 and 11.2.0, mpich 3.4.3, netcdf 4.8.0) but also saw this compilation error on gaea with gcc 10

rem1776 commented 2 years ago

porting guide for gcc 10: https://gcc.gnu.org/gcc-10/porting_to.html

I think -fallow-argument-mismatch should work as a workaround for these issues

rem1776 commented 2 years ago

1042 updates autotools with m4 tests to check and add the flag.

Keeping this open since the CMake build should be getting a similar update.