From: Janus Weil on

> I would like to extract call tree information from a fairly large code
> (containing Fortran90, Fortran77, C, m4 scripts) which is spread
> across
> numerous files and subdirectories.  Can anyone recommend a good
> (hopefully open source) method or tool for doing this in Linux?

There is a nice tool called egypt (http://www.gson.org/egypt/), which
operates on the output of 'gfortran -fdump-rtl-expand'. This seems
like a good choice for your purpose, since it's open source and works
with Fortran and C.

Cheers,
Janus
From: Helge Avlesen on
agng8716 <day_light_2000(a)yahoo.com> writes:

> I would like to extract call tree information from a fairly large code
> (containing Fortran90, Fortran77, C, m4 scripts) which is spread
> across
> numerous files and subdirectories. Can anyone recommend a good
> (hopefully open source) method or tool for doing this in Linux?

hi,
I have a Fortran build system for GNU makefiles (written in Python) that
as a side effect can create static call trees you can try. It generates
html code and ascii files, see an example here

http://www.ii.uib.no/~avle/work/bom/bom.html

Not sure if you can call it "good", but it works on many codes. The tool
was initially created in order to build the monster code "arpege climat"
in parallel, but also works for other codes. The tool can be downloaded
from

http://www.ii.uib.no/~avle/mkdep2.tgz

To install, unpack, enter directory "mkdep" and do "python install.py", then add directory
to path.

Simple usage; lets say you have a bunch of .f90 files in a directory tree

find . -name "*.f90" > files
mkdep -t tree files
firefox tree.html

should create a html page like the example above. if you only need the
tree above the routine TEST3 you can instead say
mkdep -t tree --treetop TEST3 files

The fortran parser is simple, it can detect subroutine and function
calls, but do not know much about name spaces or if a routine is contained
etc. if the code is peppered with cpp directives intermingled with
strings that are continued over multiple lines it can easily be
confused...

--
Helge