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

compile using libiomp5md.lib rather than libiomp5md.dll

Jennifer_Koran
Principiante
2.383 Visualizações
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 Kudos
1 Solução
Steven_L_Intel1
Funcionário
2.383 Visualizações
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

Ver solução na publicação original

5 Respostas
mecej4
Colaborador honorário III
2.383 Visualizações
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.
TimP
Colaborador honorário III
2.383 Visualizações
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.
Jennifer_Koran
Principiante
2.383 Visualizações
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.
Steven_L_Intel1
Funcionário
2.384 Visualizações
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
Jennifer_Koran
Principiante
2.383 Visualizações
Making the change in this line seems to have worked. Thank you.
Responder