Re: Do different compilers produce different .mod files?



GaryScott wrote:
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).

I would blame the marketing dept for a dearth of foresight before I would the compiler writers....

I mean, who hasn't prototyped code that has unintentionally escaped its enclosure? :o)

cheers,

paulv
.



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?
    ... versions of the same compiler... ... such incompatibilities. ... creating the file structure as a sequence of structures with no ... If one were running a Fortran interpreter the USE statement would want ...
    (comp.lang.fortran)
  • Re: C String Prefix Operator Idea (Was: gfortran diagnostics and so on)
    ... There is no need to wait for a compiler vendor to provide the functionality. ... All of these are covered by C99, ... Blank padding at the end is not a big deal in Fortran. ... his escape sequences around as the program is ported to different ...
    (comp.lang.fortran)