Re: Question on multiple compiler environment
- From: beliavsky@xxxxxxx
- Date: 27 Sep 2006 05:26:48 -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?
I do not think so. The Fortran standard says nothing about such
details, which therefore differ across compilers. Regarding point 2
above, I do not think the layout changes often, so I would write a
script to handle the current layout and do some error checking to
detect changes in version numbers.
I'd like to ask a related question. How does one embed the version
number of a compiler in executables generated by it? For my program
foo.exe on Windows I would like
foo.exe -v
to say something like
"compiled with gcc version 4.0.3 (g95 0.91!) Sep 19 2006"
I have also wondered how to embed information about the source code in
the executable. Currently I define a parameter NVERSION in my main
program and have a line at the beginning
write (*,*) "version #",NVERSION
This method relies on my changing NVERSION manually and on saving old
source codes. I know there exist source control systems such as RCS,
but can one use them to automatically embed version information in an
executable?
.
- Follow-Ups:
- Re: Question on multiple compiler environment
- From: Janne Blomqvist
- Re: Question on multiple compiler environment
- From: Steve Lionel
- Re: Question on multiple compiler environment
- From: simon
- Re: Question on multiple compiler environment
- From: Tim Prince
- Re: Question on multiple compiler environment
- 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: I'm going crazy with the libraries!
- Previous by thread: Re: Question on multiple compiler environment
- Next by thread: Re: Question on multiple compiler environment
- Index(es):
Relevant Pages
|
|