Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
18 Views

exe file size when using MKL

I have an exe that is about 10 mb when using IMSL, and about 20 mb when using MKL.  So I'm wondering if I'm doing something wrong in the building of the MKL version.  The code runs fine in both flavors.  The code uses MKL routines for elementary matrix operations, linear solving, eigenvalues and ODE integration.

0 Kudos
5 Replies
Highlighted
Black Belt Retired Employee
18 Views

You're probably linking to the static MKL library instead of the DLL library. Does image size really matter that much, though? Did you use all the same sort of routines from IMSL?

0 Kudos
Highlighted
New Contributor I
18 Views

I think it is a false alarm, and I'm no longer sure about file sizes, and I'm now having trouble building the program.  What causes the following linker errors which occurs only when doing a Release build with Runtime Libraries option = Multithreaded DLL

libifcoremt.lib(for_close.obj) : error LNK2005: _for_close already defined in libifcoremd.lib(libifcoremd.dll)
libifcoremt.lib(for_open.obj) : error LNK2005: _for_open already defined in libifcoremd.lib(libifcoremd.dll)
libifcoremt.lib(for_wseq.obj) : error LNK2005: _for_write_seq already defined in libifcoremd.lib(libifcoremd.dll)
libifcoremt.lib(for_wseq.obj) : error LNK2005: _for_write_seq_xmit already defined in libifcoremd.lib(libifcoremd.dll)
LIBCMT.lib(_ctype.obj) : error LNK2005: _isspace already defined in MSVCRT.lib(MSVCR100.dll)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR100.dll)
LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR100.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR100.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR100.dll)

When switching the main program between Multithreaded and Multithreaded DLL, do all other supporting libraries have to match this?

0 Kudos
Highlighted
Black Belt Retired Employee
18 Views

You have some objects/libraries built with the option to link against static libraries, and others built with the DLL option. Rebuild the entire solution with consistent options and the errors should go away.

0 Kudos
Highlighted
New Contributor I
18 Views

Thanks Steve.  I thought it might be that.  Do both Release and Debug builds require this?  Because I think I've been able to build Debug versions of my main program with either /libs:DLL or /libs:static, even though supporting libraries are /libs:static.  

One of the things I expected when moving to MKL was to eliminate a dependency on libiomp5md.dll but that has not happened.  Does that mean MKL uses mp?  Does it depend on which MKL routines I'm using?

0 Kudos
Highlighted
Black Belt Retired Employee
18 Views

Yes, you need to check the settings for both Debug and Release configurations. And, yes, MKL uses OpenMP. On Windows, Intel doesn't provide static OpenMP libraries anymore.

0 Kudos