Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Another -static-intel thread

ethan_mallovesun_com
474 Views
Hello,

I realize there's already a thread on -static-intel (http://software.intel.com/en-us/forums/showthread.php?t=67369), but I'm starting a new one using a simpler example to illustrate my problem.

I take a simple program that calls a libimf math function:

$ cat ~/src/ceil.c
#include
int main() {
double x = 3.6;
float y = ceil(x);
}

Compile it using -static-intel:

$ icc -static-intel -limf ~/src/ceil.c -o foo && env -i LD_LIBRARY_PATH=/ws/ompi-tools/intel/Compiler/11.0/084/lib/ia32 ./foo
$ ldd foo
linux-gate.so.1 => (0xffffe000)
libimf.so => not found
libm.so.6 => /lib/libm.so.6 (0xf7eb0000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf7ea5000)
libc.so.6 => /lib/libc.so.6 (0xf7d83000)
libdl.so.2 => /lib/libdl.so.2 (0xf7d7e000)
/lib/ld-linux.so.2 (0xf7ee5000)
$ ls -l foo
-rwxr-xr-x 1 em162155 wheel 20733 Oct 5 2010 foo

Compile it using -shared-intel:

$ icc -shared-intel -limf ~/src/ceil.c -o foo && env -i LD_LIBRARY_PATH=/ws/ompi-tools/intel/Compiler/11.0/084/lib/ia32 ./foo
$ ldd foo
linux-gate.so.1 => (0xffffe000)
libimf.so => not found
libsvml.so => not found
libm.so.6 => /lib/libm.so.6 (0xf7edc000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xf7ed1000)
libintlc.so.5 => not found
libc.so.6 => /lib/libc.so.6 (0xf7dae000)
libdl.so.2 => /lib/libdl.so.2 (0xf7daa000)
/lib/ld-linux.so.2 (0xf7f11000)
$ ls -l foo
-rwxr-xr-x 1 em162155 wheel 6967 Oct 5 2010 foo

I'm stuck, because the file size of the -static-intel version is larger, implying that some of the math library stuff has been statically linked, yet there's still the "not found" in the "ldd" output.

-Ethan
0 Kudos
1 Reply
Kevin_D_Intel
Employee
474 Views
Drop -limf from your command-line and let the icc driver determine which and in what order to link libraries. Adding -limf links the shared version as per the ld default. That should eliminate the use of the shared library when when using -static-intel.
0 Kudos
Reply