$ ldd libTheLibrary.so linux-gate.so.1 => (0xffffe000) libimf.so => /opt/intel/Compiler/11.1/072/lib/ia32/libimf.so (0x40044000) libsvml.so => /opt/intel/Compiler/11.1/072/lib/ia32/libsvml.so (0x402aa000) libm.so.6 => /lib/tls/libm.so.6 (0x403de000) libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40400000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x404bd000) libintlc.so.5 => /opt/intel/Compiler/11.1/072/lib/ia32/libintlc.so.5 (0x404c5000) libc.so.6 => /lib/tls/libc.so.6 (0x40508000) libdl.so.2 => /lib/libdl.so.2 (0x4062c000) /lib/ld-linux.so.2 (0x80000000)
I would prefer that the shared lib not depend on Intel shared libraries so it can be used on various machines without having to also copy over the shared libraries.
Now, if I build with "-shared -static-intel" those dependencies go away, so presumably they are being linked in statically (and I see that while there is no libintlc.a, "-lintlc" is simply dropped from the generated link line when -static-intel is used) which on the surface is exactly what I want. However, as I understand it, it is bad to statically link things you did not build into a shared library since you have no idea if the objects in the static library are PIC or not, and if they are not PIC, you could have problems.
When I look in the compiler's lib directory, while I see libimf_pic.a for some libraries I do not see a libsvml.a. So is it safe to statically link against libsvml when making a shared library? And does the compiler automatically link to libimf_pic.a when using "-shared -static-intel" or is that something I need to manually do?
Hmm. Perhaps a shorter version of this is: what exactly does "-static-intel" do and is it safe to build shared libraries using it. :)
Also, modern linkers in linux do not include the whole library staticall but only the parts which are actually used.
I had same problems / doubts as you a couple of yars ago, but now I link my own shared libraries with
and it works without any problems, libraries are not huge (do not increase by the size of intel's library), and does not introduce any new library dependencies.