<?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 I have changed the c# code in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934871#M88684</link>
    <description>&lt;P&gt;I have changed the c# code like (changed bvls to&amp;nbsp;&lt;SPAN style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em; line-height: 1.5;"&gt;BVLS&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;):&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;
[DllImport("bvlsF.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        static extern void BVLS(
            int key, //key = 0, the subroutine solves the problem from scratch. If key &amp;gt; 0 the routine initializes using the user's guess about which components of  x  are `active'
            int m,
            int n,
            double[] a, //  m by n matrix
            double[] b, //  m-vector 
            double[] bl, //n-vector of lower bounds on the components of x.
            double[] bu, //n-vector of upper bounds on the components of x.
            [In, Out] double[] x, //unknown n-vector
            //Working  arrays:
            [In, Out] double[] w,  //dimension n
            double[] act, //dimension m*(mm+2). mm=min(m,n).
            double[] zz, //dimension m
            [In, Out] int[] istate, //dimension n+1.
            ref int loopA //   number of iterations taken in the main loop, Loop A.
            );&lt;/PRE&gt;

&lt;P&gt;And now it seems it finds the routine, however I am getting other error:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;
Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at bvlsCs.Program.BVLS(Int32 key, Int32 m, Int32 n, Double[] a, Double[] b, Double[] bl, Double[] bu, Double[] x, Double[] w, Double[] act, Double[] zz, Int32[] istate, Int32&amp;amp; loopA)&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I am doing:&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;
            int key = 0, n = 2, m = 3;
           double[] a = { 19.0, 27.0, 33.0, 42.0, 51.0 };
           double[] b = { 12.0, 27.0, 30.0 };
           double[] bl = { 0.1, 0.2 };
           double[] bu = { 0.9, 0.9 };
           double[] x = new double&lt;N&gt;;
           double[] w = new double&lt;N&gt;;
           double[] act = new double[m * (Math.Min(m, n) + 2)];
           double[] zz = new double&lt;M&gt;;
            int[] istate = new int[n + 1];
            int loopA = 0;
            BVLS(key, m, n, a, b, bl, bu, x, w, act, zz, istate, ref loopA);&lt;/M&gt;&lt;/N&gt;&lt;/N&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Mar 2014 23:21:58 GMT</pubDate>
    <dc:creator>St</dc:creator>
    <dc:date>2014-03-03T23:21:58Z</dc:date>
    <item>
      <title>Problem finding EntryPoint in generated dll</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934866#M88679</link>
      <description>&lt;P&gt;There is Fortran code from &amp;nbsp;&lt;SPAN style="color: rgb(0, 0, 0); font-family: helvetica, arial, 'sans serif'; font-size: 16px; line-height: normal; text-indent: -16px;"&gt;&lt;A href="http://www.stat.berkeley.edu/~stark/Code/bvls.f"&gt;Stark, P.B., and R.L. Parker&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;I build it on Visual Studio 2010 uing Fortran Compiler (Compóser XE 2011)&lt;/P&gt;

&lt;P&gt;Original code is Fortran&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;
   subroutine bvls(key, m, n, a, b, bl, bu, x, w, act, zz, istate,  loopA)
    implicit double precision (a-h, o-z)
    !DEC$ ATTRIBUTES DLLEXPORT :: bvls
      dimension a(m,n), b(m), x(n), bl(n), bu(n)
!     dimension w(n), act(m,min(m,n)+2), zz(m), istate(n+1)
      dimension w(n), act(m,m+2), zz(m), istate(n+1)&lt;/PRE&gt;

&lt;P&gt;C# code (I am not sure about [In,Out] and ref variables)&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;
[DllImport("bvlsF.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        static extern void bvls(
            int key, //key = 0, the subroutine solves the problem from scratch. If key &amp;gt; 0 the routine initializes using the user's guess about which components of  x  are `active'
            int m,
            int n,
            double[] a, //  m by n matrix
            double[] b, //  m-vector 
            double[] bl, //n-vector of lower bounds on the components of x.
            double[] bu, //n-vector of upper bounds on the components of x.
            [In, Out] double[] x, //unknown n-vector
            //Working  arrays:
            [In, Out] double[] w,  //dimension n
            double[] act, //dimension m*(mm+2). mm=min(m,n).
            double[] zz, //dimension m
            [In, Out] int[] istate, //dimension n+1.
            ref int loopA //   number of iterations taken in the main loop, Loop A.
            );&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;To test dll I do:&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;
static void BVTEST()
        {
           int key = 0, n = 2, m = 3;
           double[] a = { 19.0, 27.0, 33.0, 42.0, 51.0 };
           double[] b = { 12.0, 27.0, 30.0 };
           double[] bl = { 0.1, 0.2 };
           double[] bu = { 0.9, 0.9 };
           double[] x = new double&lt;N&gt;;
           double[] w = new double&lt;N&gt;;
           double[] act = new double[m * (Math.Min(m, n) + 2)];
           double[] zz = new double&lt;M&gt;;
            int[] istate = new int[n + 1];
            int loopA = 0;
            bvls(key, m, n, a, b, bl, bu, x, w, act, zz, istate, ref loopA);
           for (int i = 0; i &amp;lt; x.Length; i++)
               Console.WriteLine(" " + x&lt;I&gt;);
           Console.WriteLine(loopA);
}&lt;/I&gt;&lt;/M&gt;&lt;/N&gt;&lt;/N&gt;&lt;/PRE&gt;

&lt;P&gt;However I get:&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	System.EntryPointNotFoundException: Can not find entrypoint&amp;nbsp;'bvls' on file &amp;nbsp;'bvlsF.dll'.&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;on bvlsCs.Program.bvls(Int32 key, Int32 m, Int32 n, Double[] a, Double[] b, D&lt;BR /&gt;
	ouble[] bl, Double[] bu, Double[] x, Double[] w, Double[] act, Double[] zz, Int3&lt;BR /&gt;
	2[] istate, Int32&amp;amp; loopA)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&lt;/P&gt;

&lt;P&gt;I do not understand why is happening, so I tested with sample code I found on forum and it works:&lt;/P&gt;

&lt;P&gt;fortran&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;
subroutine Arr_Sub (var,row,col)
!DEC$ ATTRIBUTES DLLEXPORT :: Arr_Sub
integer :: row,col
real var(col,row)
integer :: i, j
write(*,*) "Array var received from C# as array is"
write(*,*) var
! do something to change the value of var
end subroutine&lt;/PRE&gt;

&lt;P&gt;c#&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;
[DllImport("bvlsF.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        public static extern void ARR_SUB([In,Out] float[,] fArr, ref int row, ref int col);&lt;/PRE&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;
            float[,] fArr = new float[3, 4] { { 1, 23, 3, 4 }, { 1, 3, 20, 5 }, { 1, 23, 3, 6 } };
            int row = 3;
            int col = 4;
            ARR_SUB(fArr, ref row, ref col);&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Could you please help me execute that fortran code in c#?, &lt;A href="http://eurekavi.com/cu/bvlsF.zip"&gt;I attach visual studio with fortran code...&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 22:08:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934866#M88679</guid>
      <dc:creator>St</dc:creator>
      <dc:date>2014-03-03T22:08:52Z</dc:date>
    </item>
    <item>
      <title>You need to provide more info</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934867#M88680</link>
      <description>&lt;P&gt;You need to provide more info about your use case.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 22:14:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934867#M88680</guid>
      <dc:creator>dnesteruk</dc:creator>
      <dc:date>2014-03-03T22:14:42Z</dc:date>
    </item>
    <item>
      <title>There is Fortran code from</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934868#M88681</link>
      <description>&lt;P&gt;There is Fortran code from &amp;nbsp;&lt;SPAN style="color: rgb(0, 0, 0); font-family: helvetica, arial, 'sans serif'; font-size: 16px; line-height: normal; text-indent: -16px;"&gt;&lt;A href="http://www.stat.berkeley.edu/~stark/Code/bvls.f"&gt;Stark, P.B., and R.L. Parker&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;I build it on Visual Studio 2010 uing Fortran Compiler (Compóser XE 2011)&lt;/P&gt;

&lt;P&gt;Original code is Fortran&lt;/P&gt;

&lt;PRE class="brush:fortran;" style="font-size: 13px;"&gt;
   subroutine bvls(key, m, n, a, b, bl, bu, x, w, act, zz, istate,  loopA)
    implicit double precision (a-h, o-z)
    !DEC$ ATTRIBUTES DLLEXPORT :: bvls
      dimension a(m,n), b(m), x(n), bl(n), bu(n)
!     dimension w(n), act(m,min(m,n)+2), zz(m), istate(n+1)
      dimension w(n), act(m,m+2), zz(m), istate(n+1)&lt;/PRE&gt;

&lt;P&gt;C# code (I am not sure about [In,Out] and ref variables)&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:csharp;" style="font-size: 13px;"&gt;
[DllImport("bvlsF.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        static extern void bvls(
            int key, //key = 0, the subroutine solves the problem from scratch. If key &amp;gt; 0 the routine initializes using the user's guess about which components of  x  are `active'
            int m,
            int n,
            double[] a, //  m by n matrix
            double[] b, //  m-vector 
            double[] bl, //n-vector of lower bounds on the components of x.
            double[] bu, //n-vector of upper bounds on the components of x.
            [In, Out] double[] x, //unknown n-vector
            //Working  arrays:
            [In, Out] double[] w,  //dimension n
            double[] act, //dimension m*(mm+2). mm=min(m,n).
            double[] zz, //dimension m
            [In, Out] int[] istate, //dimension n+1.
            ref int loopA //   number of iterations taken in the main loop, Loop A.
            );&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;To test dll I do:&lt;/P&gt;

&lt;PRE class="brush:csharp;" style="font-size: 13px;"&gt;
static void BVTEST()
        {
           int key = 0, n = 2, m = 3;
           double[] a = { 19.0, 27.0, 33.0, 42.0, 51.0 };
           double[] b = { 12.0, 27.0, 30.0 };
           double[] bl = { 0.1, 0.2 };
           double[] bu = { 0.9, 0.9 };
           double[] x = new double&lt;N&gt;;
           double[] w = new double&lt;N&gt;;
           double[] act = new double[m * (Math.Min(m, n) + 2)];
           double[] zz = new double&lt;M&gt;;
            int[] istate = new int[n + 1];
            int loopA = 0;
            bvls(key, m, n, a, b, bl, bu, x, w, act, zz, istate, ref loopA);
           for (int i = 0; i &amp;lt; x.Length; i++)
               Console.WriteLine(" " + x&lt;I&gt;);
           Console.WriteLine(loopA);
}&lt;/I&gt;&lt;/M&gt;&lt;/N&gt;&lt;/N&gt;&lt;/PRE&gt;

&lt;P&gt;However I get:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;
System.EntryPointNotFoundException: Can not find entrypoint 'bvls' on file  'bvlsF.dll'.
   on bvlsCs.Program.bvls(Int32 key, Int32 m, Int32 n, Double[] a, Double[] b, D
ouble[] bl, Double[] bu, Double[] x, Double[] w, Double[] act, Double[] zz, Int3
2[] istate, Int32&amp;amp; loopA)&lt;/PRE&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&lt;/P&gt;

&lt;P&gt;I do not understand why is happening, so I tested with sample code I found on forum and it works:&lt;/P&gt;

&lt;P&gt;fortran&lt;/P&gt;

&lt;PRE class="brush:fortran;" style="font-size: 13px;"&gt;
subroutine Arr_Sub (var,row,col)
!DEC$ ATTRIBUTES DLLEXPORT :: Arr_Sub
integer :: row,col
real var(col,row)
integer :: i, j
write(*,*) "Array var received from C# as array is"
write(*,*) var
! do something to change the value of var
end subroutine&lt;/PRE&gt;

&lt;P&gt;c#&lt;/P&gt;

&lt;PRE class="brush:csharp;" style="font-size: 13px;"&gt;
[DllImport("bvlsF.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        public static extern void ARR_SUB([In,Out] float[,] fArr, ref int row, ref int col);&lt;/PRE&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;PRE class="brush:csharp;" style="font-size: 13px;"&gt;
            float[,] fArr = new float[3, 4] { { 1, 23, 3, 4 }, { 1, 3, 20, 5 }, { 1, 23, 3, 6 } };
            int row = 3;
            int col = 4;
            ARR_SUB(fArr, ref row, ref col);&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Could you please help me execute that fortran code in c#?,&amp;nbsp;&lt;A href="http://eurekavi.com/cu/bvlsF.zip"&gt;I attach visual studio with fortran code...&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 22:22:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934868#M88681</guid>
      <dc:creator>St</dc:creator>
      <dc:date>2014-03-03T22:22:58Z</dc:date>
    </item>
    <item>
      <title>I'll take a look</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934869#M88682</link>
      <description>&lt;P&gt;I'll take a look&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 22:54:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934869#M88682</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2014-03-03T22:54:36Z</dc:date>
    </item>
    <item>
      <title>Thank you so much Ronald. </title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934870#M88683</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;SPAN style="color: rgb(34, 34, 34); font-family: arial, sans-serif; line-height: normal;"&gt;Ronald.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 23:02:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934870#M88683</guid>
      <dc:creator>St</dc:creator>
      <dc:date>2014-03-03T23:02:14Z</dc:date>
    </item>
    <item>
      <title>I have changed the c# code</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934871#M88684</link>
      <description>&lt;P&gt;I have changed the c# code like (changed bvls to&amp;nbsp;&lt;SPAN style="font-family: Consolas, 'Lucida Console', Menlo, Monaco, 'DejaVu Sans Mono', monospace, sans-serif; font-size: 1em; line-height: 1.5;"&gt;BVLS&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;):&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;
[DllImport("bvlsF.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        static extern void BVLS(
            int key, //key = 0, the subroutine solves the problem from scratch. If key &amp;gt; 0 the routine initializes using the user's guess about which components of  x  are `active'
            int m,
            int n,
            double[] a, //  m by n matrix
            double[] b, //  m-vector 
            double[] bl, //n-vector of lower bounds on the components of x.
            double[] bu, //n-vector of upper bounds on the components of x.
            [In, Out] double[] x, //unknown n-vector
            //Working  arrays:
            [In, Out] double[] w,  //dimension n
            double[] act, //dimension m*(mm+2). mm=min(m,n).
            double[] zz, //dimension m
            [In, Out] int[] istate, //dimension n+1.
            ref int loopA //   number of iterations taken in the main loop, Loop A.
            );&lt;/PRE&gt;

&lt;P&gt;And now it seems it finds the routine, however I am getting other error:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;
Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at bvlsCs.Program.BVLS(Int32 key, Int32 m, Int32 n, Double[] a, Double[] b, Double[] bl, Double[] bu, Double[] x, Double[] w, Double[] act, Double[] zz, Int32[] istate, Int32&amp;amp; loopA)&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I am doing:&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;
            int key = 0, n = 2, m = 3;
           double[] a = { 19.0, 27.0, 33.0, 42.0, 51.0 };
           double[] b = { 12.0, 27.0, 30.0 };
           double[] bl = { 0.1, 0.2 };
           double[] bu = { 0.9, 0.9 };
           double[] x = new double&lt;N&gt;;
           double[] w = new double&lt;N&gt;;
           double[] act = new double[m * (Math.Min(m, n) + 2)];
           double[] zz = new double&lt;M&gt;;
            int[] istate = new int[n + 1];
            int loopA = 0;
            BVLS(key, m, n, a, b, bl, bu, x, w, act, zz, istate, ref loopA);&lt;/M&gt;&lt;/N&gt;&lt;/N&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 23:21:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934871#M88684</guid>
      <dc:creator>St</dc:creator>
      <dc:date>2014-03-03T23:21:58Z</dc:date>
    </item>
    <item>
      <title>You only sent the Fortran so</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934872#M88685</link>
      <description>&lt;P&gt;You only sent the Fortran so I don't have the full solution.&amp;nbsp; Still I think I can answer this.&lt;/P&gt;

&lt;P&gt;Fortran default is to create symbols in UPPER CASE unless you tell it otherwise.&amp;nbsp; notice the sample, in C# you reference ARR_SUB in uppercase, not 'Arr_Sub' as it appears in the Fortran.&amp;nbsp; The compiler creates the external symbol for bvls as "BVLS" not "bvls".&amp;nbsp;&lt;/P&gt;

&lt;P&gt;So if you reference BVLS this should work.&amp;nbsp; Alternatively, you can add another directive to the fortran to force lowercase:&lt;/P&gt;

&lt;P&gt;!DIR$ ATTRIBUTES ALIAS:'blvs' :: blvs&lt;BR /&gt;
	&lt;BR /&gt;
	!DIR$ ATTRIBUTES DLLEXPORT :: blvs&lt;/P&gt;

&lt;P&gt;I think you can combine the 2 directives thusly&lt;/P&gt;

&lt;P&gt;!dir$ attributes dllexport, alias:'blvs' :: blvs&lt;/P&gt;

&lt;P&gt;let me know if this works.&lt;/P&gt;

&lt;P&gt;ron&lt;/P&gt;</description>
      <pubDate>Mon, 03 Mar 2014 23:34:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934872#M88685</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2014-03-03T23:34:34Z</dc:date>
    </item>
    <item>
      <title>Hi Ron, this works as</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934873#M88686</link>
      <description>&lt;P&gt;Hi Ron, this works as expected, however As explained in a previous comment now I am getting other error&amp;nbsp;&lt;/P&gt;

&lt;DIV class="line alt1" style="line-height: 14.30880069732666px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; color: rgb(96, 96, 96); margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: inherit !important;"&gt;&amp;nbsp;&lt;/DIV&gt;

&lt;PRE class="brush:;"&gt;
Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at bvlsCs.Program.BVLS(Int32 key, Int32 m, Int32 n, Double[] a, Double[] b, Double[] bl, Double[] bu, Double[] x, Double[] w, Double[] act, Double[] zz, Int32[] istate, Int32&amp;amp; loopA)
&lt;/PRE&gt;

&lt;P&gt;Also, do you think parameters are well defined on dllimport on c# code?&lt;/P&gt;

&lt;P&gt;It seems there is memory violation somewhere but i can not find where...&lt;/P&gt;

&lt;DIV class="line alt2" style="line-height: 14.30880069732666px; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; color: rgb(96, 96, 96); margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; background-image: none !important; background-color: rgb(248, 248, 248) !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; min-height: inherit !important;"&gt;
	&lt;TABLE style="border-collapse: collapse !important; border: 0px !important; font-size: 1em !important; margin-top: 0px !important; margin-bottom: 0px !important; width: auto !important; vertical-align: baseline !important; outline: 0px !important; background-image: none !important; float: none !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.1em !important; min-height: inherit !important;"&gt;
		&lt;TBODY style="border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-size: 1em !important; min-height: inherit !important;"&gt;
			&lt;TR style="border: 0px !important; outline: 0px !important; background-image: none !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-size: 1em !important; min-height: inherit !important;"&gt;
				&lt;TD class="content" style="border-width: 0px 0px 0px 3px !important; padding: 0px 0px 0px 0.5em !important; border-left-style: solid !important; border-left-color: rgb(108, 226, 108) !important; outline: 0px !important; background-image: none !important; float: none !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.1em !important; font-size: 1em !important; min-height: inherit !important; color: rgb(0, 0, 0) !important;"&gt;&amp;nbsp;&lt;/TD&gt;
			&lt;/TR&gt;
		&lt;/TBODY&gt;
	&lt;/TABLE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 03 Mar 2014 23:40:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934873#M88686</guid>
      <dc:creator>St</dc:creator>
      <dc:date>2014-03-03T23:40:52Z</dc:date>
    </item>
    <item>
      <title>To rely a little less on</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934874#M88687</link>
      <description>&lt;P&gt;To rely a little less on directives (you still need to mark the procedure for export) you could alternatively add the BIND(C, NAME='bvls') suffix to the subroutine statement.&lt;/P&gt;

&lt;P&gt;(If you are also calling the bvls procedure from Fortran, you then also need an explicit interface.)&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 00:09:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934874#M88687</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2014-03-04T00:09:11Z</dc:date>
    </item>
    <item>
      <title>I don't know C#, but from the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934875#M88688</link>
      <description>&lt;P&gt;I don't know C#, but from the working sample it appears all arrays should be passed [IN,OUT] and all scalars by 'ref'&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;
[DllImport("bvlsF.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
	        static extern void BVLS(
	            ref int key, //key = 0, the subroutine solves the problem from scratch. If key &amp;gt; 0 the routine initializes using the user's guess about which components of  x  are `active'
	            ref int m,
	            ref int n,
	            [In, Out] double[] a, //  m by n matrix
	            [In, Out] double[] b, //  m-vector
	            [In, Out] double[] bl, //n-vector of lower bounds on the components of x.
	            [In, Out] double[] bu, //n-vector of upper bounds on the components of x.
	            [In, Out] double[] x, //unknown n-vector
	            //Working  arrays:
	            [In, Out] double[] w,  //dimension n
	            [In, Out] double[] act, //dimension m*(mm+2). mm=min(m,n).
	            [In, Out] double[] zz, //dimension m
	            [In, Out] int[] istate, //dimension n+1.
	            ref int loopA //   number of iterations taken in the main loop, Loop A.
	            );
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;If this doesn't work, I'd like you to send me the C# source to work with.&amp;nbsp; I have the Fortran project (unless this has changed)&lt;/P&gt;

&lt;P&gt;ron&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 17:57:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934875#M88688</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2014-03-04T17:57:15Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;&gt;System</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934876#M88689</link>
      <description>&lt;P&gt;&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14.399999618530273px;"&gt;&amp;gt;&amp;gt;&amp;gt;System.EntryPointNotFoundException: Can not find entrypoint&amp;nbsp;'bvls' on file &amp;nbsp;'bvlsF.dll'.&lt;/SPAN&gt;&lt;BR style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14.399999618530273px;" /&gt;
	&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14.399999618530273px;"&gt;&amp;nbsp; &amp;nbsp;on bvlsCs.Program.bvls(Int32 key, Int32 m, Int32 n, Double[] a, Double[] b, D&lt;/SPAN&gt;&lt;BR style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14.399999618530273px;" /&gt;
	&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14.399999618530273px;"&gt;ouble[] bl, Double[] bu, Double[] x, Double[] w, Double[] act, Double[] zz, Int3&lt;/SPAN&gt;&lt;BR style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14.399999618530273px;" /&gt;
	&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14.399999618530273px;"&gt;2[] istate, Int32&amp;amp; loopA&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 14.399999618530273px;"&gt;It is quite confusing message.I suppose that error here is related to exported bvls function from bvlsF.dll..You can check bvlsF.dll with Dependency Walker or with dumpbin.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 18:59:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-finding-EntryPoint-in-generated-dll/m-p/934876#M88689</guid>
      <dc:creator>Bernard</dc:creator>
      <dc:date>2014-03-04T18:59:00Z</dc:date>
    </item>
  </channel>
</rss>

