Re: Question on multiple compiler environment
- From: "Joost" <jv244@xxxxxxxxx>
- Date: 27 Sep 2006 05:17:05 -0700
Matthias Möller wrote:
Most compilers, especially the ones under UNIX/Linux, have
options like -v, -V or --version to print the version number to the
screen/standard output. You will then have to analyse that output.
Yes I know but nevertheless thank you for your answer. But this requires
to write some kind of script which extracts the version number from the
console output.
1. the "layout" of the console output differs from one compiler to another.
2. the "layout" may differ from one version to the other.
As a consequence, the scripts must be adapted each time a new version is
available. Isn't there a more elegant way to determine the version number?
Matthias
generally no. Some compilers might define preprocessor macros:
e.g. g95 defines
__G95__ 0
__G95_MINOR__ 50
__FORTRAN__ 95
__GNUC__ 4
so you can compile
~/g95> cat version.F90
i=__G95__ ; j=__G95_MINOR__
write(6,'(I0,A1,I0)') i,".",j
END
to get the answer.
The other approach is to have a configure step which actually executes
your compiler on a testcase with a set of flags and see if it generates
an error or not. If there is no error, you use those flags to compile
the full source, otherwise, you try the next set of flags and so on.
Joost
.
- References:
- Question on multiple compiler environment
- From: Matthias Möller
- Re: Question on multiple compiler environment
- From: Arjen Markus
- Re: Question on multiple compiler environment
- From: Matthias Möller
- Question on multiple compiler environment
- Prev by Date: Re: Question on multiple compiler environment
- Next by Date: Re: Question on multiple compiler environment
- Previous by thread: Re: Question on multiple compiler environment
- Next by thread: Re: Question on multiple compiler environment
- Index(es):
Relevant Pages
|