[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fortran 9x: time for a decision
From: |
Steven G. Johnson |
Subject: |
Re: Fortran 9x: time for a decision |
Date: |
Fri, 1 Nov 2002 18:57:21 -0500 (EST) |
On Sat, 2 Nov 2002, Andreas Buening wrote:
> Not really. If you have preprocessed Fortran files then "finding a
> compiler" means "finding a compiler with preprocessing". Otherwise
> that compiler is useless (and you should proceed with your search).
If you have C-preprocessed Fortran files, then they are not written in
Fortran. I agree that preprocessed Fortran is an important language to
support and one for which I would love to see autoconf support added in
the future (perhaps via an AC_PROG_FC_CPP macro or whatever), but that's
simply not the problem I'm proposing to address right now.
> > .f90 or whatever for newer code. Is there any F90+ compiler that doesn't
> > interpret .f90 as F90 source??
>
> xlf90, IBM's compiler for AIX. It requires -qsuffix=f=f90.
Kate Hedstrom pointed out the same problem, grrr... This can be dealt
with, though.
> > The general problem of finding a flag to force free-format/fixed-format
> > interpretation is an issue for another macro, I think.
>
> This means you need a "database", one different flag for every compiler.
Nope. You need a list of possible flags to try, and a test to see if
free-format source compiles. Much like AC_PROG_CC_STDC, as I mentioned.
> > Ultimately, this sort of thing has to be handled by custom macros, if the
> > maintainer needs particular nonstandard language features. Particularly
> > common needs might go into the macro repository and from there (maybe)
> > make their way into the standard autoconf.
>
> In other words: You need a "database".
Nope, you need tests to see if a particular feature works, by trying to
compile/run something with that feature. Much like the rest of autoconf.
(That is, you don't need a database of systems and compilers.)
> Some compilers (like f95n) try to find out the source file format
> (fixed/free) themselves. For a "print *, 'hello, world'" test program
> this might work correctly but for a more complicated source file
> it might fail. In this case there is no possibility for autoconf to find
> out whether that compiler can really handle fixed/free format.
Coming up with feature tests can be tricky, but this is not unique to
Fortran. It's the story of autoconf: ingenuity triumphing over insanity. =)
(Mostly, anyway. Only sometimes we can't distinguish the ingenuity from
the insanity.)
That said, I appreciate your comments on the variety of compiler quirks we
will need to deal with. The odds of the initial AC_PROG_FC macros and
friends working right away for all f90+ compilers are approximately zero,
but the support will enlarge over time like every other macro. What else
can you do?
Steven