This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: g77 on cygwin64



On 2/12/2014 12:59 PM, David Conrad wrote:
On Wed, Feb 12, 2014 at 12:16 PM, Andrey Repin wrote:
The strange thing is that gfortran does compile the code, but
once compiled, the executables have strange behavior mainly involving
problems reading in data files. ...
And this is finally the information, that we can work with.
My wild guess is that your "colleagues" making certain assumptions about
files, that not always true on other systems.
I.e. opening a file in text mode, and then treating [its] data as binary ...
Since the problem occurs going from 32-bit to 64-bit Cygwin, it sounds
to me like all-the-world's-a-VAX syndrome. I bet there are places
where it reads from files and assumes that if it reads N words into
integers, that is N 32-bit quantities, or something like t:hat. I
haven't written any Fortran since the 1980s, but I bet there are types
that have changed size due to the switch to 64-bit and that results in
reading incorrect values from files, including reading some of them
from the wrong file offsets, and hitting end-of-file at a different
point.

Are there any switches to gfortran that control this?
ifort still has switches for selecting the VAX convention of measuring RECL in 32-bit words vs. the f2003 recommended convention of byte size. gfortran (and afaik g77) used byte lengths only. Note that 32-bit g77 unformatted direct access files were never intended to work with any 64-bit mode compiler (not even the buggy 64-bit g77) and can't be expected to work with gfortran (you would need to make those data files from scratch):

http://gcc.gnu.org/onlinedocs/gcc-3.4.4/g77/Portable-Unformatted-Files.html

Also important is the point made above that g77 may have allowed indiscriminate switching between formatted and unformatted or direct and sequential access files, or read after write, but the run-time errors should shed light on that, and you would need to watch for unsuspected problems if g77 let it through.

--
Tim Prince


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]