<?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 Compilation with MKL_VSL gives compiler error in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Compilation-with-MKL-VSL-gives-compiler-error/m-p/1161639#M27952</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is probably quite simple. When I am using MKL modules like MKL_VSL within my own module I get a compiler error saying Error in opening the compiled module file. Check INCLUDE path&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I do have -I$(MKLROOT)/include when I am compiling my code. Am I missing something? I read somewhere that I might need an "include mkl_vsl.fi". However, If I put this into my own Fortran&amp;nbsp;module I get other clashes, as I am now trying to include a module within a module&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best&lt;/P&gt;&lt;P&gt;Ali&lt;/P&gt;</description>
    <pubDate>Wed, 11 Sep 2019 22:22:51 GMT</pubDate>
    <dc:creator>AThar2</dc:creator>
    <dc:date>2019-09-11T22:22:51Z</dc:date>
    <item>
      <title>Compilation with MKL_VSL gives compiler error</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Compilation-with-MKL-VSL-gives-compiler-error/m-p/1161639#M27952</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is probably quite simple. When I am using MKL modules like MKL_VSL within my own module I get a compiler error saying Error in opening the compiled module file. Check INCLUDE path&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I do have -I$(MKLROOT)/include when I am compiling my code. Am I missing something? I read somewhere that I might need an "include mkl_vsl.fi". However, If I put this into my own Fortran&amp;nbsp;module I get other clashes, as I am now trying to include a module within a module&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best&lt;/P&gt;&lt;P&gt;Ali&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2019 22:22:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Compilation-with-MKL-VSL-gives-compiler-error/m-p/1161639#M27952</guid>
      <dc:creator>AThar2</dc:creator>
      <dc:date>2019-09-11T22:22:51Z</dc:date>
    </item>
    <item>
      <title>Hi Ali,Glad to see your</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Compilation-with-MKL-VSL-gives-compiler-error/m-p/1161640#M27953</link>
      <description>&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Hi Ali,&lt;BR /&gt;Glad to see your interest to the Intel MKL VSL.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;To use Intel MKL VSL functionality you need to add ‘mkl_vsl.f90’ include file to your Fortran module.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;You were right -I$(MKLROOT)/include is a right compiler option to link Intel MKL.&lt;BR /&gt;Please note: here you can find Intel MKL link adviser - &lt;A href="https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor" style="color:#0563c1; text-decoration:underline"&gt;https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&lt;/A&gt;. It can help you in terms of Intel MKL linking.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Hope it addresses your question. If not – please provide a full compilation line and small reproducer for your problem (if it is possible).&lt;BR /&gt;Feel free to ask more.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Best regards,&lt;BR /&gt;Pavel.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 06:18:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Compilation-with-MKL-VSL-gives-compiler-error/m-p/1161640#M27953</guid>
      <dc:creator>Pavel_D_Intel1</dc:creator>
      <dc:date>2019-09-12T06:18:17Z</dc:date>
    </item>
    <item>
      <title>Hello Pavel,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Compilation-with-MKL-VSL-gives-compiler-error/m-p/1161641#M27954</link>
      <description>&lt;P&gt;Hello Pavel,&lt;/P&gt;&lt;P&gt;I found the problem, and I wonder whether this is not a minor bug from Intel's side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem was if I had the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="brush:fortran; class-name:dark;"&gt;include 'mkl_vsl.f90'

module mod_


(..)
(..)

end module_ &lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now if I did have the use mod_ from a different file, the compiler will error me telling that the mod_ is not compiled, check the include path.&lt;/P&gt;
&lt;P&gt;However, I did compile my module mod_1 !. So what I realized was that the compiler simply skipped everything below the include mkl_vsl.f90.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The reason&lt;/STRONG&gt; is simply that I had in my compiler option the following&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;-stand f08 -diag-file&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That creates loads of warnings when having mkl_vsl.f90 included, and I think the compiler because of that gives up after it has finished including the mkl_vsl file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Example&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran; class-name:dark;"&gt;
      include 'mkl_vsl.f90'
      module rnd_test

         use MKL_VSL
         use MKL_VSL_TYPE
   !      use mpi

      implicit none
      real(kind=8) t1,t2  ! buffer for random numbers
      real(kind=8) s        ! average
      real(kind=8) a, sigma,a1,a2 ! parameters of normal distribution
      real(kind=8), allocatable :: r(:),r1(:) ! buffer for random numbers

      TYPE (VSL_STREAM_STATE)::stream

      integer errcode
      integer i,j, n11, nloop, nn
      integer brng,method,seed,n, ierr, size, rank
      integer(kind=8) :: nskip, nmax

      end module&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At a different file have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran; class-name:dark;"&gt;      program ttest
      use rnd_test
      print*, errcode
      end program
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Compile with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran; class-name:dark;"&gt;ifort -c modfile.f prog_file.f -stand f08 -diag-file -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_sequential.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -lpthread -lm -ldl  -DMKL_ILP64 -I${MKLROOT}/include
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and link&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;ifort modfile.o prog_file.o&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you remove the following&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt; -stand f08 -diag-file&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, we will not see any problems&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best&lt;/P&gt;
&lt;P&gt;Ali&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2019 08:34:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Compilation-with-MKL-VSL-gives-compiler-error/m-p/1161641#M27954</guid>
      <dc:creator>AThar2</dc:creator>
      <dc:date>2019-09-12T08:34:15Z</dc:date>
    </item>
    <item>
      <title>Hi Ali,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Compilation-with-MKL-VSL-gives-compiler-error/m-p/1161642#M27955</link>
      <description>&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Hi Ali,&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Thank you for your very detailed code samples.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Intel MKL doesn’t provide strict support for F08 (or other) standard. &amp;nbsp;Thus, compiling with “-stand f08” flag can bring the warning messages you have found.&lt;BR /&gt;Also note that those warnings are just messages related to the non-standard Fortran language usage, and the generated code works fine.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Please, let me know if it addresses your questions.&lt;/P&gt;&lt;P style="margin-left:0cm; margin-right:0cm"&gt;Best regards,&lt;BR /&gt;Pavel.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2019 07:54:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Compilation-with-MKL-VSL-gives-compiler-error/m-p/1161642#M27955</guid>
      <dc:creator>Pavel_D_Intel1</dc:creator>
      <dc:date>2019-09-16T07:54:42Z</dc:date>
    </item>
  </channel>
</rss>

