| Author |
Profiling Fortran 77 using gprof on linux
|
|
| coolchick 2007-03-22, 7:04 pm |
| Hi,
I have a Fortran77 code here that runs successfully but I want to run
using the gnu gprof profiler.
The command that I am using currently is:
g77 -o [program name] -O file1.f file2.f -pg
but it isn't working.
I get some errors:
/var/tmp//ccYpOz3y.o: In function `geiter_':
/var/tmp//ccYpOz3y.o(.text+0x6e398): undefined reference to `.LLP40'
/var/tmp//ccYpOz3y.o(.text+0x6e50c): undefined reference to `.LLP40'
/var/tmp//ccYpOz3y.o(.text+0x6e614): undefined reference to `.LLP40'
/var/tmp//ccYpOz3y.o(.text+0x6e718): undefined reference to `.LLP40'
......
/var/tmp//ccYpOz3y.o(.text+0x9df7c): undefined reference to `.LLP93'
collect2: ld returned 1 exit status
This script has FAILED; for an unknown reason, the compiling
and linking using g77 did not result in an executable.
Any ideas why ?
I am using gcc version 3.2.2
Thanks,
Naureen
| |
| Tim Prince 2007-03-22, 10:03 pm |
| chick wrote:
> Hi,
>
> I have a Fortran77 code here that runs successfully but I want to run
> using the gnu gprof profiler.
>
> The command that I am using currently is:
> g77 -o [program name] -O file1.f file2.f -pg
>
> but it isn't working.
> I get some errors:
> /var/tmp//ccYpOz3y.o: In function `geiter_':
> /var/tmp//ccYpOz3y.o(.text+0x6e398): undefined reference to `.LLP40'
> /var/tmp//ccYpOz3y.o(.text+0x6e50c): undefined reference to `.LLP40'
> /var/tmp//ccYpOz3y.o(.text+0x6e614): undefined reference to `.LLP40'
> /var/tmp//ccYpOz3y.o(.text+0x6e718): undefined reference to `.LLP40'
> .....
> /var/tmp//ccYpOz3y.o(.text+0x9df7c): undefined reference to `.LLP93'
> collect2: ld returned 1 exit status
>
>
> This script has FAILED; for an unknown reason, the compiling
> and linking using g77 did not result in an executable.
>
>
> Any ideas why ?
> I am using gcc version 3.2.2
>
>
> Thanks,
> Naureen
>
You don't tell enough about what you are doing to comment intelligently.
Did you recognize that you must build your own copy of libg2c using
-pg option and link with that one, rather than a distributed version
built without -pg? Do you have a reason for attempting this with g77,
when gfortran makes it so much easier?
| |
| coolchick 2007-03-24, 7:04 pm |
| Thanks Tim,
It is now working. I changed compiling from g77 to f77 and it worked.
It seems like gfortran isn't installed on my machine.
Naureen
| |
|
|
| Tim Prince 2007-03-26, 10:07 pm |
| Kamaraju S Kusumanchi wrote:
>
> IIRC, gfortran is available only from gcc 4.0 onwards.
>
> raju
>
Make that 4.1. But there's nothing sacred about old versions of gcc
which don't support gfortran. You could keep your old gcc/g++ etc. and
install gcc/gfortran separately. Did you agree with OP that an old Sun
Fortran is preferable to an updated gnu fortran?
| |
| Kamaraju S Kusumanchi 2007-03-27, 7:09 pm |
| Tim Prince wrote:
> Kamaraju S Kusumanchi wrote:
> Make that 4.1. But there's nothing sacred about old versions of gcc
> which don't support gfortran. You could keep your old gcc/g++ etc. and
> install gcc/gfortran separately. Did you agree with OP that an old Sun
> Fortran is preferable to an updated gnu fortran?
I did not know that the OP was using old Sun Fortran. I thought he was using
GNU Fortran 77 compiler. Where was it mentioned that hir is using Sun
compiler? In any case, I prefer+suggest gfortran.
raju
--
Kamaraju S Kusumanchi
http://www.people.cornell.edu/pages/kk288/
http://malayamaarutham.blogspot.com/
| |
| Tim Prince 2007-03-27, 10:09 pm |
| Kamaraju S Kusumanchi wrote:
> Tim Prince wrote:
>
>
> I did not know that the OP was using old Sun Fortran. I thought he was using
> GNU Fortran 77 compiler. Where was it mentioned that hir is using Sun
> compiler? In any case, I prefer+suggest gfortran.
>
> raju
>
I took her (?) report of switching from g77 to f77 on an old Sun system
to mean use of Sun's compiler.
|
|
|
|