View Full Version : [SOLVED] What's wrong with gfortran in Fedora 15?

13th June 2011, 07:11 AM
Hello everybody.

Today I was trying to compile some Fortran programs I created several months ago. Needless to say that once finished they worked well (compiled & run) under F14 (and whatever version of gfortran it had).

Now that I installed F15 and try to use those programs I can not even compile it: to begin with I am getting a stupid error stating that there are wrong types of numbers assigned (integer/real) when after checking the code that's not the case.

Are there new options one has to pass to the command line compiler in order to work?


---------- Post added at 01:11 AM ---------- Previous post was at 12:43 AM ----------

I figured it out after reading the release notes for 4.6 version of GCC: http://gcc.gnu.org/wiki/GFortran#GCC4.6

Apparently the problem is originated by a flag gfortran now uses by default: -fwhole-file; which supposedly optimizes the file. Fortunately it can be deactivated using the "counter-flag" -fno-whole-file.

Using the above counter-flag solved my problem.

17th June 2011, 08:12 AM
Recently, I also found something strange in gfortran of F15. One of my fortran code can be run correctly in F14, but in F15, the system echoes 'Fortran runtime error: Sequential READ or WRITE not allowed after EOF marker, possibly use REWIND or BACKSPACE'. What's wrong?

---------- Post added at 03:12 PM ---------- Previous post was at 02:29 PM ----------

I added a 'backspace' before the 'write', then the error gone.

3rd November 2011, 08:38 PM
From an uninitiated: I am having the same problem with cfour a quantum chemistry package. I upgraded unbuntu to 11.10 and then I got that error message: "Fortran runtime error: Sequential READ or WRITE not allowed after EOF marker, possibly use REWIND or BACKSPACE".

If the problem can be solved by "it can be deactivated using the "counter-flag" -fno-whole-file."
what does it mean? what do I have to do?


11th November 2011, 04:02 AM
Yes, I have the same problem. I have tried on F15 and Ubuntu 11.10, I get this error when I run a program I use for my research as well. I am not a programer so I would also be very interest in a 101-style patch I could apply to the effected fortran file.

I am also curious if there is a way to downgrade the fortran compiler I am using so that programs which work on older distros will not be effected.