<?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 Trouble linking to BLAS library with fortran compiler in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-linking-to-BLAS-library-with-fortran-compiler/m-p/1124531#M25156</link>
    <description>&lt;P&gt;So I am trying to get accustomed to linking my f90 code to the MKL library and I decided to start with the $dot function. &amp;nbsp;I have included my compile command and my code below; please note that I set and environment variable for MKLROOT to save space and time.&lt;/P&gt;

&lt;P&gt;My problem is that when I try to compile this, I keep getting the following error:&amp;nbsp;/tmp/ifortdoYMJ3.o: In function `MAIN__':&lt;BR /&gt;
	DotProd.f90:(.text+0x4b7): undefined reference to `sdot_f95_'&lt;/P&gt;

&lt;P&gt;I have been trying to figure out where this problem is coming from, without any luck. I was wondering if someone could provide some insight into this problem? I am working on ubuntu, on a 64 bit system.&lt;/P&gt;

&lt;P&gt;Any help is appreciated!&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;----------------------------------Compile Command&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;ifort DotProd.f90 -L$MKLROOT/lib/intel64/libmkl_blas95_ilp64.a -i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;--------------------------------- Code&lt;/P&gt;

&lt;P&gt;program DotProd&lt;/P&gt;

&lt;P&gt;use f95_precision&lt;BR /&gt;
	use blas95&lt;/P&gt;

&lt;P&gt;implicit none&lt;BR /&gt;
	! This program was constructed to learn how to use the BLAS library of the MKL&lt;BR /&gt;
	! The BLAS routine used will be the ?dot routine.&lt;/P&gt;

&lt;P&gt;real, dimension(:), allocatable :: a,b ! Define two vectors&lt;BR /&gt;
	real res&lt;BR /&gt;
	integer :: size_of_vectors, ent&lt;/P&gt;

&lt;P&gt;! Prompt the user for input&lt;BR /&gt;
	print *, 'Please input the size of the vectors in question'&lt;BR /&gt;
	read *, size_of_vectors&lt;/P&gt;

&lt;P&gt;! Define size of vectors&lt;BR /&gt;
	allocate (a(1:size_of_vectors))&lt;BR /&gt;
	allocate (b(1:size_of_vectors))&lt;/P&gt;

&lt;P&gt;! Prompt user for vector entries&lt;BR /&gt;
	print *, 'Please input the entries for vector a'&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;do ent = 1, size_of_vectors&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;read *, a(ent)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;end do&lt;/P&gt;

&lt;P&gt;print *, 'Please input the entries for vector b'&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;do ent = 1, size_of_vectors&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;read *, b(ent)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;end do&lt;/P&gt;

&lt;P&gt;! Output vectors&lt;BR /&gt;
	print *, 'Vector a ='&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;do ent = 1, size_of_vectors&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;print *, a(ent)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;end do&lt;BR /&gt;
	print *, 'Vector b ='&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;do ent = 1, size_of_vectors&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;print *, b(ent)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;end do&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	res = dot(a,b)&lt;BR /&gt;
	print* , 'a dot b =', res&lt;/P&gt;

&lt;P&gt;end program DotProd&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2016 23:49:41 GMT</pubDate>
    <dc:creator>Clint_S_</dc:creator>
    <dc:date>2016-05-12T23:49:41Z</dc:date>
    <item>
      <title>Trouble linking to BLAS library with fortran compiler</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-linking-to-BLAS-library-with-fortran-compiler/m-p/1124531#M25156</link>
      <description>&lt;P&gt;So I am trying to get accustomed to linking my f90 code to the MKL library and I decided to start with the $dot function. &amp;nbsp;I have included my compile command and my code below; please note that I set and environment variable for MKLROOT to save space and time.&lt;/P&gt;

&lt;P&gt;My problem is that when I try to compile this, I keep getting the following error:&amp;nbsp;/tmp/ifortdoYMJ3.o: In function `MAIN__':&lt;BR /&gt;
	DotProd.f90:(.text+0x4b7): undefined reference to `sdot_f95_'&lt;/P&gt;

&lt;P&gt;I have been trying to figure out where this problem is coming from, without any luck. I was wondering if someone could provide some insight into this problem? I am working on ubuntu, on a 64 bit system.&lt;/P&gt;

&lt;P&gt;Any help is appreciated!&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;----------------------------------Compile Command&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;ifort DotProd.f90 -L$MKLROOT/lib/intel64/libmkl_blas95_ilp64.a -i8 -I$MKLROOT/include/intel64/ilp64 -I$MKLROOT/include -Wl,--start-group $MKLROOT/lib/intel64/libmkl_intel_ilp64.a $MKLROOT/lib/intel64/libmkl_core.a $MKLROOT/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;--------------------------------- Code&lt;/P&gt;

&lt;P&gt;program DotProd&lt;/P&gt;

&lt;P&gt;use f95_precision&lt;BR /&gt;
	use blas95&lt;/P&gt;

&lt;P&gt;implicit none&lt;BR /&gt;
	! This program was constructed to learn how to use the BLAS library of the MKL&lt;BR /&gt;
	! The BLAS routine used will be the ?dot routine.&lt;/P&gt;

&lt;P&gt;real, dimension(:), allocatable :: a,b ! Define two vectors&lt;BR /&gt;
	real res&lt;BR /&gt;
	integer :: size_of_vectors, ent&lt;/P&gt;

&lt;P&gt;! Prompt the user for input&lt;BR /&gt;
	print *, 'Please input the size of the vectors in question'&lt;BR /&gt;
	read *, size_of_vectors&lt;/P&gt;

&lt;P&gt;! Define size of vectors&lt;BR /&gt;
	allocate (a(1:size_of_vectors))&lt;BR /&gt;
	allocate (b(1:size_of_vectors))&lt;/P&gt;

&lt;P&gt;! Prompt user for vector entries&lt;BR /&gt;
	print *, 'Please input the entries for vector a'&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;do ent = 1, size_of_vectors&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;read *, a(ent)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;end do&lt;/P&gt;

&lt;P&gt;print *, 'Please input the entries for vector b'&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;do ent = 1, size_of_vectors&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;read *, b(ent)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;end do&lt;/P&gt;

&lt;P&gt;! Output vectors&lt;BR /&gt;
	print *, 'Vector a ='&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;do ent = 1, size_of_vectors&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;print *, a(ent)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;end do&lt;BR /&gt;
	print *, 'Vector b ='&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;do ent = 1, size_of_vectors&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;print *, b(ent)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;end do&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	res = dot(a,b)&lt;BR /&gt;
	print* , 'a dot b =', res&lt;/P&gt;

&lt;P&gt;end program DotProd&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 23:49:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Trouble-linking-to-BLAS-library-with-fortran-compiler/m-p/1124531#M25156</guid>
      <dc:creator>Clint_S_</dc:creator>
      <dc:date>2016-05-12T23:49:41Z</dc:date>
    </item>
  </channel>
</rss>

