(j3.2006) (SC22WG5.3939) [Fwd: Call graph generator?]

John Reid John.Reid
Thu Jan 29 12:14:10 EST 2009



-------- Original Message --------
Subject: Re: Call graph generator?
Date: Thu, 29 Jan 2009 17:06:46 +0000
From: Dr David J Worth <david.worth at stfc.ac.uk>
To: John.Reid at stfc.ac.uk
CC: Greenough, C (Christopher) <christopher.greenough at stfc.ac.uk>
References: <49818325.3050204 at stfc.ac.uk>

John, for forwarding.

There is a method for generating call graphs as images using Doxygen
(http://www.stack.nl/~dimitri/doxygen/  ).  It has only been targeted at
Fortran in the last year - I have used version 1.5.6 in what follows.

I have Fortran 90 code in .f90 files all in one directory (subdirectory
'code' of the current directory) though it can cope with multiple source
directories.

Step 0
--------
Install doxygen >= 1.5.6 and graphviz for the dot program that draws the
call graphs.

Step 1
--------
Run doxygen -g
which creates Doxyfile that tells doxygen what you want it to do.

Step 2
--------
Edit Doxyfile. The important entries are:
PROJECT_NAME
OPTIMIZE_FOR_FORTRAN (set to YES)
EXTRACT_ALL (set to YES)
EXTRACT_PRIVATE (set to YES)
EXTRACT_STATIC (set to YES)
INPUT (in my case it is "./code")
FILE_PATTERNS (if extension is not .f90)
HAVE_DOT (set to YES)
CALL_GRAPH (set to YES)
CALLER_GRAPH (set to YES if you want)
DOT_PATH (if the dot program from graphviz is not in your $PATH)

Step 3
---------
Run doxygen Doxyfile
HTML and LaTeX files created by default in html and latex sub
directories.

Step 4
--------
Open html/index.html in your browser. Click the Files tab and then click
the file containing a procedure for which you want the call/caller
graphs. Nodes in the graphs are "clickable" to take you to that
function.

I have attached example call and caller graphs.

Regards

David



-- 
Dr D.J. Worth

Computational Science & Engineering Dept   e-mail: david.worth at stfc.ac.uk
Science and Technology Facilities Council  phone:  0(44)1235 445894
Rutherford Appleton Laboratory             fax:    0(44)1235 446626
Didcot, Oxon OX11 0QX, UK

-------------- next part --------------
A non-text attachment was scrubbed...
Name: call.jpg
Type: image/jpeg
Size: 6811 bytes
Desc: not available
Url : http://j3-fortran.org/pipermail/j3/attachments/20090129/4ea35dc0/attachment-0002.jpg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: caller.jpg
Type: image/jpeg
Size: 48543 bytes
Desc: not available
Url : http://j3-fortran.org/pipermail/j3/attachments/20090129/4ea35dc0/attachment-0003.jpg 



More information about the J3 mailing list