<?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 passing float _Complex from C to Fortran -- Compiler 11.1.073 ( in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750688#M7214</link>
    <description>Alfredo,&lt;BR /&gt;&lt;BR /&gt;Although this statement is correct in this specific example, I would not count on the assumption in general:&lt;BR /&gt;&lt;BR /&gt; "if the argument is passed by reference instead of by value then everything works"&lt;BR /&gt;&lt;BR /&gt;because in C complex variables are structures, whereas in Fortran COMPLEX is an INTRINSIC type. Since structures are subject to padding/packing, mismatches can occur even if passing is done by reference.&lt;BR /&gt;&lt;BR /&gt;Secondly, I think that the question &lt;BR /&gt;&lt;BR /&gt; "In this case this means that C codes compiled with different compilers may not be compatible, right?"&lt;BR /&gt;&lt;BR /&gt;puts the blame on the wrong entity. On Linux, for good or bad, GCC sets the standard and, as far as I know, did not deviate from the ABI defined by AMD. Discrepancies such as in this problem, therefore, are attributable to Fortran compilers rather than C compilers. In fact, your code runs fine with GFortran.&lt;BR /&gt;&lt;BR /&gt;I am sure that Intel will do the right thing, once the issue is tagged as a bug.&lt;BR /&gt;&lt;BR /&gt;By the way, the code runs correctly on IA64 (IFort 11.1.072, GCC) and Windows-XP64 (IFort 11.1.067-X64, Microsoft C). On the latter platform, however, Microsoft C uses an ABI that is almost completely different from the AMD/INTEL ABI, so GCC and its conventions do not enter the picture.</description>
    <pubDate>Mon, 08 Nov 2010 13:54:21 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2010-11-08T13:54:21Z</dc:date>
    <item>
      <title>passing float _Complex from C to Fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750682#M7208</link>
      <description>&lt;P&gt;Hello,I'm trying to pass some complex data from a C to a Fortran program without success for the moment.I managed to reproduce the problem in the small example belowC code:[cpp]#include void func(float _Complex x); int main(){ func((float _Complex)_Complex_I); return 1; } [/cpp] Fortran code:[fortran]subroutine func(x) bind(c) use iso_c_binding complex(c_float_complex), value :: x write(*,*)'x:',x return end subroutine func[/fortran] The value of x printed is(0.0000000E+00,1.5932920E-10). Am I doing anything wrong here?Note that the same code works fine with GNU and IBM compilers. Moreover, if "float" is replaced with "double" in both sources, then it works ok.Can anybody help please?thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2010 18:57:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750682#M7208</guid>
      <dc:creator>Alfredo_Buttari</dc:creator>
      <dc:date>2010-11-05T18:57:58Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750683#M7209</link>
      <description>No problems with gcc 4.5 and IFort 11.1.073 (32 bit) on X64 Linux:&lt;BR /&gt;&lt;BR /&gt; $ cc -m32 -g -c cplx.c&lt;BR /&gt; $ ifort -g -nofor-main cplx.o cfun.f90&lt;BR /&gt; $ ./a.out&lt;BR /&gt; x: (0.0000000E+00,1.000000)&lt;BR /&gt; $&lt;BR /&gt;&lt;BR /&gt;If you are running on an Apple-Mac, have you checked regarding the X-Code bugs and work-arounds?&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Nov 2010 19:37:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750683#M7209</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-11-05T19:37:05Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750684#M7210</link>
      <description>Hello,&lt;DIV&gt;I'm running on a linux 64-bit system with intel icc and ifort V11.1.072. This is how I compile:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;$ icc -g -c comp_main.c&lt;/DIV&gt;&lt;DIV&gt;$ ifort -g -nofor_main comp_fun.f90 comp_main.o&lt;/DIV&gt;&lt;DIV&gt;$ ./a.out&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;x: (0.0000000E+00,1.5932920E-10)&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;maybe I should check if it works with 11.1.073?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks Mecej&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Nov 2010 21:01:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750684#M7210</guid>
      <dc:creator>Alfredo_Buttari</dc:creator>
      <dc:date>2010-11-05T21:01:19Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran -- Compiler 11.1.073 (</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750685#M7211</link>
      <description>I see the error with the 64-bit version of 11.1.073 on Linux-x64. The IFort compiled subroutine expects to see the real and imaginary parts in separate &lt;I&gt;xmm&lt;/I&gt; registers, whereas C (Gcc or Intel C) passes the parts in the upper and lower halves of &lt;I&gt;xmm0&lt;/I&gt;. Thus, the IFort compiled function takes the trash in &lt;I&gt;xmm1&lt;/I&gt; and prints it as the imaginary part.&lt;BR /&gt;&lt;BR /&gt;It would be interesting to see if the soon-to-be-released 64-bit version of the Intel compiler also has this problem.&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Nov 2010 22:54:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750685#M7211</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-11-05T22:54:19Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran -- Compiler 11.1.073 (</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750686#M7212</link>
      <description>Dear Mecej,&lt;DIV&gt;easy to imagine that if the argument is passed by reference instead of by value then everything works.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Now the question is, is there a correct behavior for passing complex type arguments by value? Is it left to the compiler to decide whether to put the complex number in one or two registers? In this case this means that C codes compiled with different compilers may not be compatible, right? this looks pretty bad.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks for your help&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Alfredo&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 08 Nov 2010 07:43:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750686#M7212</guid>
      <dc:creator>Alfredo_Buttari</dc:creator>
      <dc:date>2010-11-08T07:43:17Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran -- Compiler 11.1.073 (</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750687#M7213</link>
      <description>There is an "ABI" (Application Binary Interface) document that describes, for a given architecture, how such things are done, but who defines this can be a subject of discussion. On Linux, the gcc documents are usually considered the standard here and I know that the Intel compiler has made changes over time to match that.&lt;BR /&gt;&lt;BR /&gt;This issue sounds vaguely familiar and I'll look to see if we know about this.</description>
      <pubDate>Mon, 08 Nov 2010 11:05:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750687#M7213</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-11-08T11:05:50Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran -- Compiler 11.1.073 (</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750688#M7214</link>
      <description>Alfredo,&lt;BR /&gt;&lt;BR /&gt;Although this statement is correct in this specific example, I would not count on the assumption in general:&lt;BR /&gt;&lt;BR /&gt; "if the argument is passed by reference instead of by value then everything works"&lt;BR /&gt;&lt;BR /&gt;because in C complex variables are structures, whereas in Fortran COMPLEX is an INTRINSIC type. Since structures are subject to padding/packing, mismatches can occur even if passing is done by reference.&lt;BR /&gt;&lt;BR /&gt;Secondly, I think that the question &lt;BR /&gt;&lt;BR /&gt; "In this case this means that C codes compiled with different compilers may not be compatible, right?"&lt;BR /&gt;&lt;BR /&gt;puts the blame on the wrong entity. On Linux, for good or bad, GCC sets the standard and, as far as I know, did not deviate from the ABI defined by AMD. Discrepancies such as in this problem, therefore, are attributable to Fortran compilers rather than C compilers. In fact, your code runs fine with GFortran.&lt;BR /&gt;&lt;BR /&gt;I am sure that Intel will do the right thing, once the issue is tagged as a bug.&lt;BR /&gt;&lt;BR /&gt;By the way, the code runs correctly on IA64 (IFort 11.1.072, GCC) and Windows-XP64 (IFort 11.1.067-X64, Microsoft C). On the latter platform, however, Microsoft C uses an ABI that is almost completely different from the AMD/INTEL ABI, so GCC and its conventions do not enter the picture.</description>
      <pubDate>Mon, 08 Nov 2010 13:54:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750688#M7214</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-11-08T13:54:21Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran -- Compiler 11.1.073 (</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750689#M7215</link>
      <description>Steve, Mecej,&lt;DIV&gt;I couldn't ask for a better explanation. Thanks for making this clear.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;best regards&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Alfredo&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 08 Nov 2010 16:18:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750689#M7215</guid>
      <dc:creator>Alfredo_Buttari</dc:creator>
      <dc:date>2010-11-08T16:18:50Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran -- Compiler 11.1.073 (</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750690#M7216</link>
      <description>Mecej,&lt;DIV&gt;just to inform that this issue is still present in the new12.0.0.084 version o the ifort compiler.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;regards&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;alfredo&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Nov 2010 20:02:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750690#M7216</guid>
      <dc:creator>Alfredo</dc:creator>
      <dc:date>2010-11-10T20:02:39Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran -- Compiler 11.1.073 (</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750691#M7217</link>
      <description>Alfredo, the problem seems to be worse (more pervasive, and not specific to C-interoperability) than I thought. I have modified your code and posted a reproducer &lt;A href="http://software.intel.com/en-us/forums/showthread.php?t=78591&amp;amp;o=a&amp;amp;s=lr"&gt;here&lt;/A&gt; which is entirely in Fortran.</description>
      <pubDate>Thu, 11 Nov 2010 00:46:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750691#M7217</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2010-11-11T00:46:29Z</dc:date>
    </item>
    <item>
      <title>passing float _Complex from C to Fortran -- Compiler 11.1.073 (</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750692#M7218</link>
      <description>&lt;P&gt;I reported this defect to Development (internal tracking id noted below) and will keep both posts updated with new status as I learn it.&lt;/P&gt;&lt;P&gt;Thank you again mecej4 for isolation details and convenient reproducer.&lt;/P&gt;&lt;P&gt;(Internal tracking id: DPD200198349)&lt;/P&gt;

(Resolution Update on 10/14/2012): This defect is fixed in the Intel® Fortran Compiler XE Update 6 (12.1.0.233 - Linux)</description>
      <pubDate>Fri, 12 Nov 2010 18:37:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750692#M7218</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2010-11-12T18:37:00Z</dc:date>
    </item>
    <item>
      <title>Please pardon the delayed</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750693#M7219</link>
      <description>Please pardon the delayed update. This defect is fixed in the Intel® Fortran Compiler XE Update 6 (12.1.0.233 - Linux)</description>
      <pubDate>Sun, 14 Oct 2012 08:55:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/passing-float-Complex-from-C-to-Fortran/m-p/750693#M7219</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2012-10-14T08:55:14Z</dc:date>
    </item>
  </channel>
</rss>

