<?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 IVF DLL using MKL LAPACK routines, issues with DLL dependencies in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/IVF-DLL-using-MKL-LAPACK-routines-issues-with-DLL-dependencies/m-p/856264#M7011</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;The problem was purely a dll dependency issue. Here's what I had to include in the directory of the calling executable for the Fortran dll to work if it used LAPACK driver routines from the Intel MKL:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;libiomp5md.dll&lt;/DIV&gt;&lt;DIV&gt;mkl_core.dll&lt;/DIV&gt;&lt;DIV&gt;mkl_def.dll&lt;/DIV&gt;&lt;DIV&gt;mkl_intel_thread.dll&lt;/DIV&gt;&lt;DIV&gt;mkl_p4m.dll&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;That's 24 MB to start with. This works only for the old FORTRAN 77 interfaces, however, and there's libifcoremd.dll andlibmmd.dll to make it work with the new Fortran 95 interfaces. On the positive side, this solution works on any windows machines without Intel MKL or the IVF compiler.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;What kind of licence would I need to distribute these libraries in my non-commercial applications?&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Of course, 24 MB of overhead doesn't look like a rational solution for moderately light engineering apps. Can I use the Intel MKL in a Fortran dll without having to distribute all these libraries? There has to be a more elegant solution. Could I do that with distributions available from&lt;A href="http://www.netlib.org/lapack/"&gt;http://www.netlib.org/lapack/&lt;/A&gt;, and would that lead to a significantly smaller size? I'm not sure the performance gains are worth the size penalty if that is indeed the case.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;elengie&lt;/DIV&gt;</description>
    <pubDate>Tue, 06 Apr 2010 06:54:35 GMT</pubDate>
    <dc:creator>elengie</dc:creator>
    <dc:date>2010-04-06T06:54:35Z</dc:date>
    <item>
      <title>IVF DLL using MKL LAPACK routines, issues with DLL dependencies</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/IVF-DLL-using-MKL-LAPACK-routines-issues-with-DLL-dependencies/m-p/856262#M7009</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I have a program in Intel Visual Fortran that uses LAPACK functionality from Intel MKL. It works in a normalVS2008 IVF console project with these compiler options:&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Additional Include Directories: C:\\Program Files (x86)\\Intel\\Compiler\\11.1\\048\\mkl\\include\\ia32&lt;/DIV&gt;
&lt;DIV&gt;Additional Dependencies:mkl_lapack95.lib&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;These are the relevant excerpts from code in Fortran:&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV&gt;
&lt;DIV&gt;use mkl95_precision, only: wp =&amp;gt; sp&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV id="_mcePaste"&gt;use mkl95_lapack, only: gesv&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;---&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;call gesv(A,B)&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;Then I build a Windows Forms application in C# to accept some inputs and present the results. It interfaces with the same Fortran program, but now compiled to a DLL (no change in include directories or additional dependencies), exporting the necessary subroutines like this:&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;!DEC$ ATTRIBUTES DLLEXPORT :: getVoltages&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;!DEC$ ATTRIBUTES ALIAS: 'getVoltages' :: getVoltages&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;!DEC$ ATTRIBUTES STDCALL :: getVoltages&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;!DEC$ ATTRIBUTES REFERENCE :: getVoltages&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;For now it only fetches a predefined array, and writes it into a textbox control. This works perfectly if I remove these statements from the Fortran code:&lt;BR /&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV id="_mcePaste"&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;use mkl95_precision, only: wp =&amp;gt; sp&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;use mkl95_lapack, only: gesv&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;---&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;call gesv(A,B)&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;Now, the problems.&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;If I do include the said statements, the DLL project will still compile, but the Windows Forms application will throw aSystem.DllNotFoundException, pointing to the same Fortran DLL.&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;Here's the Command Lines for the said Fortran DLL project (using MKL):&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;Fortran:&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;/nologo /I"C:\\Program Files (x86)\\Intel\\Compiler\\11.1\\048\\mkl\\include\\ia32" /module:"Release\\\\" /object:"Release\\\\" /libs:dll /threads /Qmkl:parallel /c&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;+&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;/Qopenmp-link:static&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;Linker:&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;/OUT:"Release\\EAPOP-1 FortranDLL.dll" /NOLOGO /MANIFEST /MANIFESTFILE:"C:\\Users\\GIJ\\Documents\\Visual Studio 2008\\Projects\\EAPOP-1\\EAPOP-1 FortranDLL\\Release\\EAPOP-1 FortranDLL.dll.intermediate.manifest" /SUBSYSTEM:WINDOWS /IMPLIB:"C:\\Users\\GIJ\\Documents\\Visual Studio 2008\\Projects\\EAPOP-1\\EAPOP-1 FortranDLL\\Release\\EAPOP-1 FortranDLL.lib" /DLL mkl_lapack95.lib&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;I also checked both versions of my DLL with the Dependency Walker:&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;Without use mkl95_precision, only: wp =&amp;gt; sp,use mkl95_lapack, only: gesv,call gesv(A,B):&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;IMG height="116" width="786" src="http://i44.tinypic.com/10ztlyt.png" /&gt;&lt;/DIV&gt;
&lt;BR /&gt;With them (the one I actually need):&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;IMG height="292" width="794" src="http://i40.tinypic.com/dfbr46.png" style="float: left;" /&gt;&lt;/DIV&gt;
&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Development is done on a x64 Vista machine and the MKL was installed without 64 bit libraries (MKL with them was removedbeforehandin an attempt to narrow down the source ofproblems).&lt;/DIV&gt;
&lt;BR /&gt;I need advice on how to get all the dependencies right, so that the program would work from any Windows machine with .NET, but without MKL or the IVF compiler. I've only been programing since a few months ago, so I would really appreciate your help.&lt;BR /&gt; &lt;BR /&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;Regards,&lt;/DIV&gt;
&lt;DIV style="padding: 0px; margin: 0px;"&gt;elengie&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 01 Apr 2010 09:32:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/IVF-DLL-using-MKL-LAPACK-routines-issues-with-DLL-dependencies/m-p/856262#M7009</guid>
      <dc:creator>elengie</dc:creator>
      <dc:date>2010-04-01T09:32:04Z</dc:date>
    </item>
    <item>
      <title>Visual Fortran DLL using MKL, when called from C# --&gt; System.Dl</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/IVF-DLL-using-MKL-LAPACK-routines-issues-with-DLL-dependencies/m-p/856263#M7010</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;As I see your program uses MKL Fortran 95 interfaces to LAPACK.&lt;BR /&gt;But compiled Fortran codes (binaries) with Fortran95 featuresare compiler dependent.&lt;/P&gt;&lt;P&gt;There are some problems also to call Fortran 95 specific routines from the other languages (see Programming with Mixed Languages section in the IVF documentation).&lt;/P&gt;&lt;P&gt;So its better in such a case touse the original routine sgesv().&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vladimir&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2010 09:29:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/IVF-DLL-using-MKL-LAPACK-routines-issues-with-DLL-dependencies/m-p/856263#M7010</guid>
      <dc:creator>Vladimir_Koldakov__I</dc:creator>
      <dc:date>2010-04-02T09:29:26Z</dc:date>
    </item>
    <item>
      <title>IVF DLL using MKL LAPACK routines, issues with DLL dependencies</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/IVF-DLL-using-MKL-LAPACK-routines-issues-with-DLL-dependencies/m-p/856264#M7011</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;The problem was purely a dll dependency issue. Here's what I had to include in the directory of the calling executable for the Fortran dll to work if it used LAPACK driver routines from the Intel MKL:&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;libiomp5md.dll&lt;/DIV&gt;&lt;DIV&gt;mkl_core.dll&lt;/DIV&gt;&lt;DIV&gt;mkl_def.dll&lt;/DIV&gt;&lt;DIV&gt;mkl_intel_thread.dll&lt;/DIV&gt;&lt;DIV&gt;mkl_p4m.dll&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;That's 24 MB to start with. This works only for the old FORTRAN 77 interfaces, however, and there's libifcoremd.dll andlibmmd.dll to make it work with the new Fortran 95 interfaces. On the positive side, this solution works on any windows machines without Intel MKL or the IVF compiler.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;What kind of licence would I need to distribute these libraries in my non-commercial applications?&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Of course, 24 MB of overhead doesn't look like a rational solution for moderately light engineering apps. Can I use the Intel MKL in a Fortran dll without having to distribute all these libraries? There has to be a more elegant solution. Could I do that with distributions available from&lt;A href="http://www.netlib.org/lapack/"&gt;http://www.netlib.org/lapack/&lt;/A&gt;, and would that lead to a significantly smaller size? I'm not sure the performance gains are worth the size penalty if that is indeed the case.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;elengie&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Apr 2010 06:54:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/IVF-DLL-using-MKL-LAPACK-routines-issues-with-DLL-dependencies/m-p/856264#M7011</guid>
      <dc:creator>elengie</dc:creator>
      <dc:date>2010-04-06T06:54:35Z</dc:date>
    </item>
    <item>
      <title>IVF DLL using MKL LAPACK routines, issues with DLL dependencies</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/IVF-DLL-using-MKL-LAPACK-routines-issues-with-DLL-dependencies/m-p/856265#M7012</link>
      <description>Hi elengie,&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;1)Please read all licence's related materials intoEnd User License Agreement( see &lt;MRLROOT&gt;\doc\mklEULA.rtf ). Accordingly to our policy - we cannot comment this topic.&lt;/MRLROOT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;2) if 24 Mb is pretty big for your application - then my be you can build the custom dll and it should be much smaller...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;--Gennady&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Apr 2010 08:42:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/IVF-DLL-using-MKL-LAPACK-routines-issues-with-DLL-dependencies/m-p/856265#M7012</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2010-04-06T08:42:42Z</dc:date>
    </item>
  </channel>
</rss>

