how to profile gfortran code?

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Nov 28 17:49:00 GMT 2005


On Mon, Nov 28, 2005 at 10:18:24AM -0500, Jack Howarth wrote:
>     Can anyone describe the procedure for profiling gfortran code
> using the typical gnu devtools? While I could run Shark on MacOS X
> I was going to first try with the normal approach to profiling which
> subroutines in xplor-nih are most used in the gfortran build compared
> to the xlf build. Of course, on Darwin we don't have the option of
> using valgrind. Thanks in advance for any pointers on how to get
> started with this.
>         Jack

Does darwin have gprof?  If so, you can add tha -pg flag
to your gfortran flags.

gfortran -pg -O -o z z.f90
./z
gprof -l -b z gmon.prof | more

-- 
Steve



More information about the Fortran mailing list