automake
[Top][All Lists]
Advanced

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

Re: Fortran 9x support


From: Sander Niemeijer
Subject: Re: Fortran 9x support
Date: Thu, 9 Oct 2003 12:04:00 +0200

Hi,

I can understand keeping F77/FFLAGS/FLIBS/AC_PROG_F77 for backwards compatibility. However, the current approach is to keep using these macros and variables for f77 and use the new FC* ones only for f90 and upwards. My question is whether it is not possible to also include f77 in the FC approach?

If so, this might open up a different way to go forward:
- Only allow the user to use either AC_PROG_F77 or AC_PROG_FC (the old or the new way of doing fortran). - Use FFLAGS and FLIBS for both F77 and FC. This would make the FC approach compatible with GNU make which uses the FC/FFLAGS combination for compiling fortran. The fact that we only allow F77 or FC will prevent conflicts with these variables. - After some time the F77 macro/variable set might be phased out in favor of using the FC approach to do f77 compilation.

Just my 2c.

Regards,
Sander

On vrijdag, okt 3, 2003, at 20:12 Europe/Amsterdam, Steven G. Johnson wrote:

Dear Automake folks,

Recently, we've committed a set of patches to autoconf CVS to support
newer revisions to the Fortran language standard. The current plan is to not document these (yet) in the next autoconf release, but it might be a
good idea to start thinking about how to support these in automake,
especially if revisions to the autoconf macros are required.

I've attached a draft of the documentation for the new macros. The basic idea is to divide Fortran support into two categories: legacy Fortran 77,
and modern Fortran:

* For legacy F77 code, there are the current AC_PROG_F77 etc. macros to
find $F77, $FFLAGS, $FLIBS, and so on.

* For newer Fortran dialects, the idea is to treat them more like C and
C++, in that we don't attempt to have separate macros and variables for
separate language versions going forward. Instead, there are a new set of macros AC_PROG_FC, etcetera (just like the F77 macros with s/F77/FC/) to
find output variables $FC, $FCFLAGS, $FCLIBS, etcetera.

Basically, automake should just compile .f90, .f95, etcetera files with
these new output variables. There is one additional twist: some Fortran compilers (xlf, ifc) expect all source files to end with .f, and require a special flag for other extensions (even "standard" ones like .f90). So,
there is a new autoconf macro AC_FC_SRCEXT to figure out how to do
this. For each source-file extension required, the user should call it,
e.g.:

AC_FC_SRCEXT(f90)
AC_FC_SRCEXT(f95)
...

This defines output variables $FCFLAGS_f90, $FCFLAGS_f95, ... that you can
use to compile .f90 and .f95 files.  Due to compiler quirks, however,
these flags must appear immediately before the source file to be compiled
(and only one source file can be compiled at a time).  For example, you
might do:

foo.o: foo.f90
     $(FC) -c $(FCFLAGS) $(FCFLAGS_f90) foo.f90

Cordially,
Steven G. Johnson
<fortran.doc>





reply via email to

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