autoconf
[Top][All Lists]
Advanced

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

Fortran 9x: time for a decision


From: Steven G. Johnson
Subject: Fortran 9x: time for a decision
Date: Sun, 27 Oct 2002 01:56:22 -0500
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.0.0) Gecko/20020614 Debian/1.0.0-3

With each year that goes by, the need to address this issue in autoconf and automake increases. We need to make a decision, especially since people keep submitting patches with conflicting strategies for this issue.

Kate Hedstrom wrote:
It seems to me that the compiler name of $F77 is unfortunate in that it
cries out for $F90 and $F95 friends. Some versions of make use $FC
instead - can we change the $F77? Ignoring that everything is called f77,
I could use fortran.m4 as it stands if the compiler search were reversed,
with f95 first and f77 last. Bill Wendling's module check is a useful
addition, as is the f95 forall check.

Every time this issue comes up, there are various people who come out of the woodwork to say that they need to compile both Fortran 77 and F9x in the same project, where the former are legacy codes written in ways incompatible with the newer standards.

On the other hand, it is completely crazy to have a new F?? for every revision of the Fortran standard. Moreover, the newer revisions seem to be much more compatible with one another, so that most(?) F90 codes will compile under F95, etcetera, and more importantly they seem less likely to be mixed in a single project.

I've been thinking about this, and my suggestion is:

1) Have two compilers, F77 and FXX, where the former tries to be F77 (i.e. the current behavior) while the latter is selected by AC_PROG_FXX([year], [search-list]), where year is YY or YYYY with YY < 54 interpreted as 20YY, and with the default year being the latest supported Fortran standard. Unknown years trigger an error. (Have $FXXFLAGS etc. in analogue to $FFLAGS etc.) Rationales:

-- Leaving F77 etc. with the current behavior maintains backwards compatibility, and allows people to compile mixed programs of Fortran 77 and some other Fortran dialect.

-- Allowing the year to be selectable for FXX, rather than always using the latest version, allows people to handle the minor backwards-incompatibilities between e.g. F90 and F95, if desired.

-- Mixing Fortran dialects other than F77 and FXX is postulated to be unlikely, and having a single variable for all dialects going forward is extremely desirable(!!!).

-- FXX seems a clear name for a Fortran compiler from an arbitrary year. It works as a prefix for FLAGS, etcetera, unlike FC which doesn't (FCFLAGS would break the analogy with CC/CFLAGS).

-- FXX also draws a parallel with C++ (CXX). This seems to mesh with people's viewpoints on the evolution of Fortran, for better or for worse. =)

             **This will require coordination with automake.**

2) All the AC_F77_* macros will have corresponding AC_FXX_* macros, with corresponding macros sharing the same backend _AC_FXX_*. These backend macros will use a new macro _AC_LANG_PREFIX (or whatever you want to call it) that returns C/CXX/F/FXX etcetera depending upon the current language. Rationales:

-- the desirability of sharing backends between F77 and FXX is obvious, and from familiarity with the macros I believe it should be possible with at most minor tweaks via AC_LANG_CASE.

-- you need some way to use FFLAGS or FXXFLAGS, FLIBS or FXXLIBS, etcetera. This mechanism might as well work for all languages.

-- there is already an _AC_LANG_ABBREV macro that returns c/cxx/f77 etcetera, which can be used for cache variables and so on.
                
Steven







reply via email to

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