<?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 MKL functions/subroutines in Fortran 95 in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860740#M7499</link>
    <description>&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;mandrew,&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;You forgot to add &lt;/SPAN&gt;&lt;SPAN&gt;mkl_blas95&lt;/SPAN&gt;&lt;SPAN&gt; library (&lt;/SPAN&gt;&lt;SPAN&gt;_dcopy_mkl95_ Undefined symbols&lt;/SPAN&gt;&lt;SPAN&gt;) and &lt;/SPAN&gt;&lt;SPAN&gt;source/common_func.f&lt;/SPAN&gt;&lt;SPAN&gt; file (&lt;/SPAN&gt;&lt;SPAN&gt;_printvectord_ Undefined symbols&lt;/SPAN&gt;&lt;SPAN&gt;). &lt;/SPAN&gt;&lt;SPAN&gt;So, try the next command line:&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;ifort dcopyx.f90 common_func.f -I$MKLINCLUDE -L$MKLPATH -lmkl_blas95 -lmkl_intel -lmkl_intel_thread -lmkl_core -lguide lpthread&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;You can find &lt;/SPAN&gt;&lt;SPAN&gt;libmkl_blas95.a &lt;/SPAN&gt;&lt;SPAN&gt;library in the same directory as .mod files after examples run. Copy it into &lt;/SPAN&gt;&lt;SPAN&gt;$MKLPATH &lt;/SPAN&gt;&lt;SPAN&gt;directory, where other MKL libraries are located.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;Thanks,&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;Vladimir&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jul 2008 03:42:59 GMT</pubDate>
    <dc:creator>Vladimir_Koldakov__I</dc:creator>
    <dc:date>2008-07-11T03:42:59Z</dc:date>
    <item>
      <title>Calling MKL functions/subroutines in Fortran 95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860735#M7494</link>
      <description>I was wondering if someone can tell me how to call Intel MKL subroutines using Fortran 95 syntax. For example, I have modified the provided example code using the ?copy subroutine (copy_main.f90):&lt;BR /&gt;&lt;BR /&gt; program copy_main&lt;BR /&gt;&lt;BR /&gt; implicit none&lt;BR /&gt;&lt;BR /&gt; real(8) :: x(10), y(10)&lt;BR /&gt; integer :: n, incx, incy, i&lt;BR /&gt;&lt;BR /&gt; n=3&lt;BR /&gt; incx=3&lt;BR /&gt; incy=1&lt;BR /&gt;&lt;BR /&gt; do i=1,10&lt;BR /&gt; x(i) = i&lt;BR /&gt; end do&lt;BR /&gt; &lt;BR /&gt; call copy (x, y)&lt;BR /&gt; print*, 'Y = ', (y(i), i=1,n)&lt;BR /&gt; &lt;BR /&gt; end&lt;BR /&gt;&lt;BR /&gt;Upon execution (ifort copy_main.f90 -L$MKLPATH -I$MKLINCLUDE -lmkl_intel -lmkl_intel_thread -lmkl_core -lguide -lpthread) I get the message:&lt;BR /&gt;&lt;BR /&gt;ld: Undefined symbols:&lt;BR /&gt;_copy_&lt;BR /&gt;&lt;BR /&gt;Do I need a USE statement (I don't need a USE statement in Fortran 77)? If so, what file do I need to reference for this? Any help would be greatly appreciated. I am running Mac OS X 10.4.11.&lt;BR /&gt;&lt;BR /&gt;mandrew&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Jul 2008 01:32:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860735#M7494</guid>
      <dc:creator>mandrew</dc:creator>
      <dc:date>2008-07-09T01:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calling MKL functions/subroutines in Fortran 95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860736#M7495</link>
      <description>In order to define the generic interface, you require the&lt;BR /&gt;use mkl_blas &lt;BR /&gt;as described in the Fortran 95 interface section of the manual. You would be able to avoid a USE or include file in either f95 or f77 only by using the specific function names, and forgoing a compile-time check on correctness of interface.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Jul 2008 04:03:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860736#M7495</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2008-07-09T04:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calling MKL functions/subroutines in Fortran 95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860737#M7496</link>
      <description>Thanks for your help. I followed the instructions for creating the mkl95_blas.mod file and inserted it into my directory and modified the previous program to include the USE statement:&lt;BR /&gt;&lt;BR /&gt; program copy_main&lt;BR /&gt;&lt;BR /&gt; use mkl95_blas&lt;BR /&gt; implicit none&lt;BR /&gt; real(8) :: x(10), y(10)&lt;BR /&gt; integer :: n, incx, incy, i&lt;BR /&gt;&lt;BR /&gt; n=3&lt;BR /&gt; incx=3&lt;BR /&gt; incy=1&lt;BR /&gt;&lt;BR /&gt; do i=1,10&lt;BR /&gt; x(i) = i&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; call copy (x, y)&lt;BR /&gt; print*, 'Y = ', (y(i), i=1,n)&lt;BR /&gt;&lt;BR /&gt; end&lt;BR /&gt;&lt;BR /&gt;Upon compilation I get the following:&lt;BR /&gt;&lt;BR /&gt;copy_main.f90(12): (col. 7) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;ld: Undefined symbols:&lt;BR /&gt;_dcopy_mkl95_&lt;BR /&gt;&lt;BR /&gt;Any suggestions as to why this is occurring?&lt;BR /&gt;&lt;BR /&gt;Also, what do you mean by "specific function names?" Using the F77 syntax:&lt;BR /&gt;&lt;BR /&gt; program copy_main&lt;BR /&gt;&lt;BR /&gt; real x(10), y(10)&lt;BR /&gt; integer n, incx incy, i&lt;BR /&gt;&lt;BR /&gt; n=3&lt;BR /&gt; incx=3&lt;BR /&gt; incy=1&lt;BR /&gt;&lt;BR /&gt; do i=1,10&lt;BR /&gt; x(i) = i&lt;BR /&gt; end do&lt;BR /&gt;&lt;BR /&gt; call scopy (n, x, incx, y, incy)&lt;BR /&gt; print*, 'Y = ', (y(i), i=1,n)&lt;BR /&gt;&lt;BR /&gt; end&lt;BR /&gt;&lt;BR /&gt;gives satisfactory results without a USE statement.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Jul 2008 06:03:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860737#M7496</guid>
      <dc:creator>mandrew</dc:creator>
      <dc:date>2008-07-09T06:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calling MKL functions/subroutines in Fortran 95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860738#M7497</link>
      <description>&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;mandrew,&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;Of course, USE statement is required to call MKL blas95 and lapack95 subroutines.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;As you can find in the Intel Fortran documentation,&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT face="Verdana"&gt;&lt;FONT size="2"&gt;You need an interface block for a subroutine when:&lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="MsoNormal"&gt;&lt;SPAN&gt;&lt;FONT face="Verdana"&gt;&lt;FONT size="2"&gt;Calling arguments use argument keywords. &lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="MsoNormal"&gt;&lt;SPAN&gt;&lt;FONT face="Verdana"&gt;&lt;FONT size="2"&gt;Some arguments are optional. &lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="MsoNormal"&gt;&lt;SPAN&gt;&lt;FONT face="Verdana"&gt;&lt;FONT size="2"&gt;A dummy argument is an assumed-shape array, a pointer, or a target. &lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="MsoNormal"&gt;&lt;SPAN&gt;&lt;FONT face="Verdana"&gt;&lt;FONT size="2"&gt;The subroutine extends intrinsic assignment. &lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="MsoNormal"&gt;&lt;SPAN&gt;&lt;FONT face="Verdana"&gt;&lt;FONT size="2"&gt;The subroutine can be referenced by a generic name. &lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="MsoNormal"&gt;&lt;SPAN&gt;&lt;FONT face="Verdana"&gt;&lt;FONT size="2"&gt;The subroutine is in a dynamic-link library. &lt;P&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;So, if you compile your program without USE statement, usual Fortran 77 interface is assumed.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;You can find the correspondent MKL examples, for instance:&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;MKL_PATH&gt;/examples/blas95/source/dcopyx.f90&lt;P&gt;&lt;/P&gt;&lt;/MKL_PATH&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;Note, you can build .mod files and Fortran 95 libraries first.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;To do this just run blas95 examples as described in the MKL user guide.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;See examples execution command line also for the proper linking options.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;Thanks,&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;Vladimir&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2008 06:48:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860738#M7497</guid>
      <dc:creator>Vladimir_Koldakov__I</dc:creator>
      <dc:date>2008-07-09T06:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calling MKL functions/subroutines in Fortran 95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860739#M7498</link>
      <description>Vladimir,&lt;BR /&gt;&lt;BR /&gt;I've tried running the example dcopyx.f90 as you suggested. I first built the .mod files (mkl95_blas, mkl95_precision) and placed them in the same directory as dcopyx.f90. When I compile (ifort dcopyx.f90 -L$MKLPATH -I$MKLINCLUDE -lmkl_intel -lmkl_intel_thread -lmkl_core -lguide -lpthread), I get the following message:&lt;BR /&gt;&lt;BR /&gt;ld: Undefined symbols:&lt;BR /&gt;_printvectord_&lt;BR /&gt;_dcopy_mkl95_&lt;BR /&gt;&lt;BR /&gt;Can you tell me why I get this message? Am I not compiling correctly, or do I need another file of some sort?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;mandrew&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Jul 2008 18:30:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860739#M7498</guid>
      <dc:creator>mandrew</dc:creator>
      <dc:date>2008-07-10T18:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calling MKL functions/subroutines in Fortran 95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860740#M7499</link>
      <description>&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;mandrew,&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;You forgot to add &lt;/SPAN&gt;&lt;SPAN&gt;mkl_blas95&lt;/SPAN&gt;&lt;SPAN&gt; library (&lt;/SPAN&gt;&lt;SPAN&gt;_dcopy_mkl95_ Undefined symbols&lt;/SPAN&gt;&lt;SPAN&gt;) and &lt;/SPAN&gt;&lt;SPAN&gt;source/common_func.f&lt;/SPAN&gt;&lt;SPAN&gt; file (&lt;/SPAN&gt;&lt;SPAN&gt;_printvectord_ Undefined symbols&lt;/SPAN&gt;&lt;SPAN&gt;). &lt;/SPAN&gt;&lt;SPAN&gt;So, try the next command line:&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir="ltr"&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;ifort dcopyx.f90 common_func.f -I$MKLINCLUDE -L$MKLPATH -lmkl_blas95 -lmkl_intel -lmkl_intel_thread -lmkl_core -lguide lpthread&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;You can find &lt;/SPAN&gt;&lt;SPAN&gt;libmkl_blas95.a &lt;/SPAN&gt;&lt;SPAN&gt;library in the same directory as .mod files after examples run. Copy it into &lt;/SPAN&gt;&lt;SPAN&gt;$MKLPATH &lt;/SPAN&gt;&lt;SPAN&gt;directory, where other MKL libraries are located.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;Thanks,&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;Vladimir&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal"&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2008 03:42:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860740#M7499</guid>
      <dc:creator>Vladimir_Koldakov__I</dc:creator>
      <dc:date>2008-07-11T03:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calling MKL functions/subroutines in Fortran 95</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860741#M7500</link>
      <description>Vladimir,&lt;BR /&gt;&lt;BR /&gt;Many thanks for your help - things are working great now.&lt;BR /&gt;&lt;BR /&gt;mandrew&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Jul 2008 17:42:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Calling-MKL-functions-subroutines-in-Fortran-95/m-p/860741#M7500</guid>
      <dc:creator>mandrew</dc:creator>
      <dc:date>2008-07-12T17:42:16Z</dc:date>
    </item>
  </channel>
</rss>

