<?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 Hi Andreas,  in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951426#M15243</link>
    <description>&lt;P&gt;Hi Andreas,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;Both libmkl_gf_lp64 and&amp;nbsp;&amp;nbsp;libmkl_intel_lp64 are &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;LP64 interface library, but mkl_intel_lp64 is&amp;nbsp;for the Intel compilers and GCC compiler, while libmkl_gf_lp64.a is only for &lt;STRONG&gt;GUN fortran compiler&lt;/STRONG&gt;. &amp;nbsp;So the combination gcc + mkl_gf_lp64 doesn't give valid result.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The link advisor&amp;nbsp;&amp;nbsp;&amp;lt;&amp;lt;http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&amp;gt;&amp;gt; may be helpful on these complex combination.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Ying&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jan 2014 02:14:21 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2014-01-08T02:14:21Z</dc:date>
    <item>
      <title>Problem with cblas and gf</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951425#M15242</link>
      <description>&lt;P&gt;Should I expect different behaviour of cblas_zdotc_sub from the libmkl_intel_lp64 and libmkl_gf_lp64 libraries? The latter gives me an unexpected result. Please see the attached program. I get&lt;/P&gt;

&lt;P&gt;$ gcc testjuliamkl.c -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -L /opt/intel/mkl/lib/intel64/ -lpthread -lm -ldl -Wl,-rpath=/opt/intel/mkl/lib/intel64/&lt;BR /&gt;
	$ ./a.out&lt;BR /&gt;
	(60.000000,0.000000)&lt;/P&gt;

&lt;P&gt;but&lt;/P&gt;

&lt;P&gt;$ gcc testjuliamkl.c -lmkl_gf_lp64 -lmkl_core -lmkl_sequential -L /opt/intel/mkl/lib/intel64/ -lpthread -lm -ldl -Wl,-rpath=/opt/intel/mkl/lib/intel64/&lt;BR /&gt;
	$ ./a.out&lt;BR /&gt;
	(0.000000,0.000000)&lt;/P&gt;

&lt;P&gt;and the same happens if I use icc.&lt;/P&gt;

&lt;P&gt;Best&lt;BR /&gt;
	Andreas&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2014 10:14:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951425#M15242</guid>
      <dc:creator>Andreas_Jensen</dc:creator>
      <dc:date>2014-01-07T10:14:21Z</dc:date>
    </item>
    <item>
      <title>Hi Andreas, </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951426#M15243</link>
      <description>&lt;P&gt;Hi Andreas,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;Both libmkl_gf_lp64 and&amp;nbsp;&amp;nbsp;libmkl_intel_lp64 are &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;LP64 interface library, but mkl_intel_lp64 is&amp;nbsp;for the Intel compilers and GCC compiler, while libmkl_gf_lp64.a is only for &lt;STRONG&gt;GUN fortran compiler&lt;/STRONG&gt;. &amp;nbsp;So the combination gcc + mkl_gf_lp64 doesn't give valid result.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;The link advisor&amp;nbsp;&amp;nbsp;&amp;lt;&amp;lt;http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&amp;gt;&amp;gt; may be helpful on these complex combination.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Ying&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2014 02:14:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951426#M15243</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2014-01-08T02:14:21Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951427#M15244</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;sorry to resurrect such an old post but I don't understand where the problem is. This a C&amp;nbsp;code making&amp;nbsp;a call to CBLAS function which has nothing to do with the Fortran compiler and the BLAS Fortran interface. Can anybody provide more insight on this problem?&lt;/P&gt;&lt;P&gt;More generally, if I have a mixed C and Fortran code with calls to CBLAS in the C part and call to standard BLAS in the Fortran part, is it safe to link with libmkl_gf_lp64 when gcc+gfortran are used?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Alfredo&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 18:08:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951427#M15244</guid>
      <dc:creator>Alfredo</dc:creator>
      <dc:date>2018-11-03T18:08:00Z</dc:date>
    </item>
    <item>
      <title>It's not clear whether you</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951428#M15245</link>
      <description>&lt;P&gt;It's not clear whether you have assured that the gfortran libraries have been linked for the mkl_gf case, as well as linking with gcc -fopenmp or some other means of assuring that libgomp is in use rather than libiomp5.&amp;nbsp; If you would show your ldd results, we might be able to rule out some possible problems in that area.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 11:27:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951428#M15245</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2018-11-04T11:27:55Z</dc:date>
    </item>
    <item>
      <title>Dear Tim,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951429#M15246</link>
      <description>&lt;P&gt;Dear Tim,&lt;/P&gt;&lt;P&gt;thanks for your response.&lt;/P&gt;&lt;P&gt;I am not concerned about OpenMP; to make things simple, we can actually limit the discussion to the case where sequential MKL is used.&lt;/P&gt;&lt;P&gt;As far as I understand, the difference between libmkl_intel_lp64 and libmkl_gf_lp64 comes from the different ways that gfortran and ifort handle subroutines/functions arguments and results. Because CBLAS routines are supposed to be called in a C code, I would expect the CBLAS interface to be the same in libmkl_intel_lp64 and libmkl_gf_lp64. As a result, the code posted by Andreas Jensen should work if linked with either libmkl_intel_lp64 or libmkl_gf_lp64 using either icc or gcc. Is this correct?&lt;/P&gt;&lt;P&gt;Now, to go back to my previous question. Assume I have the three files attached. As you can see, in f_sub there is a call to a BLAS routine, in c_sub there is a call to a CBLAS routine and the main program calls both f_sub and c_sub. I compile compile f_sub.f90 using gfortran and c_sub.c using gcc. Now, if I link like this&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt;gcc main_c.c f_sub.o c_sub.o -L$MKLROOT/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm -lgfortran&lt;/PRE&gt;

&lt;P&gt;I have a segfault in f_sub which I understand because f_sub compiled with gofrtran, uses the BLAS ifort interface. If, instead, I link like this&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;gcc main_c.c f_sub.o c_sub.o -L$MKLROOT/lib/intel64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lm -lgfortran&lt;/PRE&gt;

&lt;P&gt;everything works fine although, according to what said by Andreas and Ying above, it shouldn't ecause I should get a wrong result in c_sub.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you help me make some sense out of all this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Alfredo&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 22:25:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-with-cblas-and-gf/m-p/951429#M15246</guid>
      <dc:creator>Alfredo</dc:creator>
      <dc:date>2018-11-04T22:25:42Z</dc:date>
    </item>
  </channel>
</rss>

