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

compile using libiomp5md.lib rather than libiomp5md.dll

Jennifer_Koran
Débutant
3 032 Visites
When running the executable file, I am finding that the file libiomp5md.dll is needed. I would much prefer to NOT need the .dll file at runtime.

I see that there is a static version by the same name, ending with .lib, in the lib folder installed with the compiler. However, I have not been able to find a way to force the compiler to use the static version of the library when compiling the program.

Further, I do not know what this particular .dll file does, so I am not sure how it is being invoked in my program. I call programs from the IMSL libraries, which may in turn be invoking the .dll supplied by Intel.

How can I compile the program so a .dll file is not needed at runtime?
0 Compliments
1 Solution
Steven_L_Intel1
Employé
3 032 Visites
Tim had a typo - it is /Qopenmp-link:static

If you are using IMSL, do you have a line:

!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

in one of your sources? If so, change the file name to libiomp5mt.lib

Voir la solution dans l'envoi d'origine

0 Compliments
5 Réponses
mecej4
Contributeur émérite III
3 032 Visites
The MS linker cannot directly link your objects to DLLs. It uses an imports library, such as libiomp5.lib, instead.

If you do not have an equivalent static library, you are stuck with having to use the DLL at run time.
0 Compliments
TimP
Contributeur émérite III
3 032 Visites
The OpenMP library is required by the MKL threaded library, as well as by any OpenMP calls in your program or in IMSL. The option /Qopenmp-link:static has been provided in some versions of ifort, or you can link libiomp5mt.lib explicitly, if you take care not to link more than once against any of the libiomp, libguide, or vcomp versions.
0 Compliments
Jennifer_Koran
Débutant
3 032 Visites
I tried the option that you specified, but I received the message "ignoring unknown option," so it must not be available in my version (Professional).
I need a better understanding of what you mean by linking the .lib file explicitly. Is this something I can accomplish with a use or include statement in my code, even if IMSL is calling this library? I think I understand how to specify additional library directories, but not how to explicitly link a particular file.
0 Compliments
Steven_L_Intel1
Employé
3 033 Visites
Tim had a typo - it is /Qopenmp-link:static

If you are using IMSL, do you have a line:

!DEC$ OBJCOMMENT LIB:'libiomp5md.lib'

in one of your sources? If so, change the file name to libiomp5mt.lib
0 Compliments
Jennifer_Koran
Débutant
3 032 Visites
Making the change in this line seems to have worked. Thank you.
0 Compliments
Répondre