[SciPy-user] reading binary files written by a gfortran code...

Benedikt Koenig lists@benair....
Mon Jun 16 01:57:30 CDT 2008

Hi Fred,

I am not sure whether I get you question right, but I once had the
problem, that a program complied with gfortran could not read binaries
written by the same version but compiled with ifort or g77.

This was caused by the marker length Fortran uses in binary files. Ifort
and g77 used a length of 4 bytes, whereas gfortran uses whatever is
stored in "off_t" on the parcticular system. So adding the following
compile option to gfortran did the job for me:
FFLOAT = -frecord-marker=4


Am Sonntag, den 15.06.2008, 13:54 +0200 schrieb fred:
> Hi,
> Ok, this is a well known issue that binary files written by a fortran 
> program have a "special" format.
> So my question is : is it possible to write binary file _using gfortran_
> (no problem with intel fortran compiler) without this formatting ?
> Is there a peculiar syntax to the open() function ?
> I did not find any relevant information on the web.
> The obvious reason is that I have to read these files with 
> scipy.io.numpyio fread method.
> TIA.
> Cheers,

More information about the SciPy-user mailing list