Re: READ-statement and a segmentation fault



In article <4p8vnfFhusv8U2@xxxxxxxxxxxxxx>,
Jan Vorbrüggen <jvorbrueggen@xxxxxxxxxxxxxxx> writes:
How is the 'binary' data file generated (ie., by some other code
compiled with an old Fortran compiler)? I'd guess that you're
getting hit by gfortran's 64-bit recorder marker whereas many/most
non-modern compilers use a 32-bit recorder marker.

For such incompatible changes, the DEC compiler RTLs tended to have an
elaborate set of ways of setting such parameters. You could specify the
default at compile time, use an environment variable to set or override,
if you will, at run time, and in at least one case override again on a
LUN-specific basis, again per environment variable.

Is there an extension to OPEN to set the size of the record marker in gfortran?


There is a -frecord-marker option, but IIRC it has some issues

`-frecord-marker=LENGTH'
Specify the length of record markers for unformatted files. Valid
values for LENGTH are 4 and 8. Default is whatever `off_t' is
specified to be on that particular system. Note that specifying
LENGTH as 4 limits the record length of unformatted files to 2 GB.
This option does not extend the maximum possible record length on
systems where `off_t' is a four_byte quantity.

A patch was posted a few months ago. It hasn't made its way
into the code base (due to copyright assignment issues and
the patch submitter relocation). A fairly long thread
concerning the issues starts at

http://gcc.gnu.org/ml/fortran/2006-07/msg00221.html

The technical discussion that followed was trying to get everyone
to agree on the best approach to "fixing" the incompatibility.

--
Steve
http://troutmask.apl.washington.edu/~kargl/
.



Relevant Pages

  • Re: READ-statement and a segmentation fault
    ... compiled with an old Fortran compiler)? ... non-modern compilers use a 32-bit recorder marker. ... default at compile time, use an environment variable to set or override, ... the beginning of the new file format, and switch to the old format ...
    (comp.lang.fortran)
  • Re: READ-statement and a segmentation fault
    ... compiled with an old Fortran compiler)? ... non-modern compilers use a 32-bit recorder marker. ... default at compile time, use an environment variable to set or override, ...
    (comp.lang.fortran)
  • Re: READ-statement and a segmentation fault
    ... non-modern compilers use a 32-bit recorder marker. ... I predict that lots of people will get hit by that one. ... And no, having a compiler switch ... That's because the codes include libraries that are used in many other ...
    (comp.lang.fortran)
  • RFC: XCall calling convention...
    ... compiler, although what I have implemented thus far differs from this spec ... Arguments are passed on the stack in right-to-left order, ... This will attempt to specify Signature strings as applied to data types. ... reference to type ...
    (alt.lang.asm)
  • Re: Some newbye questions
    ... Why have I to specify twice the type of the output of a function? ... By far the easiest way to get such an explicit interface is ... on the particular compiler. ... Unless you have huge arrays of logicals or some such thing, ...
    (comp.lang.fortran)