Closed andreapiacentini closed 3 years ago
I also hit this issue and got around with -fallow-argument-mismatch
.
Note I then hit another issue which I was able to avoid with -fallow-invalid-boz
integer, parameter :: gen_hash_key_offset = z'000053db'
But then ran into a link issue.
Confirmed with latest MCT on Cori.nersc.gov using gnu 10.1.0.
This discussion suggests its an MPI issues https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91731 So adding that flag is the only way to fix it within MCT.
Unfortunately the -fallow-argument-mismatch
option is not accepted by gfortran <10
The same issue has been dealt with (and extended to NAG compilers) by NetCDF (similar problem of polymorphic calls) in their
https://github.com/Unidata/netcdf-fortran/blob/master/configure.ac
Cf. lines 307 - 350
@rljacob could you please try to insert the corresponding section in the MCT autoconf files (in the main configure or, perhaps, in the fortran configuration in the m4 directory) ?
Thanks
Hi @rljacob Please find here attached a modified configure.ac (requires autoreconf for generating a new configure) capable of detecting the appropriate mismatch flags. It also addresses another issue: passing mpifort (the open-mpi wrapper for whatever fortran is behind), the test looking for ifort in FC gives a false positive. Even if there are separate variables for MPIFC and FC, OASIS only knows the mpi wrapper command and passes it to FC as well. As a partial fix, you'll see that we check beforehand if the wrapped compiler is GNU, before checking for ifort in the FC string. Cheers Andrea configure.ac.zip
Thanks for this! I don't see the fix for ifort.
look for the variable IS_GNU. It takes a yes/no value when AC_PROG_FC tests for the compilers in the provided list.
If the compiler is detected as gnu, we skip the test elif echo $FC | grep ifort >/dev/null 2>&1; then
(the elif order has changed) so that the the appropriate options are selected even if we set FC=mpifort
for the open-mpi wrapper of the gnu compiler in the OASIS Makefile.
It's a pretty specific workaround for the way configure is invoked from the OASIS makefile (there is no difference between MPIFC and FC).
I've got oneapi on my machine (since this morning) and I didn't notice any problem with it (but I did not check carefully what mpi-serial does). Let me know if you want me to have a better look tomorrow.
A.
Ok I understand now. Setting FC to the mpi wrapper should be supported so that's a good fix for any users.
@andreapiacentini please test this PR https://github.com/MCSclimate/MCT/pull/64
Good morning, I am compiling the git master version of MCT on a Mac Os X (Mojave) under Brew. Brew has recently updated gnu compilers to version 10 (as Ubuntu has done on the linux side since version 20.10).
Polymorphic fortran API's are not accepted anymore by default and they require the
-fallow-argument-mismatch
option for gfortran (or mpifort, mpif90 and similar wrappers).The configure should be able to detect the gnu compiler version and add this option (unfortunately not recognised by previous gnu compilers, therefore the test on the version is needed), otherwise make fails on
Thank you very much A.P.