- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I wrote a Fortran application that uses MKL and successfully built and debugged it via Visual Studio. But if I try to run the executable, it says that the mkl_intel_thread.dll is missing. I've searched for it, and I know I can just include the dll in my source folder, but my question is: when I compile the source file with the Intel compiler via command line, I get a standalone executable, i.e., it won't ask for the dll even if it's not there. How's that possible? I used the following command to build via cmd:
ifort /Qmkl test.f90
Is the command "ifort /Qmkl" "embedding" the dll information in the executable somehow? If so, is it possible for the VS to do the same?
Best regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it is possible. The default when building in Visual Studio is to link to the DLL libraries, whereas the default on the command line is to link to the static libraries.
In Visual Studio, set the project property Libraries > Use Run-Time Library to Multithreaded (/MT).
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it is possible. The default when building in Visual Studio is to link to the DLL libraries, whereas the default on the command line is to link to the static libraries.
In Visual Studio, set the project property Libraries > Use Run-Time Library to Multithreaded (/MT).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I will also mention that the reason it won't run from the command line is that the default is to not add the MKL DLL folder to PATH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some misunderstandings in the post regarding the role of DLLs and import libraries.
...when I compile the source file with the Intel compiler via command line, I get a standalone executable, i.e., it won't ask for the dll even if it's not there.
The DLL is not used when compiling and linking, only the corresponding import library (e.g., mkl_rt.lib) is used. If you try to run the resulting EXE, that will work only if the DLL is available through %PATH%. If that is the problem, the fix is to adjust %PATH%, either in the local environment (recommended) or in the global environment (can create problems, but is convenient).
Is the command "ifort /Qmkl" "embedding" the dll information in the executable somehow?
That the EXE depends on a particular DLL is embedded. The path to the DLL is not embedded
The DLL needs to exist only on the machine on which the EXE is to be run. The import library needs to exist only on the developer's machine.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page