I'm getting the following errors when trying to compile a PAPI traced program:
most of the PAPI test PASS, so what am I doing wrong here?
- Code: Select all
:~/code/papi$ gcc papi_test.c
/tmp/cctaFPBN.o: In function `main':
papi_test.c:(.text+0x19): undefined reference to `PAPI_start_counters'
papi_test.c:(.text+0x5b): undefined reference to `PAPI_stop_counters'
collect2: ld returned 1 exit status
the program is the following
- Code: Select all
#include <papi.h>
#include <stdio.h>
int main() {
static int events[] = { PAPI_TOT_INS, PAPI_L1_DCM };
long long counters[2];
PAPI_start_counters(events, 2);
int sum = 0;
int i = 0;
for (i = 0; i < 10; i++) {
sum += i;
}
PAPI_stop_counters(counters, 2);
printf ("L1 data cache misses: %lli\n", counters[0]);
}
its running on a quite old AMD Athlon XP 2.0Ghz
cpuinfo
- Code: Select all
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 6
model name : AMD Athlon(tm) XP 2000+
stepping : 2
cpu MHz : 1662.500
cache size : 256 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 mmx fxsr sse syscall mmxext 3dnowext 3dnow up
bogomips : 3340.89
clflush size : 32
cache_alignment : 32
address sizes : 34 bits physical, 32 bits virtual
power management: ts
uname
Linux knackel 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 i686 GNU/Linux
Would be glad if somebody could help me out.
Thank you
John
