I want to run a Unix program which runs for a few seconds, without sacrificing speed of execution. After it is done, I would like to know what dynamic (shared) libraries it used.
What is the appropriate command?
The main problem is that I have a handful of BLAS implementations, and I want to figure out exactly which one is being used by each of a handful of different programs.
Using ldd you can see the dynamic libraries that are linked to a specific binary file.
Like so:
Lastly, you could use strace.
strace <program_to_execute
will give you a ton of info, including calls to libraries. It's not nearly as clean as the other answers, but it's another way of doing things. (and useful in its own right)--Christopher Karel
In addition to ldd, cat /proc/$pid/maps will show you which libraries have been mapped into memory, including dynamic ones loaded after program start (and deleted items too)