akhil28288
akhil28288

Reputation: 182

Why is this shared library not getting linked?

I am trying to generate traces of GPGPU benchmarks on X86 cpu using GPUocelot. For this reason, I am compiling the benchmarks with -locelot and -locelotTrace linker flags. My benchmarks compile and execute fine. However, traces are not getting generated.

compile command:

nvcc -arch=sm_20 bfs.cu -o bfs -locelot -locelotTrace

libocelot.so and libocelotTrace.so are located in /usr/local/lib and LD_LIBRARY_PATH=/usr/local/lib.

I verified the shared libraries that are linked to this binary using ldd. I can see that libocelot.so is linked but I don't see libocelottrace.so.

I think this is the issue that's resulting in traces not getting generated. How can I make sure the binary is linked to libocelottrace.so?

Upvotes: 0

Views: 261

Answers (1)

Employed Russian
Employed Russian

Reputation: 213385

I can see that libocelot.so is linked but I don't see libocelottrace.so

This is likely because

  • Your compiler uses --as-needed linker flag (you should see that if you invoke nvcc with -v flag), and
  • Your command line is incorrect. Try nvcc -arch=sm_20 bfs.cu -o bfs -locelotTrace -locelot instead (the order of libraries on command line matters).

Upvotes: 1

Related Questions