Using blas95/lapack95

Using blas95/lapack95

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.

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

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.

4 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

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

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.

Thanks for the help, it compiles fine now, but when I run it I get another error:

dyld: Library not loaded: libmkl_intel_lp64.dylib
Referenced from: /Users/Doymand/Desktop/./test
Reason: image not found
Trace/BPT trap: 5

So I had to export the libraries to my DYLD_LIBRARY_PATH, then it worked

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!