Re: Question on multiple compiler environment
- From: Janne Blomqvist <foo@xxxxxxxxxxx>
- Date: Wed, 27 Sep 2006 18:22:49 +0300 (EEST)
beliavsky@xxxxxxx wrote:
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
If Windows has anything like make you could have a make target for the
main program something like (not tested, probably I forgot some detail
about make syntax):
main.o:main.f90
echo "character(len=*) :: compvers = 'compiled with `$(FC) -V` on `date`" >compvers.inc
$(FC) $(FCFLAGS) $<
I.e. before you compile the main program you store the output from
the compiler version command in an include file, and the in the main
program you include said file.
Or something like that.
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?
In RCS/CVS, you have "variables" like "$Id$" which get expanded to
"$Id: filename revision author etc.$" when committing the file to the
repository. See the co(1) man page for the different keywords you can
use.
So just have something like
character(len=*) :: version = "$Id$"
in your source file.
I'm not sure if more modern version control systems like subversion
have similar keyword expansion features. Wouldn't surprise me.
--
Janne Blomqvist
.
- Follow-Ups:
- Re: Question on multiple compiler environment
- From: Brooks Moses
- 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
- Re: Question on multiple compiler environment
- From: beliavsky
- Question on multiple compiler environment
- Prev by Date: Re: Error in opening the Library module file
- Next by Date: Re: Strange Porting Problem CVF to IVF, requesting help and ideas.
- Previous by thread: Re: Question on multiple compiler environment
- Next by thread: Re: Question on multiple compiler environment
- Index(es):
Relevant Pages
|
Loading