Re: Hard-coding compile date/options
- From: nospam@xxxxxxxxxxxxx (Richard Maine)
- Date: Wed, 3 Jun 2009 13:44:14 -0700
Richard Maine <nospam@xxxxxxxxxxxxx> wrote:
Lorents <lorents@xxxxxx> wrote:
In developmental versions of my programs I sometimes find it useful to...
include in the executable the compile date and the compiler options
used. I'm trying to find the neatest way of doing this.
What I have done so far is to write a small shell script (BTW, I work on
Linux) which creates a small file containing a fortran module which is
then USE'd by my program.
Which is what I want. However, I wonder if there is a way to avoid this
roundabout procedure.
You won't find a more portable way than that. Yes, there are options
using preprocessors, but then you have to worry about compatibility with
the various pre-processors out there.
Hmm. One possible issue does occur to me, though. Compilation of the
multiple object files in a single program can potentially occur at
multiple dates/times. The larger the program gets, the more likely this
is to be a significant issue.
I'll leave to you the question of how important it might be for you to
track the compilation data of individual object files; that's a bit
broader question. I'll just note that if you do try to track such
multiple compilation times, you could run into trouble if you have
multiple program units compiled using different versions of the same
module. Something like an include file might work out better for that.
I also note that your module declares compilation_date and
compilation_details to be variables instead of parameters. For something
that is inherently intended to be defined at compile time, I would think
a parameter would be a more appropriate choice.
--
Richard Maine | Good judgment comes from experience;
email: last name at domain . net | experience comes from bad judgment.
domain: summertriangle | -- Mark Twain
.
- References:
- Hard-coding compile date/options
- From: Lorents
- Re: Hard-coding compile date/options
- From: Richard Maine
- Hard-coding compile date/options
- Prev by Date: Re: Hard-coding compile date/options
- Next by Date: Re: Hard-coding compile date/options
- Previous by thread: Re: Hard-coding compile date/options
- Next by thread: Re: Hard-coding compile date/options
- Index(es):
Relevant Pages
|