1

I am trying to compile a library "A" on my machine, & i have "C" & "D" optional dependencies of A installed at standard path as well as local/custom path , the libraries at custom path( -O3 ) are more optimized as compared to the libraries at standard path(-O0).

I compile library "A" by supplying path of local libraries using LDFLAGS(-L) and LIBS (-l) . and the library gets generated (libA.so or libA.a)!

ldd is a tool which can tell which libraries were linked against the executable.

  • is there a equivalent tool which can tell which libraries were linked against the library ( i.e. ldd libscalapack.a )?
  • is there a way to make sure that weather the optional libraries libraries were used while creating library A( libA.so/libA.a ) ?
  • is there a way to surely tell which out of standard & local libraries were used while compiling ?

Eagerly Awaiting your replies.

puneet336
  • 433
  • 5
  • 20

1 Answers1

0

Tell your linker that you want a load map (-Wl,-Map -Wl,mapfile if you're using gcc). This will tell you which libraries have been used during the link phase.

In case of shared libraries, this doesn't necessarily mean that the exact same libraries will be used during program execution, that depends on the configuration of the dynamic loader.

mfro
  • 3,286
  • 1
  • 19
  • 28