cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

rahulgarg
Adept II

calCtxCreateCounter : undefined reference?

which library to link?

I was trying to use calCtxCreateCounter on 32-bit linux. I am linking with amdcalcl and amdcalrt libraries. But I get an undefined reference when I try to use calCtxCreateCounter. The program, which includes a CAL kernel, compiles and runs fine when not using counters.
0 Likes
3 Replies

Rahul,
Please make sure you include the cal_ext_counter.h header file when using counters.

0 Likes
rahulgarg
Adept II

I did include the header. The compilation goes fine but the linker complains that it cannot find the symbols. I looked at the list of symbols exported by libamdcalrt.so and libamdcalcl.so (using nm -D) and neither of them include calCtxCreateCounter or other counter related functions.
0 Likes
rahulgarg
Adept II

Resolved.
I was doing it the wrong way. There is no predefined function called calCtxCreateCounter etc. They have to be obtained using calExtGetProc. I followed the example in perf_counters.cpp and counters are working for me now.
0 Likes