netcdf-fortran icon indicating copy to clipboard operation
netcdf-fortran copied to clipboard

ignoring unknown option '-fallow-argument-mismatch' warnings when using Intel compiler

Open DusanJovic-NOAA opened this issue 4 years ago • 3 comments

When I build netcdf-fortran 4.5.3 using Intel compiler I see many warnings like:

/bin/sh ../libtool  --tag=FC   --mode=compile mpiifort -I. -fPIC -fallow-argument-mismatch -mismatch_all -c -o module_netcdf_nc_interfaces.lo  ../../fortran/module_netcdf_nc_interfaces.f90
libtool: compile:  mpiifort -I. -fPIC -fallow-argument-mismatch -mismatch_all -c ../../fortran/module_netcdf_nc_interfaces.f90 -o module_netcdf_nc_interfaces.o
ifort: command line warning #10006: ignoring unknown option '-fallow-argument-mismatch'
ifort: command line warning #10006: ignoring unknown option '-mismatch_all'

I think these two flags are only recognized by the GNU compiler.

This is what I see in the config.log:

configure:6944: checking if Fortran compiler supports allow-mismatch flag
configure:6952: mpiifort -c   -fPIC  -fallow-argument-mismatch conftest.f90
ifort: command line warning #10006: ignoring unknown option '-fallow-argument-mismatch'
configure:6955: $? = 0
configure:6962: result: yes
configure:6966: checking if Fortran compiler supports mismatch_all flag
configure:6974: mpiifort -c   -fPIC -fallow-argument-mismatch  -mismatch_all conftest.f90
ifort: command line warning #10006: ignoring unknown option '-fallow-argument-mismatch'
ifort: command line warning #10006: ignoring unknown option '-mismatch_all'
configure:6977: $? = 0
configure:6984: result: yes

Even though mpiifort does not recognize the options, config tests are successful and these two flags are added to FCFLAGS.

DusanJovic-NOAA avatar Sep 02 '20 16:09 DusanJovic-NOAA

Well this is clearly not right, and also we need to be able to build netcdf-fortran without those flags on GNU! Which I don't know how to do. ;-) (Do you know @DusanJovic-NOAA ?)

edwardhartnett avatar Sep 03 '20 14:09 edwardhartnett

I don't. Other than fixing code to not use same subroutine with different type/kind/rank actual arguments.

DusanJovic-NOAA avatar Sep 03 '20 16:09 DusanJovic-NOAA

We'd very much welcome a PR to fix these subroutines, but in the short term I will get this fixed so that the flags aren't appended when they clearly shouldn't be :)

WardF avatar Sep 03 '20 17:09 WardF