<?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: Calling Fortran DLL from Python in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875427#M73699</link>
    <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; I'm unsure why you asked a follow-on question in comp.lang.fortran - I'm glad to answer here.&lt;BR /&gt;&lt;BR /&gt;What I said earlier was correct, but it's more than just using ATTRIBUTES STDCALL, since that has other effects, mainly, pass-by-value. You could add REFERENCE to the ATTRIBUTES line (!DEC$ ATTRIBUTES STDCALL, REFERENCE :: demo) and that would be sufficient in combination with the existing ALIAS.&lt;BR /&gt;&lt;BR /&gt;To get the full effect of /iface:cvf, use this combination:&lt;BR /&gt;&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, REFERENCE, MIXED_STR_LEN_ARG, DECORATE, ALIAS:"DEMO" :: demo&lt;BR /&gt;&lt;BR /&gt;You don't want the DECORATE in this case because you don't want a decorated name. I've suggested that the compiler add ATTRIBUTES CVF to do this and this should show up in a future version.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Thanks Steve. I posted to c.l.f because I was in a hurry to get this sorted out - just impatience, in other words. I was hoping that there would be a combination of ATTRIBUTES, and I'm not disappointed.&lt;BR /&gt;&lt;BR /&gt;BTW, my motivation for this Python-Fortran interface is to explore using Python (+Qt) to build a GUI for my program. I considered using Xeffort, to stay with Fortran, but that would restrict things to Windows. Python, in combination with other open-source tools, looks like a feasible option.&lt;BR /&gt;</description>
    <pubDate>Thu, 10 Sep 2009 19:37:51 GMT</pubDate>
    <dc:creator>gib</dc:creator>
    <dc:date>2009-09-10T19:37:51Z</dc:date>
    <item>
      <title>Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875421#M73693</link>
      <description>I came across an example of calling a Fortran subroutine (in a DLL) from Python that apparently works with CVF. The Fortran and Python files are attached. When I test it with IVF it almost works. The program writes out&lt;BR /&gt;&lt;BR /&gt; 2 3.000000 Test56789&lt;BR /&gt;&lt;BR /&gt;which is correct, then the error message:&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "demo.py", line 17, in &lt;MODULE&gt;&lt;BR /&gt; mydll.DEMO(byref(rc))&lt;BR /&gt;ValueError: Procedure probably called with too many arguments (4 bytes in excess)&lt;BR /&gt;&lt;BR /&gt;I'm guessing this is related to the character variable. What should I do to make this work?&lt;/MODULE&gt;</description>
      <pubDate>Wed, 09 Sep 2009 06:05:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875421#M73693</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-09-09T06:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875422#M73694</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
My guess is that Python wants the Fortran routine to be STDCALL.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Sep 2009 13:40:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875422#M73694</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-09-09T13:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875423#M73695</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; My guess is that Python wants the Fortran routine to be STDCALL.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
That doesn't seem to work. I added the line&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, ALIAS:'DEMO' :: demo&lt;BR /&gt;(ALIAS needed for demo to be found) and got:&lt;BR /&gt;&lt;BR /&gt; 11313288  3.1208767E-39 T! (+ more nonprinting characters)&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "demo.py", line 17, in &lt;MODULE&gt;&lt;BR /&gt; mydll.DEMO(byref(rc))&lt;BR /&gt;WindowsError: exception: access violation reading 0x2020656C&lt;BR /&gt;&lt;BR /&gt;The arguments (3,2.0,'Test56789') are now not passed correctly.&lt;BR /&gt;Using 'C' instead of 'STDCALL' doesn't work either. I feel sure it must be possible to get this to work.&lt;BR /&gt;&lt;EDIT&gt;&lt;BR /&gt;A colleague has suggested that it could be an alignment issue - 8-byte vs. 4-byte boundary - and that there might be a compiler option to overcome this. There are many compiler options.&lt;BR /&gt;&lt;/EDIT&gt;&lt;/MODULE&gt;</description>
      <pubDate>Thu, 10 Sep 2009 03:05:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875423#M73695</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-09-10T03:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875424#M73696</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/311276"&gt;gib&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; That doesn't seem to work. I added the line&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, ALIAS:'DEMO' :: demo&lt;BR /&gt;(ALIAS needed for demo to be found) and got:&lt;BR /&gt;&lt;BR /&gt; 11313288  3.1208767E-39 T! (+ more nonprinting characters)&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "demo.py", line 17, in &lt;MODULE&gt;&lt;BR /&gt; mydll.DEMO(byref(rc))&lt;BR /&gt;WindowsError: exception: access violation reading 0x2020656C&lt;BR /&gt;&lt;BR /&gt;The arguments (3,2.0,'Test56789') are now not passed correctly.&lt;BR /&gt;Using 'C' instead of 'STDCALL' doesn't work either. I feel sure it must be possible to get this to work.&lt;BR /&gt;&lt;EDIT&gt;&lt;BR /&gt;A colleague has suggested that it could be an alignment issue - 8-byte vs. 4-byte boundary - and that there might be a compiler option to overcome this. There are many compiler options.&lt;BR /&gt;&lt;/EDIT&gt;&lt;/MODULE&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
I find that if I set Fortran &amp;gt; External Procedures &amp;gt; Calling Convention to CVF, the example runs correctly. What are the implications of this change for my real program? &lt;BR /&gt;</description>
      <pubDate>Thu, 10 Sep 2009 03:39:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875424#M73696</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-09-10T03:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875425#M73697</link>
      <description>&lt;DIV style="margin: 0px; height: auto;"&gt;&lt;/DIV&gt;
I'm unsure why you asked a follow-on question in comp.lang.fortran - I'm glad to answer here.&lt;BR /&gt;&lt;BR /&gt;What I said earlier was correct, but it's more than just using ATTRIBUTES STDCALL, since that has other effects, mainly, pass-by-value. You could add REFERENCE to the ATTRIBUTES line (!DEC$ ATTRIBUTES STDCALL, REFERENCE :: demo) and that would be sufficient in combination with the existing ALIAS.&lt;BR /&gt;&lt;BR /&gt;To get the full effect of /iface:cvf, use this combination:&lt;BR /&gt;&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, REFERENCE, MIXED_STR_LEN_ARG, DECORATE, ALIAS:"DEMO" :: demo&lt;BR /&gt;&lt;BR /&gt;You don't want the DECORATE in this case because you don't want a decorated name. I've suggested that the compiler add ATTRIBUTES CVF to do this and this should show up in a future version.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Sep 2009 12:42:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875425#M73697</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-09-10T12:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875426#M73698</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/311276"&gt;gib&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;I came across an example of calling a Fortran subroutine (in a DLL) from Python that apparently works with CVF. The Fortran and Python files are attached. When I test it with IVF it almost works. The program writes out&lt;BR /&gt;&lt;BR /&gt; 2 3.000000 Test56789&lt;BR /&gt;&lt;BR /&gt;which is correct, then the error message:&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "demo.py", line 17, in &lt;MODULE&gt;&lt;BR /&gt; mydll.DEMO(byref(rc))&lt;BR /&gt;ValueError: Procedure probably called with too many arguments (4 bytes in excess)&lt;BR /&gt;&lt;BR /&gt;I'm guessing this is related to the character variable. What should I do to make this work?&lt;/MODULE&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;You might want to try using F2py (part of numpy) which allows you to call fortran code directly from a Python module.&lt;BR /&gt;&lt;BR /&gt;see &lt;A href="http://www.scipy.org/F2py" target="_blank"&gt;http://www.scipy.org/F2py&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Sep 2009 14:41:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875426#M73698</guid>
      <dc:creator>tracyx</dc:creator>
      <dc:date>2009-09-10T14:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875427#M73699</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/336209"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; I'm unsure why you asked a follow-on question in comp.lang.fortran - I'm glad to answer here.&lt;BR /&gt;&lt;BR /&gt;What I said earlier was correct, but it's more than just using ATTRIBUTES STDCALL, since that has other effects, mainly, pass-by-value. You could add REFERENCE to the ATTRIBUTES line (!DEC$ ATTRIBUTES STDCALL, REFERENCE :: demo) and that would be sufficient in combination with the existing ALIAS.&lt;BR /&gt;&lt;BR /&gt;To get the full effect of /iface:cvf, use this combination:&lt;BR /&gt;&lt;BR /&gt;!DEC$ ATTRIBUTES STDCALL, REFERENCE, MIXED_STR_LEN_ARG, DECORATE, ALIAS:"DEMO" :: demo&lt;BR /&gt;&lt;BR /&gt;You don't want the DECORATE in this case because you don't want a decorated name. I've suggested that the compiler add ATTRIBUTES CVF to do this and this should show up in a future version.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Thanks Steve. I posted to c.l.f because I was in a hurry to get this sorted out - just impatience, in other words. I was hoping that there would be a combination of ATTRIBUTES, and I'm not disappointed.&lt;BR /&gt;&lt;BR /&gt;BTW, my motivation for this Python-Fortran interface is to explore using Python (+Qt) to build a GUI for my program. I considered using Xeffort, to stay with Fortran, but that would restrict things to Windows. Python, in combination with other open-source tools, looks like a feasible option.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Sep 2009 19:37:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875427#M73699</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-09-10T19:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875428#M73700</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/300194"&gt;tracyx&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/311276"&gt;gib&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;I came across an example of calling a Fortran subroutine (in a DLL) from Python that apparently works with CVF. The Fortran and Python files are attached. When I test it with IVF it almost works. The program writes out&lt;BR /&gt;&lt;BR /&gt; 2 3.000000 Test56789&lt;BR /&gt;&lt;BR /&gt;which is correct, then the error message:&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "demo.py", line 17, in &lt;MODULE&gt;&lt;BR /&gt; mydll.DEMO(byref(rc))&lt;BR /&gt;ValueError: Procedure probably called with too many arguments (4 bytes in excess)&lt;BR /&gt;&lt;BR /&gt;I'm guessing this is related to the character variable. What should I do to make this work?&lt;/MODULE&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;You might want to try using F2py (part of numpy) which allows you to call fortran code directly from a Python module.&lt;BR /&gt;&lt;BR /&gt;see &lt;A href="http://www.scipy.org/F2py" target="_blank"&gt;http://www.scipy.org/F2py&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Thanks, I am looking at F2py.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Sep 2009 19:38:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875428#M73700</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-09-10T19:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875429#M73701</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/311276"&gt;gib&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Thanks Steve. I posted to c.l.f because I was in a hurry to get this sorted out - just impatience, in other words. I was hoping that there would be a combination of ATTRIBUTES, and I'm not disappointed.&lt;BR /&gt;&lt;BR /&gt;BTW, my motivation for this Python-Fortran interface is to explore using Python (+Qt) to build a GUI for my program. I considered using Xeffort, to stay with Fortran, but that would restrict things to Windows. Python, in combination with other open-source tools, looks like a feasible option.&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Gib,&lt;BR /&gt;&lt;BR /&gt;When you've got your GUI working under Python, can you post some details about what you have done, because I am sure there are many of us interested in learning more about new ways of doing this.&lt;BR /&gt;&lt;BR /&gt;Over the years, I have used RealWin (started using withLahey and continued through CVF, DVF to IVF), but is now unsupported; I have started migrating my GUI's to Xeffort, but it is a major job for my main application which has a dozen or more input dialogs with hundreds of input fields.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;David</description>
      <pubDate>Thu, 10 Sep 2009 23:57:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875429#M73701</guid>
      <dc:creator>DavidWhite</dc:creator>
      <dc:date>2009-09-10T23:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875430#M73702</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/142656"&gt;David White&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;Gib,&lt;BR /&gt;&lt;BR /&gt;When you've got your GUI working under Python, can you post some details about what you have done, because I am sure there are many of us interested in learning more about new ways of doing this.&lt;BR /&gt;&lt;BR /&gt;Over the years, I have used RealWin (started using withLahey and continued through CVF, DVF to IVF), but is now unsupported; I have started migrating my GUI's to Xeffort, but it is a major job for my main application which has a dozen or more input dialogs with hundreds of input fields.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;David&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Certainly David. I will have a student working on this for 10 weeks over our summer, i.e. starting in mid-November. I've just been doing some preliminary reconnaisance. A colleague is very keen about MayaVi&lt;BR /&gt;&lt;A href="http://en.wikipedia.org/wiki/MayaVi" target="_blank"&gt;http://en.wikipedia.org/wiki/MayaVi&lt;/A&gt;, which he invokes with Python scripts, for 3D graphics. I myself am reluctant to learn yet another language, but it seems almost unavoidable.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;Gib&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Sep 2009 02:01:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875430#M73702</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-09-11T02:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875431#M73703</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
I've been doing some GUI stuff in Python recently:&lt;BR /&gt;&lt;BR /&gt;
&lt;UL&gt;
&lt;LI&gt;F2py to compile my fortran code so it is callable as a python module&lt;/LI&gt;
&lt;LI&gt;PyQt4 for the user interface&lt;/LI&gt;
&lt;LI&gt;matplotlib to do the visualisation&lt;/LI&gt;
&lt;/UL&gt;
This works well for me, and it did not take long to learn (coming from a zero python background).&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Sep 2009 11:12:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875431#M73703</guid>
      <dc:creator>tracyx</dc:creator>
      <dc:date>2009-09-11T11:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875432#M73704</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/300194"&gt;tracyx&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; I've been doing some GUI stuff in Python recently:&lt;BR /&gt;&lt;BR /&gt; 
&lt;UL&gt;
&lt;LI&gt;F2py to compile my fortran code so it is callable as a python module&lt;/LI&gt;
&lt;LI&gt;PyQt4 for the user interface&lt;/LI&gt;
&lt;LI&gt;matplotlib to do the visualisation&lt;/LI&gt;
&lt;/UL&gt;
This works well for me, and it did not take long to learn (coming from a zero python background).&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Sounds encouraging. Is F2py OK with Fortran95? I'm guessing that there might be limits to the range of permissible subroutine arguments. E.g. can an argument be a pointer?&lt;BR /&gt;&lt;BR /&gt;Gib&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Sep 2009 01:36:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875432#M73704</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-09-12T01:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875433#M73705</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/311276"&gt;gib&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Sounds encouraging. Is F2py OK with Fortran95? I'm guessing that there might be limits to the range of permissible subroutine arguments. E.g. can an argument be a pointer?&lt;BR /&gt;&lt;BR /&gt;Gib&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Yes, it is okay with F95, but there are limitations for arguments. In particular, I do not believe it (yet) supports derived types. As I understand, Python does not have much need for pointers (so that may not be relevant), but things like optional arguments, arrays, etc. are all fine.&lt;BR /&gt;&lt;BR /&gt;I do most my development on Linux, in which case I was able to get F2py to work with ifort 11 without any difficulty at all. On windows I was not able to get ifort 11 working with F2py, but both G95 and gfortran worked no problem.&lt;BR /&gt;&lt;BR /&gt;A introductory guide to F2py which I found useful is here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www-uxsup.csx.cam.ac.uk/courses/PythonFortran/f2py2.pdf" target="_blank"&gt;http://www-uxsup.csx.cam.ac.uk/courses/PythonFortran/f2py2.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this is useful.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Sep 2009 12:40:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875433#M73705</guid>
      <dc:creator>tracyx</dc:creator>
      <dc:date>2009-09-12T12:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calling Fortran DLL from Python</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875434#M73706</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/300194"&gt;tracyx&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/311276"&gt;gib&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; Sounds encouraging. Is F2py OK with Fortran95? I'm guessing that there might be limits to the range of permissible subroutine arguments. E.g. can an argument be a pointer?&lt;BR /&gt;&lt;BR /&gt;Gib&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Yes, it is okay with F95, but there are limitations for arguments. In particular, I do not believe it (yet) supports derived types. As I understand, Python does not have much need for pointers (so that may not be relevant), but things like optional arguments, arrays, etc. are all fine.&lt;BR /&gt;&lt;BR /&gt;I do most my development on Linux, in which case I was able to get F2py to work with ifort 11 without any difficulty at all. On windows I was not able to get ifort 11 working with F2py, but both G95 and gfortran worked no problem.&lt;BR /&gt;&lt;BR /&gt;A introductory guide to F2py which I found useful is here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www-uxsup.csx.cam.ac.uk/courses/PythonFortran/f2py2.pdf" target="_blank"&gt;http://www-uxsup.csx.cam.ac.uk/courses/PythonFortran/f2py2.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this is useful.&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Thanks. The difficulty you had with ifort on Windows may have been related to the calling convention issue that Steve resolved for me.&lt;BR /&gt;&lt;BR /&gt;BTW I've done only preliminary investigations but it looks as if I'll be able to do much of what I want just using the ctypes module. If I need to have access to multidimensional arrays in Python then I'll have to get into f2py.&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Sep 2009 20:33:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Calling-Fortran-DLL-from-Python/m-p/875434#M73706</guid>
      <dc:creator>gib</dc:creator>
      <dc:date>2009-09-12T20:33:14Z</dc:date>
    </item>
  </channel>
</rss>

