<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is it possible to delay-load the MKL DLLs? in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868100#M8169</link>
    <description>Could you give small example which illustrate the problem? Full linkage string will be helpful also.</description>
    <pubDate>Fri, 25 Jan 2008 15:11:37 GMT</pubDate>
    <dc:creator>Andrey_G_Intel2</dc:creator>
    <dc:date>2008-01-25T15:11:37Z</dc:date>
    <item>
      <title>Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868089#M8158</link>
      <description>&lt;P&gt;I am calling some MKL LAPACK functions from a&lt;BR /&gt;VS 2005 C++ project, linking with mkl_c_dll.lib&lt;BR /&gt;and libguide40.lib (V 10.0.1.015). This works.&lt;/P&gt;
&lt;P&gt;Some customers may never use the LAPACK functionality,&lt;BR /&gt;so I would like to build the program to run whether&lt;BR /&gt;or not the MKL DLL's are found, aborting only if they&lt;BR /&gt;can't be found when needed.&lt;/P&gt;
&lt;P&gt;I changed the link to /DELAYLOAD the MKL DLLs, after&lt;BR /&gt;determining the names by trial and error: &lt;BR /&gt;mkl_intel_thread.dll and libguide40.dll.&lt;BR /&gt;(Any other MKL DLL's are already being dynamically&lt;BR /&gt;loaded on demand,which fits right in with my plans.)&lt;BR /&gt;This produced a linker error:&lt;/P&gt;
&lt;P&gt;LINK : fatal error LNK1194: cannot delay-load&lt;BR /&gt;'mkl_intel_thread.dll' due to import of data symbol&lt;BR /&gt;'__imp____mkl_dynamic';&lt;BR /&gt;link without /DELAYLOAD:mkl_intel_thread.dll&lt;BR /&gt;&lt;BR /&gt;Is there a way around this?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jan 2008 15:01:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868089#M8158</guid>
      <dc:creator>randoob1</dc:creator>
      <dc:date>2008-01-14T15:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868090#M8159</link>
      <description>Is it possible that nobody here knows the answer?</description>
      <pubDate>Mon, 21 Jan 2008 13:38:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868090#M8159</guid>
      <dc:creator>randoob1</dc:creator>
      <dc:date>2008-01-21T13:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868091#M8160</link>
      <description>&lt;P&gt;You can use the LoadLibraryAPI function anywhere in code to load a DLL on demand.&lt;/P&gt;
&lt;P&gt;Gerry&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2008 15:15:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868091#M8160</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2008-01-22T15:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868092#M8161</link>
      <description>&lt;P&gt;Thank you for the helpful suggestion, but it is not so&lt;BR /&gt;simple as you seem to suggest.&lt;/P&gt;
&lt;P&gt;Say I want to call dgelss. I must pass LoadLibrary&lt;BR /&gt;the name of the DLL which contains this function, &lt;BR /&gt;then pass the resulting handle to GetProcAddress&lt;BR /&gt;to retrieve a function pointer that I can use to &lt;BR /&gt;reference dgelss.&lt;/P&gt;
&lt;P&gt;There are many MKL DLL's, none of which exports the&lt;BR /&gt;symbol "dgelss", although there is one, mkl_lapack.dll,&lt;BR /&gt;which exports a symbol named "mkl_lapack_dgelss". &lt;BR /&gt;Perhaps that's the right one... but my program wouldn't&lt;BR /&gt;get far enough to find out. The loader's first complaint&lt;BR /&gt;(when the MKL DLL's can't be found) is about a DLL &lt;BR /&gt;called mkl_intel_thread.dll. I do not reference any&lt;BR /&gt;functions in that DLL so, even if I got a handle to it&lt;BR /&gt;from LoadLibrary, what would I do with the handle?&lt;/P&gt;
&lt;P&gt;I would prefer to let the operating system and the&lt;BR /&gt;runtime handle the loading of the MKL DLLs, if that&lt;BR /&gt;is possible. Whether it is possible or not is a question&lt;BR /&gt;which has not yet been answered on this forum.&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2008 23:37:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868092#M8161</guid>
      <dc:creator>randoob1</dc:creator>
      <dc:date>2008-01-22T23:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868093#M8162</link>
      <description>Try to add delayimp.lib library to your project. MSVS should consist this library.</description>
      <pubDate>Wed, 23 Jan 2008 10:31:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868093#M8162</guid>
      <dc:creator>Andrey_G_Intel2</dc:creator>
      <dc:date>2008-01-23T10:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868094#M8163</link>
      <description>&lt;P&gt;The two linker switches of relevance are /lib:delayimp.lib and /delayload:X.DLL. Under the hood a call to a delay-loaded function calls LoadLibrary and GetProcAddress mediated via delayLoadHelper. If the DLL in question has no exports there is little point in loading it, explicitly or implicitly. It'sas simple as that.&lt;/P&gt;
&lt;P&gt;Gerry&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2008 15:28:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868094#M8163</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2008-01-23T15:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868095#M8164</link>
      <description>&lt;P&gt;Yes, if you want to use /delayload you need delay-load helper function. You can write it by yourself or you can use it from MSVS by adding Delayimp.lib to your project.&lt;/P&gt;
&lt;P&gt;Here is article for this theme: &lt;A href="http://msdn2.microsoft.com/en-us/library/yx9zd12s(VS.71).aspx"&gt;http://msdn2.microsoft.com/en-us/library/yx9zd12s(VS.71).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Andrey&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2008 16:15:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868095#M8164</guid>
      <dc:creator>Andrey_G_Intel2</dc:creator>
      <dc:date>2008-01-23T16:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868096#M8165</link>
      <description>&lt;P&gt;Well ofcourse I am already linking my project with delayimp.lib.&lt;/P&gt;
&lt;P&gt;I have successfully delay-loaded other DLLs. &lt;/P&gt;
&lt;P&gt;Thelinker errormentioned in my first post arises when&lt;/P&gt;
&lt;P&gt;I try to delay-load mkl_intel_thread.dll.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jan 2008 17:54:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868096#M8165</guid>
      <dc:creator>randoob1</dc:creator>
      <dc:date>2008-01-24T17:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868097#M8166</link>
      <description>&lt;P&gt;I'm curious as to why you would want to load mkl_intel_thread.dll. It and many of the redists of MKL are undocumented, so how do you know the arguments to pass to them? AFAICT they are invoked by the compiler and weren't designed to be directly called by the developer of an app.&lt;/P&gt;
&lt;P&gt;Gerry&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2008 14:10:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868097#M8166</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2008-01-25T14:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868098#M8167</link>
      <description>&lt;P&gt;If you look back at an earlier postin this thread you will see (1) why I wantit loaded, and (2) why I can't do it with LoadLibrary/GetProcAddress.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.intel.com/en-us/forums//topic/56931#51504"&gt;http://software.intel.com/en-us/forums/showthread.php?t=56931#52967&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2008 14:27:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868098#M8167</guid>
      <dc:creator>randoob1</dc:creator>
      <dc:date>2008-01-25T14:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868099#M8168</link>
      <description>&lt;P&gt;Your first and last post are as clear as mud which might explain why nobody bothers to answer them. You might have greater success by contacting Premier Support.&lt;/P&gt;
&lt;P&gt;Gerry&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2008 15:09:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868099#M8168</guid>
      <dc:creator>g_f_thomas</dc:creator>
      <dc:date>2008-01-25T15:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868100#M8169</link>
      <description>Could you give small example which illustrate the problem? Full linkage string will be helpful also.</description>
      <pubDate>Fri, 25 Jan 2008 15:11:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868100#M8169</guid>
      <dc:creator>Andrey_G_Intel2</dc:creator>
      <dc:date>2008-01-25T15:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868101#M8170</link>
      <description>&lt;P&gt;&lt;FONT face="Tahoma" size="2"&gt;I've been discussing this with the MKL build team. As I currently understand it mkl_intel_thread.dll and mkl_sequential.dll can not be delay loaded. I'm working on understanding the reasons behind this and whether any work-arounds exist. I'll post more when I find out.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Tahoma" size="2"&gt;Regards,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="Tahoma" size="2"&gt;Todd&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2008 17:55:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868101#M8170</guid>
      <dc:creator>Todd_R_Intel</dc:creator>
      <dc:date>2008-01-25T17:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868102#M8171</link>
      <description>&lt;P&gt;Below is the code for an application which has two&lt;BR /&gt;modes of operation determined by the command-line.&lt;BR /&gt;In one mode it uses MKL services, in the other it&lt;BR /&gt;does not.&lt;/P&gt;
&lt;P&gt;It is linked with mkl_c_dll.lib and libguide40.lib.&lt;BR /&gt;It works as expected when the MKL DLL's are in the&lt;BR /&gt;PATH. If the MKL DLL's are not in the PATH, the&lt;BR /&gt;program won't run in either mode, and the O/S puts&lt;BR /&gt;up an alert that it can't find mkl_intel_thread.dll.&lt;/P&gt;
&lt;P&gt;In the next step, I specify that this DLL is to be&lt;BR /&gt;delay-loaded, and add delayimp.lib to the link.&lt;/P&gt;
&lt;P&gt;The gnarly windows structured exception handler is&lt;BR /&gt;required in case a delay-loaded DLL can't be found&lt;BR /&gt;on demand, otherwise you'll get an abnormal program&lt;BR /&gt;termination, and (on WinXP) a useless invitation to&lt;BR /&gt;tell Microsoft about the problem.&lt;/P&gt;
&lt;P&gt;But I never get that far. The link fails...&lt;/P&gt;
&lt;P&gt;LINKER COMMAND LINE:&lt;BR /&gt;/OUT:smurf.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"smurf.exe.intermediate.manifest" /DELAYLOAD:"mkl_intel_thread.dll" /DEBUG /PDB:"smurf.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT mkl_c_dll.lib libguide40.lib delayimp.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib DelayImp.lib&lt;/P&gt;
&lt;P&gt;LINKER ERROR MESSAGE:&lt;BR /&gt;LINK : fatal error LNK1194: cannot delay-load 'mkl_intel_thread.dll' due to import of data symbol '__imp____mkl_dynamic'; link without /DELAYLOAD:mkl_intel_thread.dll&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;// File: smurf.cpp&lt;BR /&gt;#include "mkl.h"&lt;BR /&gt;#include &lt;WINDOWS.H&gt;&lt;BR /&gt;#include &lt;DELAYIMP.H&gt;&lt;BR /&gt;#include &lt;IOSTREAM&gt;&lt;BR /&gt;using namespace std;&lt;/IOSTREAM&gt;&lt;/DELAYIMP.H&gt;&lt;/WINDOWS.H&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;int main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;if (argc &amp;gt; 1)&lt;BR /&gt;{&lt;BR /&gt;cout &amp;lt;&amp;lt; "bypassing MKL" &amp;lt;&amp;lt; endl;&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;__try&lt;BR /&gt;{&lt;BR /&gt;double eps = dlamch("prec");// machine precision, declared in mkl_lapack.h&lt;BR /&gt;cout &amp;lt;&amp;lt; "machine precision " &amp;lt;&amp;lt; eps &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;__except((GetExceptionCode()==VcppException(ERROR_SEVERITY_ERROR,ERROR_MOD_NOT_FOUND))? EXCEPTION_EXECUTE_HANDLER: EXCEPTION_CONTINUE_SEARCH)&lt;BR /&gt;{&lt;BR /&gt;cout &amp;lt;&amp;lt; "MKL DLL NOT FOUND" &amp;lt;&amp;lt; endl;&lt;BR /&gt;}&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2008 18:05:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868102#M8171</guid>
      <dc:creator>randoob1</dc:creator>
      <dc:date>2008-01-25T18:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868103#M8172</link>
      <description>&lt;P&gt;Thanks for your attention. I believe that I have found a workaround, which is to build all MKL usage into a user DLL, and then delay-load that user DLL from my application.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2008 18:08:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868103#M8172</guid>
      <dc:creator>randoob1</dc:creator>
      <dc:date>2008-01-25T18:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to delay-load the MKL DLLs?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868104#M8173</link>
      <description>&lt;P&gt;Delay load of mkl_intel_thread.dll/mkl_sequential.dll is impossible now because these libraries contain __imp____mkl_dynamic symbol which must be initialized at the start of application.&lt;/P&gt;
&lt;P&gt;Andrey&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jan 2008 08:59:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Is-it-possible-to-delay-load-the-MKL-DLLs/m-p/868104#M8173</guid>
      <dc:creator>Andrey_G_Intel2</dc:creator>
      <dc:date>2008-01-28T08:59:44Z</dc:date>
    </item>
  </channel>
</rss>

