Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Code bloat linking statically

Rawlins__David
Beginner
347 Views

Hi,

I am using the Pardiso solver in the MKL. If I link statically the executable code is 18.3MB. If I link dynamically the size is 2.4MB. Is there anything I can do to reduce the size of the statically linked code?

Here are the MKL link parameters:

-L/opt/intel/mkl/10.2.3.029/lib/em64t/ -lmkl_intel_lp64 -Wl,--start-group -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread

Here is the output from ldd if I link dynamically:

> ldd febio.lnx
linux-vdso.so.1 => (0x00007ffffebff000)
libmkl_intel_lp64.so => /opt/intel/mkl/10.2.3.029/lib/em64t/libmkl_intel_lp64.so (0x00007f8ac72b8000)
libmkl_intel_thread.so => /opt/intel/mkl/10.2.3.029/lib/em64t/libmkl_intel_thread.so (0x00007f8ac6255000)
libmkl_core.so => /opt/intel/mkl/10.2.3.029/lib/em64t/libmkl_core.so (0x00007f8ac6015000)
libiomp5.so => /opt/intel/mkl/10.2.3.029/lib/em64t/libiomp5.so (0x00007f8ac772d000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f8ac5df9000)
libm.so.6 => /lib64/libm.so.6 (0x00007f8ac5ba4000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f8ac5896000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8ac567f000)
libc.so.6 => /lib64/libc.so.6 (0x00007f8ac5324000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f8ac5120000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8ac76b8000)

Thanks,

Dave

0 Kudos
2 Replies
Gennady_F_Intel
Moderator
347 Views

Dave,

I am afraid that there are no opportunities to reduce the size of this executable file at the current version.

--Gennady

0 Kudos
Rawlins__David
Beginner
347 Views

I should mention that I just upgraded the MKL. With the previous version, 10.1.1.019, the executable was only 8.9MB. Does that seem right to you that the code size has gone from 8.9MB to 18.3M by upgrading to 10.2.3.029?

Dave

0 Kudos
Reply