How to debug fortran under linux

How to debug fortran under linux

Post by Andrew Mai » Wed, 25 Sep 1996 04:00:00



Hi

I have to port some fortran code  from VAX to linux.  Having got
rid of most of the syntax problems my program now crashes with a
segmentation fault.  Therfore I would like to have a look at the
program with a de*.  But as far as I can see gdb does not
support fortran (yet). Is there a de* which will support
fortran.  

F2c, to make C code which is then debuggable by gdb does not seem to be
an alternative, as it crashes all the time. Maybe because the source
files are huge, up to ~1.5 meg.

And, no I do not want to rewrite the program in C I just want to
port it.

Thanks in advance

        Andrew
--
Andrew Maier                            Tel:    +41-22-76-72190
CERN/PPE                                FAX:    +41-22-782-3084

Switzerland            

 
 
 

How to debug fortran under linux

Post by Jeff Tayl » Wed, 25 Sep 1996 04:00:00




> Hi

> I have to port some fortran code  from VAX to linux.  Having got
> rid of most of the syntax problems my program now crashes with a
> segmentation fault.  Therfore I would like to have a look at the
> program with a de*.  But as far as I can see gdb does not
> support fortran (yet). Is there a de* which will support
> fortran.  

> F2c, to make C code which is then debuggable by gdb does not seem to be
> an alternative, as it crashes all the time. Maybe because the source
> files are huge, up to ~1.5 meg.

> And, no I do not want to rewrite the program in C I just want to
> port it.

> Thanks in advance

>    Andrew
> --
> Andrew Maier                               Tel:    +41-22-76-72190
> CERN/PPE                           FAX:    +41-22-782-3084

> Switzerland            

I don't have any trouble using gdb to debug fortran programs that were
compiled with g77.  Have you tried this compiler?

Jeff

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Jeffrey S. Taylor                               Protein Crystallography
The Wistar Institute and                        Molecular Modelling
The University of Pennsylvania                  Software development
Philadelphia, PA 19104                          Molecular Biology

                                WWW     http://www.veryComputer.com/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

 
 
 

How to debug fortran under linux

Post by Brian K. El » Fri, 27 Sep 1996 04:00:00



>I have to port some fortran code  from VAX to linux.  Having got
>rid of most of the syntax problems my program now crashes with a
>segmentation fault.  Therfore I would like to have a look at the
>program with a de*.  But as far as I can see gdb does not
>support fortran (yet). Is there a de* which will support
>fortran.  

        Get the beta version of g77. We have recently ported over 200
astronomical programs, called FTOOLS, to Linux and it was very easy
using g77, version 0.5.18 to be specific with the Gcc 2.7.2. You can
use gdb to track down any difficulties. Oh, our package is over a
million lines of code, and have FORTRAN calling C routines and vice-versa.
We were able to port the entire package to Linux in about 2 weeks of work,
on and off. There are still some minor bugs dealing with uninitialized
variables in some of the packages, but those are easy to track once they
crop up.

Quote:>F2c, to make C code which is then debuggable by gdb does not seem to be
>an alternative, as it crashes all the time. Maybe because the source
>files are huge, up to ~1.5 meg.

        Using f2c creates virtually unreadable C code, so really isn't
worthwhile to attempt to debug. The installation of g77 is quite easy since
it is basically a patch to the standard gcc source. As a result you install
the g77 patch and go a complete rebuild. G77 uses the same backend as
do gcc and g++.

Quote:>And, no I do not want to rewrite the program in C I just want to
>port it.

        No need with g77. Give it a try. We are going to move to support
g77 on all of the platforms that our astronomical tools have to function
on shortly. I think you will be pleasantly surprised with its ease of use.

                                                Brian

 
 
 

How to debug fortran under linux

Post by Andrey V Khavryutchenk » Wed, 02 Oct 1996 04:00:00




> >I have to port some fortran code  from VAX to linux.  Having got
> >rid of most of the syntax problems my program now crashes with a
> >segmentation fault.  Therfore I would like to have a look at the
> >program with a de*.  But as far as I can see gdb does not
> >support fortran (yet). Is there a de* which will support
> >fortran.
>         Get the beta version of g77. We have recently ported over 200
> astronomical programs, called FTOOLS, to Linux and it was very easy
> using g77, version 0.5.18 to be specific with the Gcc 2.7.2. You can
> use gdb to track down any difficulties. Oh, our package is over a
> million lines of code, and have FORTRAN calling C routines and vice-versa.
> We were able to port the entire package to Linux in about 2 weeks of work,
> on and off. There are still some minor bugs dealing with uninitialized
> variables in some of the packages, but those are easy to track once they
> crop up.

How you're dealing with values in common blocks while debugging?  
AFAIK gdb can't display them.

Or your programs do not use commons?

SY
--
Andrey V Khavryutchenko

Interests: Computational Chemistry, Nanotech, OOA&OOP, The Net

Quote of the day:
  The cost of living is going up, and the chance of living is going
  down.

 
 
 

1. Fortran Debugging trouble + comercial Fortran

Hi all,

        Two questions if a fortran guru can help.  

When the following command is run (with the -o for debugging), the
following error is produced:

"f77 (or g77) -g -o myfile myfile.f"

ld: Output file requires shared library `libc.so.4'
cc: Internal compiler error: program ld got fatal signal 6

I updated the shared library "just in case" to no avail.  Can anyone
help me out here?  Obviously libc.so.4 _is_ available!!

Also, can anyone recommend a commercial f77 or fortran90 compiler for
linux?

Many thanks,

Brent Russell,
Physics Department,
Otago University,
Dunedin,
New Zealand.

2. SSH2 installation. Error message "Unable to get pty ."

3. How to debug fortran with gdb on linux ?

4. Future Domain TMC-850MCD?

5. Fortran and C Compiler for Linux (Ex Apollo Domain Fortran)

6. Booting a PC

7. EDC Fortran or MicroWay NDP Fortran run on Linux?

8. HP 1300 series W/ FC1&2 (& YDL)

9. Debugging Fortran, C and C++

10. Fortran Debugging Alternative to gdb?!

11. Debugging c-code (with vars declared in fortran)

12. How to debug fortran program?

13. DDD - GDB - FORTRAN - Debug