Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Using blas95/lapack95

nousername
Beginner
1,101 Views

I'm new to using ifort for Mac, and am attempting to use the Fortran95 interfaces to blas but I can't get it to work.

I'm trying to use dot(x,y) but when I compile I get an error.

[fortran]

program test
use mkl95_blas
use mkl95_precision
implicit none

real,dimension(2) :: x,y

real res


x = (/1,1/)
y = (/2,2/)
res = dot(x,y)
print *,res


end program

[/fortran]

When I compile I do:

ifort test.f90 -o test -mkl

and get the error:

Undefined symbols for architecture x86_64:
"_sdot_mkl95_", referenced from:
_MAIN__ in ifortSsxXlV.o
ld: symbol(s) not found for architecture x86_64

I think I'm missing someting in the compile options, but I don't know what.

0 Kudos
3 Replies
mecej4
Honored Contributor III
1,101 Views

To the compile command add -lthe_name_of_the_blas95_library. For example, -lmkl_blas95 for IA32 targets.

0 Kudos
Gennady_F_Intel
Moderator
1,101 Views

If compiler reports unresolved symbols/references:  _*_mkl95, then you may add these libraries: mkl_blas95.lib mkl_blas95_lp64.lib mkl_lapack95.lib manually. see the KB article as an example from here: http://software.intel.com/en-us/articles/using-mkl-in-intel-compiler-mkl-qmkl-options or there are many linking examples into User's Guide.

0 Kudos
nousername
Beginner
1,101 Views

Thanks for the help, it compiles fine now

0 Kudos
Reply