I'm linking some compiled code with icpc, e.g.:
icpc -o my_executable f1.o /path/to/f2.a -lfoo -lbar
I want icpc to tell me exactly which files it uses for the linking - which .a, .o and .so* and where. If possible, I want to be able to filter out files it looks at but eventually does not use; but even a superset of the files actually used is good enough.
How can I do that? I tried finding an appropriate command-line option for this and failed.
Note: I'm looking for a solution which doesn't depend on the link succeeding...
You can use the ldd ./executable to know the files that are used. It will list all the dynamic libraries that are dependent.
Thanks