6

I am trying the google performance tool for CPU time profiling. However, I had encountered some problem that I cannot read the shared library file "libprofiler.so.0"

I had read the README of google performace tool, there are 3 steps in the manual:

  1. Compile my program with -lprofiler. I had done this part without any problem.

  2. Run the binary of my program to generate a profile result file.
    I failed in this step. When I try to run my binary, there is an error message:
    "error while loading shared libraries: libprofiler.so.0: cannot open shared object file: No such file or directory.".
    I googled, in this page, someone says the "libprofiler.so.0" is at "/usr/local/lib", so I copied the share library file to the directory with my binary, and tried to run my binary. It still report the same error message.

I had just used Linux for about one year, please forgive me if my question is very stupid. And, thank you in advance.

My machine information:

  • OS: Ubuntu 8.10
  • Compiler: gcc 4.3.2
  • shell: bash
  • google performance tool version: 1.4 (I had download it just today)
Employed Russian
  • 199,314
  • 34
  • 295
  • 362
yoco
  • 1,404
  • 1
  • 14
  • 19

1 Answers1

13

Where is your libprofiler.so.0?

It should be installed into /usr/local/lib or /usr/lib. Copying it to the same directory where your binary resides is useless (as you've already discovered).

EDIT: Apparently libprofiler.so.0 is installed in /usr/local/lib. You probably should just run /sbin/ldconfig (as root) to update loader shared library cache. Setting LD_LIBRARY_PATH should not be necessary (unless you have very non-standard glibc installation).

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • The `libprofiler.so.0` is just at the `/usr/local/lib`, should I set any environment variable? like `LD_LIBRARY_PATH`? – yoco Oct 17 '09 at 05:56
  • 2
    Oh! God! I success! It is the environment variable problem! Thanks for all who read and answer my question! – yoco Oct 17 '09 at 05:59
  • 2
    Of in `/usr/lib/x86_64-linux-gnu/` for 64 bit systems. – Curcuma_ Dec 22 '20 at 14:04