Need some help: PAPI 4.10 on Ubuntu 10.04

Open discussion of PAPI.

Need some help: PAPI 4.10 on Ubuntu 10.04

Postby john123 » Sun Aug 01, 2010 12:23 pm

Hello,

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
john123
 
Posts: 1
Joined: Sun Aug 01, 2010 10:34 am

Re: Need some help: PAPI 4.10 on Ubuntu 10.04

Postby danterpstra » Fri Aug 13, 2010 10:28 am

Stupid question:
Are you linking to the libpapi.a or libpapi.so library?
danterpstra
 
Posts: 63
Joined: Wed Jun 23, 2010 2:21 pm


Return to General discussion

Who is online

Users browsing this forum: Walterscum and 1 guest

cron