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:
Compile my program with -lprofiler
. I had done this part without any problem.
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:
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).