Fortran User's Guide

-pg

Compile for profiling with the gprof profiler.

    SPARC: 77/90 x86:77

Compile self-profiling code in the manner of -p, but invoke a runtime recording mechanism that keeps more extensive statistics and produces a gmon.out file when the program terminates normally. Generate an execution profile by running gprof.See the gprof(1) man page and the Fortran Programming Guide for details.

Library options must be after the .f and .o files (-pg libraries are static).

If you compile and link in separate steps, and you compile with -pg, then be sure to link with -pg.