The f77 Problem Page

People who know me might know that I think f77 is a problem itself, however this page is dedicated to f77reorder the f77 filter which solves some compatibility problems of the f2c fortran-2-c translator and other f77-extended-standard compilers.

The f2c program is a big help for compiling fortran programs on linux. There are other compilers available, among them g77 by the FSF (gnu). g77 suffers however from some serious incompatibilies which makes it unusable for standard HEP code. But g77 is not yet completed. It needs founding of a small scale compared to normal HEP software costs. We did not hear of any experiences with the NAG fortran compilers. Feel free to submit them to me

f77 extensions handled by f77reorder

Download the latest version of f77reorder(2.28) (A set of new functions for libf77 & a man page by Alex Romosan for the Debian GNU/Linux project. See Changelog for details)

IMPORTANT NOTICE:
If you have any kind of problems with the f77reorder script, don't hesitate a second to tell me about it. Otherwise the problem will certainly NOT get fixed.

The following extensions to f77 are not allowed within f2c. f77reorder modifies the code passed to f2c in order to avoid compilation errors.

f77 extensions NOT handled by f77reorder

f77reorder error messages

f77reorder is not forgiving any errors it encounters in the variable declaration part of the f77 functions. In fact it stops execution at the first error it finds. This behaviour should be fixed in a later version!

Due to my lack of f77 knowlegde it might also happen that f77reorder regards some variable declaration as an error which in fact is an allowed one. Please send me the complete source files in such a case to fix the problem. We were however not able to find any inconsistencies in 40000 lines of f77 code tested... f77reorder error messages are:


Debugging f77 code

A collegue of mine states that you do not need debuggers if you write good code (I will *not* include his code to test his statement here ;-)

There are two options of including debug information for f77 code with f77reorder:
  1. Debugging in the f2c generated C code
    The options to pass to f77 in this case are -g --keepC. This will tell f2c (using the f2c option -c) to include the original f77 lines into the program as C comments. The advantage for the programmer is that the access of common blocks with this method is easy as one gets the f2c generated common block names from the C code while being able to check the execution of the f77 code in the f77 code inlined as C comments.
  2. Debugging in the f77 source code
    The options to pass to f77 are -g only (available since version 2.15 of f77reorder). f77reorder passes the -g option to f2c causing it to spit out #line information in the C code. f77reorder then corrects this #line information in a second step to change it back to the original source and include file lines before cpp and f77reorder steps which probably changed the line and source file information.
    Debugging works well here. One has to take into account that common blocks are put into structures by f2c and can use the common-block name together with gdb's TAB-expansion to get to the generated common-block names. Variables and functions can however be accessed directly.
    With one exception: To set a break point at the program start one has to type
    b MAIN__
    
    on the gdb prompt.
    Last modified: Thu Nov 05 17:13:45 1998
    Wolfgang Wander, wwc@ralph2.mit.edu