Re: Do different compilers produce different .mod files?



On 2008-03-04 16:12:12 -0400, GaryScott <garylscott@xxxxxxxxxxxxx> said:

On Mar 4, 1:21 pm, nos...@xxxxxxxxxxxxx (Richard Maine) wrote:
<bonza...@xxxxxxxxxxx> wrote:
Does anyone
know if G95 .mod files should be compatible with other compilers? i
would have though so.

No. The .mod files are compiler-specific. Heck, it is even
compiler-specific whether there is such a thing as a .mod file. Putting
the necessary information in a .mod file is the most common
implementation scheme - enough so to have become a bit of a defacto
standard - but it is not the only scheme.

It has even happened that .mod files are incompatible between different
versions of the same compiler... just like it has happened that object
files have beeen simillarly incompatible. Vendors try to avoid such
version incompatibilities (because it makes life difficult for
customers, who then in turn make life difficult for the vendors), but it
has happened.


Such incompatibilities usually imply to me less than ideal design of
the .mod file structure. There's almost never good justification for
such incompatibilities. It is sometimes due to laziness, for example
creating the file structure as a sequence of structures with no
tagging/markup whatsoever. A tiny bit of thought, such as tagging
(e.g. escape sequences but a little more sophisticated), can avoid all
incompatibilities, and with minimal I/O performance impact (slightly
more difficult to process tho).

The information that a compiler wants to obtain from a USE statement
could be as little as some symbols with a small of amount of additional
information or as much as the full source of the module. There is no
single design that could meet such varying objectives. The Fortran
specification does not say what is there and the actual contents would
depend upon how agressive the compiler implementors choose to be in
being able to analyse the whole program. Those with minor requirements
would certainly object to servicing the needs of those with much more
extensive requirements.

If one were running a Fortran interpreter the USE statement would want
the full source (or functional equivalent) to allow the current program
to be interpreted.

It is a real pain to recompile those old CDC6600 object files to run
on a PC but it is an incompatability that folks have learned to live with.
I do not recall seeing such a complaint in this newsgroup!

--
Richard Maine                    | Good judgement come
s from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle           |  -- Mark Twain


.



Relevant Pages

  • Re: Do different compilers produce different .mod files?
    ... creating the file structure as a sequence of structures with no ... incompatibilities, and with minimal I/O performance impact (slightly ... The information that a compiler wants to obtain from a USE statement ... Your complaint would make sense if the semantics of the .mod were constant ...
    (comp.lang.fortran)
  • Re: Do different compilers produce different .mod files?
    ... creating the file structure as a sequence of structures with no ... incompatibilities, and with minimal I/O performance impact (slightly ... The information that a compiler wants to obtain from a USE statement ... It is a real pain to recompile those old CDC6600 object files to run ...
    (comp.lang.fortran)
  • Re: Do different compilers produce different .mod files?
    ... creating the file structure as a sequence of structures with no ... incompatibilities, and with minimal I/O performance impact (slightly ... The information that a compiler wants to obtain from a USE statement ... Your complaint would make sense if the semantics of the .mod were constant ...
    (comp.lang.fortran)
  • Re: Do different compilers produce different .mod files?
    ... such incompatibilities. ... creating the file structure as a sequence of structures with no ... (e.g. escape sequences but a little more sophisticated), ... I would blame the marketing dept for a dearth of foresight before I would the compiler writers.... ...
    (comp.lang.fortran)
  • Re: Do different compilers produce different .mod files?
    ... creating the file structure as a sequence of structures with no ... incompatibilities, and with minimal I/O performance impact (slightly ... It is a real pain to recompile those old CDC6600 object files to run ... for the right team colors when there is no chance they will fit inside. ...
    (comp.lang.fortran)