Hi dear staff,
I try to compile the bwa (https://github.com/intel-mic/bwa-aln-xeon-phi-0.5.10) on xeon host for xeon phi, but I get some warnings like this:
x86_64-k1om-linux-ld: warning: libimf.so, needed by /local/tmp.schen/lib/libz.so, not found (try using -rpath or -rpath-link)
x86_64-k1om-linux-ld: warning: libsvml.so, needed by /local/tmp.schen/lib/libz.so, not found (try using -rpath or -rpath-link)
x86_64-k1om-linux-ld: warning: libirng.so, needed by /local/tmp.schen/lib/libz.so, not found (try using -rpath or -rpath-link)
x86_64-k1om-linux-ld: warning: libintlc.so.5, needed by /local/tmp.schen/lib/libz.so, not found (try using -rpath or -rpath-link)
I try to solve it by using the -rpath like http://stackoverflow.com/questions/26653472/intel-compiler-warning-with-mic-missing-libraries
But it still is unsuccessful, my account on xeon phi doesn't have the root permission, so I can't upload these files into xeon phi directly.
Do you have any other methods to solve this problem?
I just ran into this same problem and using -Wl,-rpath=/opt/intel/composer.../compiler/lib/mic does solve the warnings, but my question is why?
Given all this, I really appreciate if someone could explain what's going so that I can learn something.
(this is using 15.0.2 and, unfortunately, my "screen shot" is too big to type in unless someone really needs to see the details).
I don't fully understand all details, but here's roughly what happens:
- when you build zlib for the mic, it is run-time linked against libimf, libsvml, libirng and libintlc5 . This is done automatically by the linker. You can verify this by running this command on the Mic:
$ ldd libz.so.1.2.8 linux-vdso.so.1 (0x00007ffe0cdff000) libc.so.6 => /lib64/libc.so.6 (0x00007f89ba33d000) libimf.so => /usr/lib64/libimf.so (0x00007f89b9eec000) libsvml.so => /usr/lib64/libsvml.so (0x00007f89b96f7000) libirng.so => /usr/lib64/libirng.so (0x00007f89b94e4000) libm.so.6 => /lib64/libm.so.6 (0x00007f89b92a5000) libiomp5.so => /usr/lib64/libiomp5.so (0x00007f89b8f7b000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f89b8d67000) libintlc.so.5 => /usr/lib64/libintlc.so.5 (0x00007f89b8b46000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f89b8928000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f89b8724000) /lib64/ld-linux-k1om.so.2 (0x00007f89ba8b3000)
Now , when you link against libz but you do not explicitly include the libs listed above then the linker cannot resolve the full runtime libraries and it complains as shown. You can either
so that the linker won't complain about the missing shared libraries. Another alternative is to link against a static version of libz (libz.a) and most of the warnings should go away.
The fact that the binary works even without the -rpath listed is caused by "lazy loading" : if a shared lib that that needs to be loaded by another shared library is present at runtime (but not at link-time) , the loader will load it automagically for you.
I hope this info helps you, or that someone with better knowledge of the Intel compiler suite can explain more in detail what is happening here.
The question that still nags me is:
How do I avoid this runtime dependency and how can I build and link against an Intel supplied RPM (e.g. libz-dev-1.2.6-r1.k1om.rpm) on the *host* ?