[mpich-devel] overzealous F90/F90FLAGS error

Dave Goodell (dgoodell) dgoodell at cisco.com
Tue Jan 13 10:50:06 CST 2015


On Jan 13, 2015, at 10:20 AM, Jeff Hammond <jeff.science at gmail.com> wrote:

> I understand that configure is trying to help the user do the right
> thing (set FC and FCFLAGS), but this is the wrong way to do it.
> 
> This is the code that I would like to see removed:
> 
> # Since F90/F90FLAGS are replaced by FC/FCFLAGS, rather than silently
> # substituting them, i.e. FC=$F90 and FCFLAGS=$F90FLAGS, we choose to emit
> # an error message and abort to avoid any ambiguous/hidden bug in choosing
> # Fortran90 compilers.
> if test -n "$F90" -o -n "$F90FLAGS" ; then
>    AC_MSG_ERROR([F90 and F90FLAGS are replaced by FC and FCFLAGS
> respectively in this configure, please unset F90/F90FLAGS and set
> FC/FCFLAGS instead and rerun configure again.])
> fi

Rather than remove this code altogether, it might be better to change the logic to complain more like this (untested):

if test -n "$F90" && test "x$F90" != "x$FC" ; then
    AC_MSG_ERROR([F90 set but not equal to FC.  This is almost certainly a mistake.  Either unset F90 or set F90="$FC"])
elif test -n "$F90FLAGS" && test "x$F90FLAGS" != "x$FCFLAGS" ; then
    AC_MSG_ERROR([F90FLAGS set but not equal to FCFLAGS.  This is almost certainly a mistake.  Either unset F90FLAGS or set F90FLAGS="$FCFLAGS"])
fi

-Dave



More information about the devel mailing list