Compiling your Fortran program for debugging |
|
In order to use a debugger like gdb to track the execution of your Fortran program, it is necessary to compile the program with the ``-g'' option. For example, suppose your source file is called foo.f. To compile it, you'd type:
f77 -g foo.f -o foo
The ``-g'' option is necessary for the correct option
of the debugger.
The command above will create an executable file named ``foo''. You can run this executable normally, but you can also run it under the control of the gdb debugger to find out what it is actually doing. See `Starting your Fortran program with gdb'.