octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoiding g77


From: John W. Eaton
Subject: Re: Avoiding g77
Date: Wed, 26 Nov 2014 12:06:51 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0

On 11/26/2014 11:41 AM, Daniel J Sebald wrote:
On 11/26/2014 10:03 AM, Mike Miller wrote:
On Tue, Nov 25, 2014 at 23:08:41 -0800, Rik wrote:
I think the best solution may be an explicit check for g77 and
issuing an
error message if it is selected.

How about a version check instead? The g77 program only exists for gcc
<  4. Add a check for GFORTRAN_VERSION, and if it is a GNU compiler and
the version is less than 4, issue an error? That seems more robust
than checking for the name being g77.

I was concerned about the brittleness of the sed solution, and
accidentally
found that it is not robust.  The prologue which replaces g77 with
gfortran
is run at the end of the bootstrap sequence.  However, if the time
stamp on
configure.ac is modified, then the existing Makefiles take care of
re-running aclocal, automake, and autoconf.  They do not run any
bootstrap
epilogue so the effect is to re-instate the default AC_PROG_F77 macro
from
autoconf which has g77 listed first.  If you are a developer,
adjusting the
time stamp can happen whenever you do an 'hg update' where there has
been a
change in configure.ac.  This is important because 'make dist'
packages up
the configure script that it finds into the tarball.  If one isn't
aware of
this oddity then the wrong configure script can be exported to
everyone.  I
checked the tarballs for versions 3.8.2, 3.8.1, 3.8.0, and 3.6.4 and
they,
at least, are clean.

Agreed, that could happen. So are you proposing to delete
bootstrap_epilogue, and we say that an error check at configure-time
for g77 (or less than version 4) is enough to avoid the original
problem this was meant to solve? That sounds like a decent compromise
to me, especially now that systems with g77 are increasingly rare.

I'm fine with the change as well.  The use of the epilogue isn't such a
problem, as much as the sed modifying and overwriting the file "configure".

One small variation on Rik's solution is the following:  If gfortran is
our preferred compiler, we could first check for gfortran above all
others using legal AC syntax, i.e.,

AC_PROG_F77([gfortran])
if F77 is not defined
   AC_PROG_F77
   if F77 is g77
     error message "g77 is not supported, please choose another FORTRAN
77 compiler via environment variable F77
   fi
fi

This seems like a reasonable solution to me. I'm not as concerned about g77 being installed with some other name, but if there is a way to identify g77 without just looking at the name of the program that would be fine with me too.

I agree that the problem I was trying to solve is probably not much of a problem now, though it certainly was for a while, when people had old versions of g77 installed that were incompatible with their version of GCC.

Thanks,

jwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]