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 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 that. 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? I took a brief
look, and the only thing I saw was the -finteger-4-integer-8 option
and friends, but that sounds like going the opposite direction you
want to go, and the -ff2c option that generates C code. You could run
the code through g77 on 32-bit, gfortran on 64-bit, and compare the C
code generated for the file handling. But I suspect that's more hassle
than you want to get into; it doesn't sound like fun to me.

Good luck.

--
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]