<?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 Linking Lapack 95 in a DLL in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090056#M23177</link>
    <description>&lt;P&gt;&amp;nbsp;I cant seem to figure out how to set the Properties to compile and link MKL95 in a DLL.&lt;/P&gt;

&lt;P&gt;Here is the code:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;SUBROUTINE GET_ROOTS(phi, philen, side, output)
!DEC$ ATTRIBUTES DLLEXPORT::GET_ROOTS
    USE mkl95_precision
    USE mkl95_lapack, ONLY: HSEQR
    INTEGER, INTENT(IN) :: philen
    REAL(8), INTENT(IN) :: side
    REAL(8), DIMENSION(philen), INTENT(INOUT) :: phi
    COMPLEX(16), DIMENSION(philen-1), INTENT(INOUT) :: output
    COMPLEX(16), DIMENSION(:,:), ALLOCATABLE :: matrixA
    COMPLEX(16), DIMENSION(:), ALLOCATABLE :: roots
    INTEGER :: status, dim, i
    dim = philen-1
    ALLOCATE(matrixA(dim,dim), STAT = status)
    ALLOCATE(roots(dim), STAT = status)
    roots = 0.0_8
    matrixA = 0.0_8
     DO i = 1, dim-1
        matrixA(1,i) = -1.0_8 * phi(philen-i)/phi(philen)
        matrixA(i+1,i) = 1.0_8
    END DO 
    matrixA(1,dim) = -1.0_8 * phi(1)/phi(philen)      
    CALL HSEQR(matrixA,roots)
    output = roots
    DEALLOCATE(matrixA)
    DEALLOCATE(roots)
    return
END SUBROUTINE GET_ROOTS&lt;/PRE&gt;

&lt;P&gt;Here are the compilers errors:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;&amp;gt;GET_ROOTS.f90
GET_ROOTS\GET_ROOTS\GET_ROOTS.f90(8): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MKL95_PRECISION]
GET_ROOTS\GET_ROOTS\GET_ROOTS.f90(9): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MKL95_LAPACK]
GET_ROOTS\GET_ROOTS\GET_ROOTS.f90(27): error #6406: Conflicting attributes or multiple declaration of name.   [HSEQR]
GET_ROOTS\GET_ROOTS\GET_ROOTS.f90(9): error #6580: Name in only-list does not exist.   [HSEQR]
1&amp;gt;compilation aborted for C:\Users\FrankM\documents\visual studio 2012\Projects\GET_ROOTS\GET_ROOTS\GET_ROOTS.f90 (code 1)&lt;/PRE&gt;

&lt;P&gt;of course the first thing I tried was to set&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;Sequential (/Qmkl:sequential)&lt;/PRE&gt;

&lt;P&gt;I 've also tried using the advisor and get the same messages.&lt;/P&gt;

&lt;P&gt;Help.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Nov 2015 13:05:39 GMT</pubDate>
    <dc:creator>Frank_M</dc:creator>
    <dc:date>2015-11-30T13:05:39Z</dc:date>
    <item>
      <title>Linking Lapack 95 in a DLL</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090056#M23177</link>
      <description>&lt;P&gt;&amp;nbsp;I cant seem to figure out how to set the Properties to compile and link MKL95 in a DLL.&lt;/P&gt;

&lt;P&gt;Here is the code:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;SUBROUTINE GET_ROOTS(phi, philen, side, output)
!DEC$ ATTRIBUTES DLLEXPORT::GET_ROOTS
    USE mkl95_precision
    USE mkl95_lapack, ONLY: HSEQR
    INTEGER, INTENT(IN) :: philen
    REAL(8), INTENT(IN) :: side
    REAL(8), DIMENSION(philen), INTENT(INOUT) :: phi
    COMPLEX(16), DIMENSION(philen-1), INTENT(INOUT) :: output
    COMPLEX(16), DIMENSION(:,:), ALLOCATABLE :: matrixA
    COMPLEX(16), DIMENSION(:), ALLOCATABLE :: roots
    INTEGER :: status, dim, i
    dim = philen-1
    ALLOCATE(matrixA(dim,dim), STAT = status)
    ALLOCATE(roots(dim), STAT = status)
    roots = 0.0_8
    matrixA = 0.0_8
     DO i = 1, dim-1
        matrixA(1,i) = -1.0_8 * phi(philen-i)/phi(philen)
        matrixA(i+1,i) = 1.0_8
    END DO 
    matrixA(1,dim) = -1.0_8 * phi(1)/phi(philen)      
    CALL HSEQR(matrixA,roots)
    output = roots
    DEALLOCATE(matrixA)
    DEALLOCATE(roots)
    return
END SUBROUTINE GET_ROOTS&lt;/PRE&gt;

&lt;P&gt;Here are the compilers errors:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;&amp;gt;GET_ROOTS.f90
GET_ROOTS\GET_ROOTS\GET_ROOTS.f90(8): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MKL95_PRECISION]
GET_ROOTS\GET_ROOTS\GET_ROOTS.f90(9): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [MKL95_LAPACK]
GET_ROOTS\GET_ROOTS\GET_ROOTS.f90(27): error #6406: Conflicting attributes or multiple declaration of name.   [HSEQR]
GET_ROOTS\GET_ROOTS\GET_ROOTS.f90(9): error #6580: Name in only-list does not exist.   [HSEQR]
1&amp;gt;compilation aborted for C:\Users\FrankM\documents\visual studio 2012\Projects\GET_ROOTS\GET_ROOTS\GET_ROOTS.f90 (code 1)&lt;/PRE&gt;

&lt;P&gt;of course the first thing I tried was to set&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;Sequential (/Qmkl:sequential)&lt;/PRE&gt;

&lt;P&gt;I 've also tried using the advisor and get the same messages.&lt;/P&gt;

&lt;P&gt;Help.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 13:05:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090056#M23177</guid>
      <dc:creator>Frank_M</dc:creator>
      <dc:date>2015-11-30T13:05:39Z</dc:date>
    </item>
    <item>
      <title>You did not state which</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090057#M23178</link>
      <description>&lt;P&gt;You did not state which version of MKL you are using, so the following may be a guess: you should probably have USE F95_PRECISION on line-3 and USE LAPACK95, ONLY: HSEQR in line-4. The correct module names may be inferred by looking at the names of the .mod files in the mkl/include/&amp;lt;arch&amp;gt; directory.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 13:15:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090057#M23178</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-11-30T13:15:10Z</dc:date>
    </item>
    <item>
      <title>mkl_lapack95 (for X64, mkl</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090058#M23179</link>
      <description>&lt;P&gt;mkl_lapack95 (for X64, mkl_lapack95_lp64 or mkl_lapack95_ilp64) must be specified in the link line.&amp;nbsp; The USE and /Qmkl aren't sufficient.&amp;nbsp; If you want details, use the link advisor.&amp;nbsp; You do need to know whether you are building for ia32 or Intel64.&lt;/P&gt;

&lt;P&gt;I'm not trying to understand what you mean by "in a dll."&amp;nbsp; A full command line or VS build.html might clarify this.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 16:40:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090058#M23179</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2015-11-30T16:40:00Z</dc:date>
    </item>
    <item>
      <title>I'm using MKL 11.3.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090059#M23180</link>
      <description>&lt;P&gt;I'm using MKL 11.3.&lt;/P&gt;

&lt;P&gt;The use of a DLL is for testing. Specifically what is the error in the roots of a characteristic equation.&lt;/P&gt;

&lt;P&gt;The problem is that I don't know how to set the Property Pages. All the examples provided by Intel assume the use of a command line or a make file.The adviser spits out:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;Use this link line:
 mkl_lapack95.lib mkl_intel_c_dll.lib mkl_core_dll.lib mkl_sequential_dll.lib

Compiler Options:
 /module:"%MKLROOT%"\include\ia32 -I"%MKLROOT%"\include

notes:
 Set the PATH, LIB and INCLUDE environment variables in the command shell using one of mklvars script files in the 'bin' subdirectory of the Intel(R) 
MKL installation directory. Please see also the Intel(R) MKL User Guide.
to Set the F95ROOT variable. Fortran 95 interfaces are compiler-dependent. 
The Fortran 95 interfaces and wrappers are delivered as sources, build the appropriate library and modules 
with your compiler. Please see also the Intel(R) MKL User Guide. 
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Where and how do I set the Property Pages so I don't have to use a make file?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 14:13:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090059#M23180</guid>
      <dc:creator>Frank_M</dc:creator>
      <dc:date>2015-12-02T14:13:04Z</dc:date>
    </item>
    <item>
      <title>you may look at the MKL User</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090060#M23181</link>
      <description>&lt;P&gt;you may look at the MKL User'sGuide - see chapter "Configuring the Microsoft Visual C/C++* Development System to Link with Intel® MKL" where you will find the detailed description how to properly set all items under VS.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2015 15:43:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090060#M23181</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2015-12-02T15:43:40Z</dc:date>
    </item>
    <item>
      <title>Quote:Gennady Fedorov (Intel)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090061#M23182</link>
      <description>&lt;P&gt;Premier support was able to show me that lapack needed precision specified with a SP or DP.&lt;/P&gt;

&lt;P&gt;Unfortunately, although the code will compile without kicking out any errors, I get the following error when actually running the code.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;NET::netexcptn: A .NET exception occurred: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; at Wolfram.NETLink.DynamicDLLNamespace.DLLWrapper1.getroots(Double[] , Int32&amp;amp; , Double[] , Double[] ).&lt;/P&gt;

&lt;P&gt;The error disappears when the call is removed so it seems that mkl is still not getting linked. How do I statically link MKL to a dll?&lt;/P&gt;

&lt;P&gt;I've spent hours and hours reading articles and manuals, tried dozens and dozens of combinations of compiler options, includes, and hard code paths to the mod files. Does anybody know the secret combination?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 11:50:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090061#M23182</guid>
      <dc:creator>Frank_M</dc:creator>
      <dc:date>2015-12-24T11:50:00Z</dc:date>
    </item>
    <item>
      <title>Your problem may be traced to</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090062#M23183</link>
      <description>&lt;P&gt;Your problem may be traced to a possible misunderstanding of what COMPLEX(16) means. As you can see in&amp;nbsp;https://software.intel.com/en-us/node/526047, specifying a kind number of 16 implies that you want quadruple precision, i.e., the same as COMPLEX*32 (the "32" stands for 32 bytes = 16 bytes each for the real and imaginary parts).&lt;/P&gt;

&lt;P&gt;MKL routines do not support quadruple precision, and quadruple precision does not have direct hardware/microcode implementation in X86/X64 CPUs. Consequently, compilation of Fortran codes, such as the one in #1, will fail if interface checking is enabled. If interface checking is not done, linker and/or run-time errors will occur.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 13:34:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090062#M23183</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-12-24T13:34:00Z</dc:date>
    </item>
    <item>
      <title>Quote:mecej4 wrote:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090063#M23184</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Your problem may be traced to a possible misunderstanding of what COMPLEX(16) means. As you can see in&amp;nbsp;&lt;A href="https://software.intel.com/en-us/node/526047"&gt;https://software.intel.com/en-us/node/526047&lt;/A&gt;, specifying a kind number of 16 implies that you want quadruple precision, i.e., the same as COMPLEX*32 (the "32" stands for 32 bytes = 16 bytes each for the real and imaginary parts).&lt;/P&gt;

&lt;P&gt;MKL routines do not support quadruple precision, and quadruple precision does not have direct hardware/microcode implementation in X86/X64 CPUs. Consequently, compilation of Fortran codes, such as the one in #1, will fail if interface checking is enabled. If interface checking is not done, linker and/or run-time errors will occur.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks but that is no longer the issue. The issue is how do you statically link a fortran dll to mkl? Premier support insists that the link line advisor provides a solution, but it doesn't. The LLA says to add the libraries "&amp;nbsp;mkl_lapack95.lib mkl_intel_c.lib mkl_core.lib mkl_intel_thread.lib." Well I've added the libraries.&lt;/P&gt;

&lt;P&gt;Compile"&lt;/P&gt;

&lt;P&gt;1&amp;gt;GET_ROOTS - 0 error(s), 0 warning(s)&lt;BR /&gt;
	========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	Test by trying to call the dll:&lt;/P&gt;

&lt;P&gt;NET::netexcptn: A .NET exception occurred: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; at Wolfram.NETLink.DynamicDLLNamespace.DLLWrapper1.getroots(Double[] , Int32&amp;amp; , Double[] , Double[] ).&lt;/P&gt;

&lt;P&gt;Remove the call to LApack, error goes away.&lt;/P&gt;

&lt;P&gt;The only clues I found are in this thread:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/290594" target="_blank"&gt;https://software.intel.com/en-us/forums/intel-math-kernel-library/topic/290594&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Once again the issue is &lt;STRONG&gt;How do I link a fortran dll to MKL?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2015 22:43:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090063#M23184</guid>
      <dc:creator>Frank_M</dc:creator>
      <dc:date>2015-12-24T22:43:51Z</dc:date>
    </item>
    <item>
      <title>Hi Frank,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090064#M23185</link>
      <description>&lt;P&gt;Hi Frank,&lt;/P&gt;
&lt;P&gt;According to your error message, it seems there is issue when call the Fortran DLL in .Net.&lt;/P&gt;
&lt;P&gt;And Vadimir mentioned, there may be issue when call fortran 95 Dll in .Net.&amp;nbsp;Could you please provide us&amp;nbsp;your test net program so we can test?&lt;/P&gt;
&lt;P&gt;Other possiblity: As fortran call conversion is not different c dll, there are some special things one may consider when call fotran in other lauguage. You may&amp;nbsp;refer to&amp;nbsp;some&amp;nbsp;sample code in Intel&amp;nbsp;Fotran about mixed language call.&amp;nbsp;&amp;nbsp;like&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;The routine name must be in uppercase unless the Fortran code &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;includes an appropriate ALIAS attribute.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;*/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;Best Regards,&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;&lt;FONT color="#008000" size="5" face="Consolas"&gt;Ying&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2015 01:32:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090064#M23185</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-12-25T01:32:37Z</dc:date>
    </item>
    <item>
      <title>Current state of code:</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090065#M23186</link>
      <description>&lt;P&gt;Current state of code:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;!  GET_ROOTS.f90     
!    
!  FUNCTIONS/SUBROUTINES exported from GET_ROOTS.dll:
!  GET_ROOTS - subroutine  
!
SUBROUTINE getroots(phi, philen,rootR, rootI)
!DEC$ ATTRIBUTES DLLEXPORT::getroots 
!DEC$ ATTRIBUTES ALIAS:'getroots' :: getroots
    USE f95_precision, ONLY: WP =&amp;gt; DP
    USE lapack95, ONLY: HSEQR     

    INTEGER(4),     INTENT(IN)                              :: philen
    REAL(8),        DIMENSION(philen),      INTENT(INOUT)   :: phi
    REAL(8),        DIMENSION(philen-1),    INTENT(INOUT)   :: rootR
    REAL(8),        DIMENSION(philen-1),    INTENT(INOUT)   :: rootI
    COMPLEX(WP),    DIMENSION(:,:),         ALLOCATABLE     :: matrixA
    COMPLEX(WP),    DIMENSION(:),           ALLOCATABLE     :: roots
    INTEGER :: status, n, i
    n = philen-1
    ALLOCATE(matrixA(n,n), STAT = status)
    ALLOCATE(roots(n), STAT = status)
    roots = 0.0_8
    matrixA = 0.0_8
    DO i = 1, n-1
        matrixA(1,i) = -1.0_8 * phi(philen-i)/phi(philen)
        matrixA(i+1,i) = 1.0_8
    END DO 
    matrixA(1,n) = -1.0_8 * phi(1)/phi(philen)      
    CALL HSEQR(matrixA, roots)
    rootR = REAL(roots)
    rootI = AIMAG(roots)
    DEALLOCATE(matrixA)
    DEALLOCATE(roots)
    return
END SUBROUTINE getroots&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Current state of test program:&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;Needs["NETLink`"]

ReinstallNET[
  "Force32Bit" -&amp;gt; True];(*or InstallNET["Force32Bit"\[Rule]True]*)

libName = "C:\\Users\\FrankM\\Documents\\Visual Studio 2012\\Projects\
\\GET_ROOTS\\GET_ROOTS\\Debug\\GET_ROOTS.dll"

"C:\\Users\\FrankM\\Documents\\Visual Studio \
2012\\Projects\\GET_ROOTS\\GET_ROOTS\\Debug\\GET_ROOTS.dll"

FileExistsQ[libName]

True

TestSubroutine = 
 DefineDLLFunction["getroots", libName, 
  "void", {"Double[]", "int*", "Double[]", "Double[]"}]

Function[Null, 
 If[NETLink`DLL`Private`checkArgCount["getroots", {##1}, 4], 
  Wolfram`NETLink`DynamicDLLNamespace`DLLWrapper1`getroots[##1], \
$Failed], {HoldAll}]

phi = RandomReal[{-100, 100}, 10];
philen = Length[phi];
rootR = MakeNETObject[Evaluate[Table[0.0, {philen - 1}]]];
rootI = MakeNETObject[Evaluate[Table[0.0, {philen - 1}]]]; 


TestSubroutine[phi, philen, rootR, rootI]

NET::netexcptn: A .NET exception occurred: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
   at Wolfram.NETLink.DynamicDLLNamespace.DLLWrapper1.getroots(Double[] , Int32&amp;amp; , Double[] , Double[] ).

$Failed





out1 = NETObjectToExpression[rootR]

{0., 0., 0., 0., 0., 0., 0., 0., 0.}

out2 = NETObjectToExpression[rootI]

{0., 0., 0., 0., 0., 0., 0., 0., 0.}&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The test program is a mathemataca notebook.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2015 03:54:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090065#M23186</guid>
      <dc:creator>Frank_M</dc:creator>
      <dc:date>2015-12-25T03:54:17Z</dc:date>
    </item>
    <item>
      <title>Here is the current state of</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090066#M23187</link>
      <description>&lt;P&gt;Here is the current state of everything.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2015 04:03:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090066#M23187</guid>
      <dc:creator>Frank_M</dc:creator>
      <dc:date>2015-12-25T04:03:34Z</dc:date>
    </item>
    <item>
      <title>Hi Frank,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090067#M23188</link>
      <description>&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;Hi Frank,&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;I'm not familiar with mathematica environment &amp;nbsp;and it's calling conversion rule, but &amp;nbsp;share my view about your issue.&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;1) according to the error &amp;nbsp;&lt;SPAN style="LINE-HEIGHT: 14.3px; FONT-FAMILY: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; COLOR: rgb(0,0,0); FONT-SIZE: 13px"&gt;An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;&lt;SPAN style="LINE-HEIGHT: 14.3px; BACKGROUND-COLOR: rgb(248,248,248); FONT-FAMILY: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; COLOR: rgb(0,0,0); FONT-SIZE: 13px"&gt;(Double[] , Int32&amp;amp; , Double[] , Double[] )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;&lt;SPAN style="LINE-HEIGHT: 14.3px; FONT-FAMILY: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; COLOR: rgb(0,0,0); FONT-SIZE: 13px"&gt;TestSubroutine[phi, philen, rootR, rootI]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;&lt;FONT color="#000000" face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace"&gt;&lt;SPAN style="LINE-HEIGHT: 14.3px"&gt;How about&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="LINE-HEIGHT: 14.3px; FONT-FAMILY: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; COLOR: rgb(0,0,0); FONT-SIZE: 13px"&gt;TestSubroutine[phi, &lt;STRONG&gt;&amp;amp;philen&lt;/STRONG&gt;, rootR, rootI] ?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;&lt;SPAN style="LINE-HEIGHT: 14.3px; FONT-FAMILY: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; COLOR: rgb(0,0,0); FONT-SIZE: 13px"&gt;2) About the dll&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 1.5; FONT-FAMILY: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; FONT-SIZE: 1em"&gt;GET_ROOTS.dll's dependency. &amp;nbsp;( you can try the depencency walker to check).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;&lt;FONT face="Consolas, Lucida Console, Menlo, Monaco, DejaVu Sans Mono, monospace, sans-serif"&gt;As i see, the GET_ROOTS.dll seems still link with MKL dynamic library (mkl_core.dll etc). if with static library , the thing may simple, for example, test program will not requir the mkl dll again.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;&lt;FONT face="Consolas, Lucida Console, Menlo, Monaco, DejaVu Sans Mono, monospace, sans-serif"&gt;You can change your project to static library&amp;nbsp;&lt;/FONT&gt;&lt;SPAN style="LINE-HEIGHT: 19.51px; FONT-FAMILY: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; FONT-SIZE: 13px"&gt;easily&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;&lt;FONT face="Consolas, Lucida Console, Menlo, Monaco, DejaVu Sans Mono, monospace, sans-serif"&gt;1) switch off &amp;nbsp;Fortran=&amp;gt;library=&amp;gt; Use Intel MKL library = NO.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;&lt;FONT face="Consolas, Lucida Console, Menlo, Monaco, DejaVu Sans Mono, monospace, sans-serif"&gt;2) Add the library path as i mentioned in that article manually.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="PADDING-BOTTOM: 0px; WIDOWS: 1; TEXT-TRANSFORM: none; TEXT-INDENT: 0px; MARGIN: 0px 0px 1.5em; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT: 13px/19.51px Arial, 宋体, Tahoma, Helvetica, sans-serif; WHITE-SPACE: normal; LETTER-SPACING: normal; COLOR: rgb(83,87,94); WORD-SPACING: 0px; PADDING-TOP: 0px; -webkit-text-stroke-width: 0px"&gt;&lt;FONT face="Consolas, Lucida Console, Menlo, Monaco, DejaVu Sans Mono, monospace, sans-serif"&gt;Best Regards,&lt;BR /&gt;Ying&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2015 07:24:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090067#M23188</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2015-12-25T07:24:47Z</dc:date>
    </item>
    <item>
      <title>Mathematica uses netlink to</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090068#M23189</link>
      <description>&lt;P&gt;Mathematica uses netlink to talk to windows. It is similar to C#.&lt;/P&gt;

&lt;P&gt;here is a link if your interested:&amp;nbsp;http://reference.wolfram.com/language/NETLink/tutorial/CallingNETFromTheWolframLanguage.html#24546&lt;/P&gt;

&lt;P&gt;TestSubroutine[phi, &lt;STRONG&gt;&amp;amp;philen&lt;/STRONG&gt;, rootR, rootI]&amp;nbsp; returns a "Syntax::sntxf: "TestSubroutine[phi," cannot be followed by "&amp;amp;philen,rootR,rootI]".&lt;/P&gt;

&lt;P&gt;Without the &lt;CODE class="spaces"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/CODE&gt;&lt;CODE class="keyword"&gt;CALL&lt;/CODE&gt; &lt;CODE class="plain"&gt;HSEQR(matrixA, roots) Mathematica calls and runs the dll. When I create rootR it is asigned 0.0.&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;So to test the test routine I comment out Call HSEQR and set rootR to 1.0 in the dll. &lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;In[11]:= out1 = NETObjectToExpression[rootR]&lt;/P&gt;

&lt;P&gt;Out[11]= {1., 1., 1., 1., 1., 1., 1., 1., 1.}&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I'll start on suggestion 2.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2015 08:02:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090068#M23189</guid>
      <dc:creator>Frank_M</dc:creator>
      <dc:date>2015-12-25T08:02:56Z</dc:date>
    </item>
    <item>
      <title>You can write a small driver</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090069#M23190</link>
      <description>&lt;P&gt;You can write a small driver program in Fortran or C to call your DLL routines with the same arguments as you expect Mathematica to pass to the DLL. We are probably going to be more helpful with such a driver than with a complex program such as Mathematica.&lt;/P&gt;

&lt;P&gt;After fixing any errors in the DLL, you can then see to it that the linkage between Mathematica and the DLL is bug-free.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Dec 2015 11:01:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090069#M23190</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-12-25T11:01:28Z</dc:date>
    </item>
    <item>
      <title>Hi Ying.</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090070#M23191</link>
      <description>&lt;DIV class="forum-post-author"&gt;Hi Ying.&lt;/DIV&gt;

&lt;DIV class="forum-post-author"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV class="forum-post-author"&gt;The method you showed me to static link the dll to mkl produced the same error. It even produced the same error when I commented out the Call HSEQR. I even tried just replacing my solution with yours and changing the test notebook to account for the different parameter list.&lt;/DIV&gt;

&lt;DIV class="forum-post-author"&gt;So perhaps Qmkl is better and the link to mkl is not he problem. I expect the solution is what elengie found. I'll attach the output from the dependency walker.&lt;/DIV&gt;

&lt;DIV class="forum-post-author"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV class="forum-post-author"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;DIV class="forum-post-author"&gt;@ mecej4&lt;/DIV&gt;

&lt;DIV class="forum-post-author"&gt;&amp;nbsp;I'll start on a fortran test program.&lt;/DIV&gt;</description>
      <pubDate>Sat, 26 Dec 2015 12:17:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090070#M23191</guid>
      <dc:creator>Frank_M</dc:creator>
      <dc:date>2015-12-26T12:17:34Z</dc:date>
    </item>
    <item>
      <title>Frank_M, I think that you</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090071#M23192</link>
      <description>&lt;P&gt;Frank_M, I think that you would be more successful if you built up the application in steps.&lt;/P&gt;

&lt;P&gt;The source code of the DLL that I used with the driver below is the same as what you gave in #10, but without any directives. I built the DLL with the command:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;ifort /LD /Qmkl roots.f90 mkl_lapack95.lib /link /export:GETROOTS&lt;/PRE&gt;

&lt;P&gt;I tested using a Fortran driver tst.f90:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program xroots
integer :: philen = 10
double precision :: phi(10) =  &amp;amp;
   [10.7079, 31.3279, -5.48742, -18.5684, -28.8292, &amp;amp;
   -96.5144, -76.2258, 8.62183, 21.7482, 54.6085]
double precision, dimension(9) :: rootR,rootI
!
call getroots(phi,philen,rootR,rootI)
write(*,'(i3,2ES13.4)')(i,rootR(i),rootI(i),i=1,9)
end program
&lt;/PRE&gt;

&lt;P&gt;Compiling the driver with the command&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;ifort tst.f90 roots.lib
&lt;/PRE&gt;

&lt;P&gt;and running the EXE gave the results:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;  1   1.2983E+00   5.5511E-16
  2  -3.9886E-01   1.1530E+00
  3  -3.9886E-01  -1.1530E+00
  4   1.6903E-01   7.7653E-01
  5   6.7501E-01  -2.6411E-16
  6   1.6903E-01  -7.7653E-01
  7  -7.8450E-01   2.8051E-01
  8  -7.8450E-01  -2.8051E-01
  9  -3.4289E-01   0.0000E+00&lt;/PRE&gt;

&lt;P&gt;If this is what you wanted, you can now try calling a similar DLL from Mathematica, after making adjustments for argument passing conventions and linkage rules.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Dec 2015 13:13:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090071#M23192</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-12-26T13:13:00Z</dc:date>
    </item>
    <item>
      <title>I am not able to get the tst</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090072#M23193</link>
      <description>&lt;P&gt;I am not able to get the tst.f90 to link. Where does tst.90 need to be in relation to GET_ROOTS.dll&amp;nbsp; and the GET_ROOTS.lib? Should everything be in the same folder? (I tried having all in same folder and received fatal error LINK120: i unresolved externals&lt;/P&gt;

&lt;P&gt;I compiled the GET_ROOTS.dll using&amp;nbsp; &lt;CODE class="plain"&gt;ifort /LD /Qmkl GET_ROOTS.f90 mkl_lapack95.lib /link /&lt;/CODE&gt;&lt;CODE class="functions"&gt;export&lt;/CODE&gt;&lt;CODE class="plain"&gt;:GET_ROOTS&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE class="plain"&gt;and it compiled fine (after some name changing). When trying to call from mathematica I received a&amp;nbsp; &lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;NET::netexcptn: A .NET exception occurred: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; at Wolfram.NETLink.DynamicDLLNamespace.DLLWrapper1.GET_ROOTS(Double[] , Int32&amp;amp; , Double[] , Double[] ).&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2016 19:39:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090072#M23193</guid>
      <dc:creator>Frank_M</dc:creator>
      <dc:date>2016-01-03T19:39:56Z</dc:date>
    </item>
    <item>
      <title>Happy New year to all of you!</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090073#M23194</link>
      <description>&lt;P&gt;Happy New year to all of you!&amp;nbsp;&lt;/P&gt;

&lt;P&gt;from the dependency walk&amp;nbsp;&lt;A href="https://community.intel.com/legacyfs/online/drupal_files/managed/b9/82/Roots%20dep.png"&gt;Roots dep.png&lt;/A&gt;&amp;nbsp;, &amp;nbsp;the problem seems still here.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;1. &amp;nbsp; dynamic library vs.static library&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;the &amp;nbsp;mkl_core.dll, mkl_seqential.dll are dynamic libraries. it was needed in search path when run your application.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;2. dependency library.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;The dynamic library will&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;depend on other cpu-specific library, like libmkl_avx.dll etc. &amp;nbsp;So when you run your appplication, &amp;nbsp;all of dependency library are needed in search path. &lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;So if the get_root.dll has such dependency, you may need to make all related dll in the mathimatic search path. &amp;nbsp; &amp;nbsp;for example, &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.008px; line-height: 19.512px;"&gt;you may try&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;copy all mkl dlls ( I mean the &lt;STRONG&gt;whole dlls&lt;/STRONG&gt; file in mkl redist directory to your exe folder or windows system32 folder etc).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;On the other hand, &amp;nbsp;that is why I ask you try &lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;static link instead of dll link : &amp;nbsp; manually add &amp;nbsp;in property page =&amp;gt; Linker =&amp;gt; input =&amp;gt; additional dependency:&amp;nbsp;&lt;/SPAN&gt;mkl_lapack95.lib mkl_intel_c.lib mkl_sequential.lib mkl_core.lib&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;&lt;STRONG&gt;not Qmkl:sequential&lt;/STRONG&gt; (it will link dynamic library).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;I build one &amp;nbsp;one C code to call the library as mecej4 (thank a lot) to show this. &amp;nbsp; I upload them later.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;Ying&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 01:32:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090073#M23194</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2016-01-04T01:32:45Z</dc:date>
    </item>
    <item>
      <title>Upload the C call fotran95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090074#M23195</link>
      <description>&lt;P&gt;Upload the C call fotran95 test case and screencopy doc.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 02:04:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Linking-Lapack-95-in-a-DLL/m-p/1090074#M23195</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2016-01-04T02:04:18Z</dc:date>
    </item>
  </channel>
</rss>

