[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Avoiding g77
Daniel J Sebald
Re: Avoiding g77
Wed, 26 Nov 2014 10:41:08 -0600
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:188.8.131.52) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16
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.,
if F77 is not defined
if F77 is g77
error message "g77 is not supported, please choose another FORTRAN
77 compiler via environment variable F77