<?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: Basic linking to BLAS95 in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901776#M11321</link>
    <description>Thanks a lot tabrezali! I tried your advice, and now both BLAS and LAPACK are working for me:&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;ifort -o a.out main.f90 -I/opt/intel/mkl/10.0.3.020/include -L/opt/intel/mkl/10.0.3.020/lib/em64t -lmkl_blas95 -lmkl_lapack95 -lmkl -lguide -lpthread&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;It seems that I was missing before was the &lt;I&gt;-lmkl&lt;/I&gt; option.&lt;BR /&gt;Again, thanks for answering, it was really helpful.&lt;BR /&gt;&lt;BR /&gt;Best regards, Jakob&lt;BR /&gt;</description>
    <pubDate>Wed, 20 Aug 2008 15:34:47 GMT</pubDate>
    <dc:creator>tjoff</dc:creator>
    <dc:date>2008-08-20T15:34:47Z</dc:date>
    <item>
      <title>Basic linking to BLAS95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901773#M11318</link>
      <description>Hi forum,&lt;BR /&gt;I am sorry for posting a lame question but I am just starting to use Fortran. I translated some of my programs from MATLAB and I want to see what the improvement in speed will be. So far using ifort -O3 I can get them to run about 5 times faster and now I want to use BLAS to see if there will be further improvement.&lt;BR /&gt;Unfortunately, I haven't yet figured out how to link with BLAS95 correctly. I have built the BLAS95 routines with ifort and have the mkl95_blas.mod and mkl95_precision.mod in the standard dir ../lib/emt64t. &lt;BR /&gt;Suppose I want to run the simpliest program using just gemm:&lt;BR /&gt;&lt;BR /&gt;program myprog&lt;BR /&gt;&lt;BR /&gt;use mkl95_precision&lt;BR /&gt;use mkl95_blas&lt;BR /&gt;&lt;BR /&gt;implicit none&lt;BR /&gt;real(8), dimension(2,2) ::a,b,c&lt;BR /&gt;&lt;BR /&gt;!/ matrices defined here&lt;BR /&gt;call gemm(a,b,c)&lt;BR /&gt;&lt;BR /&gt;end program myprog&lt;BR /&gt;&lt;BR /&gt;Could you please tell me which options (-L, -I paths, libraries) should I invoke with ifort to get it working (I only want BLAS95 for a start). Because I am lost as I always get the error:&lt;BR /&gt;/tmp/ifortbs5xfm.o: In function `MAIN__':&lt;BR /&gt;myprog.f90:(.text+0x204): undefined reference to `dgemm_mkl95_'&lt;BR /&gt;&lt;BR /&gt;Hope somebody will help me get started&lt;BR /&gt;Cheers,&lt;BR /&gt;Tomasz&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2008 11:58:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901773#M11318</guid>
      <dc:creator>sohnchen</dc:creator>
      <dc:date>2008-08-20T11:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Basic linking to BLAS95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901774#M11319</link>
      <description>Hi Tomasz and all others&lt;BR /&gt;&lt;BR /&gt;I seem to have the same background and be in the same situation as Tomasz, and I only saw his post after I had completed my own, which I allow myself to post in this thread.&lt;BR /&gt;&lt;BR /&gt;I have tried long and hard to link my own Fortran 95 program with the BLAS and LAPACK implementations of the Intel MKL 10.0.3.020, but without success.&lt;BR /&gt;&lt;BR /&gt;This is an excerpt from my program:&lt;BR /&gt;&lt;I&gt;program main&lt;BR /&gt;&lt;BR /&gt;
 use mkl95_blas&lt;BR /&gt;
 use mkl95_lapack&lt;BR /&gt;&lt;BR /&gt;
 implicit none&lt;BR /&gt;&lt;BR /&gt;
 integer,parameter::dp=kind(1.0d0)&lt;BR /&gt;
 real(kind=dp),dimension(10)::test,test2&lt;BR /&gt; integer::i&lt;BR /&gt;&lt;BR /&gt;
test1 = (/ (i*1.d0,i=1,10) /)&lt;BR /&gt;
 test2 = 0&lt;BR /&gt;
 &lt;BR /&gt;
 call copy(test1,test2)&lt;BR /&gt;&lt;BR /&gt;
end program main&lt;/I&gt;




&lt;BR /&gt;&lt;BR /&gt;When I compile I get the following error:&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&lt;FONT face="Arial"&gt;/home/tjoff/programming/fortran/workspace/Liftlin/src/Main.f90:120: undefined reference to `dcopy_mkl95_'&lt;BR /&gt;make: *** [all] Error 1&lt;/FONT&gt;&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Excerpt from my Makefile:&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;MKLPATH  = /opt/intel/mkl/10.0.3.020/lib/em64t&lt;BR /&gt;MKLINCLUDE = /opt/intel/mkl/10.0.3.020/include&lt;BR /&gt;all:&lt;BR /&gt; ifort -o a.out main.f90&lt;/I&gt; &lt;I&gt;$(LINKFLAGS) &lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;where i have tried various values for $(LINKFLAGS), e.g.&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;LINKFLAGS = -L$(MKLPATH) -I$(MKLINCLUDE) -lmkl_lapack95&lt;BR /&gt;-Wl,--start-group $(MKLPATH)/libmkl_intel_lp64.a&lt;BR /&gt;$(MKLPATH)/libmkl_intel_thread.a $(MKLPATH)/libmkl_core.a -Wl,--end-group&lt;BR /&gt;-lguide -lpthread&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;which according to the Users guide should be "static linking of user code myprog.f, Fortran 90 LAPACK interface1, and parallel Intel&lt;BR /&gt;MKL supporting LP64 interface&lt;I&gt;"&lt;/I&gt;, which i suppose is what I want&lt;I&gt;. &lt;BR /&gt;&lt;/I&gt;I have tried both static and dynamic linking as given in the Users guide, but it all results in the above error. &lt;BR /&gt;&lt;BR /&gt;I have checked the following:&lt;BR /&gt;&lt;BR /&gt;- ifort runs perfectly&lt;BR /&gt;&lt;BR /&gt;- in my .bashrc file I have the line&lt;BR /&gt;&lt;I&gt;source /opt/intel/mkl/10.0.3.020/tools/environment/mklvarsem64t.sh&lt;/I&gt;&lt;BR /&gt;and the environment variables all seem right to me&lt;BR /&gt;&lt;BR /&gt;- The instructions in the User Guide section "Fortran 90 Interfaces and Wrappers to LAPACK and BLAS" have been followed, and the directory&lt;I&gt; /opt/intel/mkl/10.0.3.020/include&lt;/I&gt; contains&lt;BR /&gt;the files &lt;I&gt;mkl95_blas.mod, mkl95_lapack.mod&lt;/I&gt; and &lt;I&gt;mkl95_precision.mod&lt;/I&gt; as well as some &lt;I&gt;.f77, f.90&lt;/I&gt; and &lt;I&gt;.h&lt;/I&gt; files.&lt;BR /&gt;The directory &lt;I&gt;/opt/intel/mkl/10.0.3.020/lib/em64t&lt;/I&gt; also contains &lt;I&gt;mkl95_blas.mod, mkl95_lapack.mod&lt;/I&gt; and &lt;I&gt;mkl95_precision.mod&lt;/I&gt; as well as all the &lt;I&gt;.a&lt;/I&gt; and &lt;I&gt;.so&lt;/I&gt; files.&lt;BR /&gt;&lt;BR /&gt;I will be very grateful for any hints&lt;BR /&gt;&lt;BR /&gt;regards, Jakob&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2008 12:53:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901774#M11319</guid>
      <dc:creator>tjoff</dc:creator>
      <dc:date>2008-08-20T12:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Basic linking to BLAS95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901775#M11320</link>
      <description>When you build the Fortran 95 wrapper files (for BLAS) you should get these three files&lt;BR /&gt;&lt;BR /&gt;libmkl_blas95.a&lt;BR /&gt;mkl95_blas.mod&lt;BR /&gt;mkl95_precision.mod&lt;BR /&gt;&lt;BR /&gt;If you move the "*.mod" files to /opt/intel/mkl/include and the "*.a" file to /opt/intel/mkl/lib/32 then you simply use&lt;BR /&gt;&lt;BR /&gt;ifort -I/opt/intel/mkl/include my_example.f90 -L/opt/intel/mkl/lib/32 -lmkl_blas95 -lmkl -lguide -lpthread&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Btw Matlab (specially under windoze) also seems to use MKL underneath so you may not see large speedups wrt to blas/lapack calls. See &lt;A href="http://www.mathworks.com/support/solutions/data/1-JDIO3.html?solution=1-JDIO3"&gt;http://www.mathworks.com/support/solutions/data/1-JDIO3.html?solution=1-JDIO3&lt;/A&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2008 14:20:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901775#M11320</guid>
      <dc:creator>Tabrez_Ali</dc:creator>
      <dc:date>2008-08-20T14:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Basic linking to BLAS95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901776#M11321</link>
      <description>Thanks a lot tabrezali! I tried your advice, and now both BLAS and LAPACK are working for me:&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;ifort -o a.out main.f90 -I/opt/intel/mkl/10.0.3.020/include -L/opt/intel/mkl/10.0.3.020/lib/em64t -lmkl_blas95 -lmkl_lapack95 -lmkl -lguide -lpthread&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;It seems that I was missing before was the &lt;I&gt;-lmkl&lt;/I&gt; option.&lt;BR /&gt;Again, thanks for answering, it was really helpful.&lt;BR /&gt;&lt;BR /&gt;Best regards, Jakob&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2008 15:34:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901776#M11321</guid>
      <dc:creator>tjoff</dc:creator>
      <dc:date>2008-08-20T15:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Basic linking to BLAS95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901777#M11322</link>
      <description>Are you sure your lapack95 calls are working correctly because I think it is more like "-lmkl_lapack95 -lmkl_lapack ...".&lt;BR /&gt;&lt;BR /&gt;Basically the 95 stuff just gets added before what you need otherwise. Playing around or &lt;A href="http://www.intel.com/software/products/mkl/docs/mklgs_lnx.htm#Linking_Your_Application_with_Intel_MKL"&gt;refering&lt;/A&gt; the docs will get you there.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Aug 2008 16:09:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901777#M11322</guid>
      <dc:creator>Tabrez_Ali</dc:creator>
      <dc:date>2008-08-20T16:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Basic linking to BLAS95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901778#M11323</link>
      <description>Thanks a lot, works beautifully now! It looks like the Intel Fortran Compiler matrix multiplication is quite good on its own, as I don't see that much improvement from using MKL. But on the whole the program runs significantly faster then in MATLAB (much faster for loops, similar for matrix multiplications).&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Aug 2008 10:28:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Basic-linking-to-BLAS95/m-p/901778#M11323</guid>
      <dc:creator>sohnchen</dc:creator>
      <dc:date>2008-08-21T10:28:15Z</dc:date>
    </item>
  </channel>
</rss>

