Re: Question on multiple compiler environment



beliavsky@xxxxxxx wrote:

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?

Again, the details of this are implementation-dependent. On Windows,
the usual approach is to define a version resource in a resource file
which is then linked with the executable. This will make your version
info available as a property of the EXE (or DLL). You can have a
pre-build step that finds the version info from your source control
system and constructs the appropriate .rc file for building into a .res
file. Elsewhere, "what strings" with a specific syntax are often used,
though you have to take care how you embed these in the program, making
sure that the compiler doesn't discard unused variables.


Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH

User communities for Intel Software Development Products
http://softwareforums.intel.com/
Intel Fortran Support
http://developer.intel.com/software/products/support/
My Fortran blog
http://www.intel.com/software/drfortran

.