Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
6 Views

linking with MKL

Dear All,

I guess this question has been asked a zillion times, but still I can't make heads or tails out of what's available online and my only hope is to ask a question here.

Here's my problem: I have a Fortran 90 code which uses BLAS and LAPACK routines, and I'm trying to compile it with ifort and link it with MKL. I really don't need anything else --- it's a single-thread sequential code, nothing fancy here, just a couple of calls to dgemv and its relatives. The code itself compiles fine gfortran and PGI, so there's not problem there. The only problem is how to link the darn thing with MKL's blas and lapack.

I tried the suggestions from here:
http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/
but this plain doesn't work for me, neither for static nor dynamic link.
The compiler keeps complaing along the lines of:
det_n2___.f:(.text+0xb00): undefined reference to `dcopy_'
det_n2___.f:(.text+0xb4b): undefined reference to `dgemm_'

I'm using ifort version 11.1 on a 32-bit machine under ubuntu 10.04 if that matters.

Any help would be greatly appreciated.

Zhenya
0 Kudos
3 Replies
Highlighted
Black Belt
6 Views

It can be as simple as

$ ifort -mkl

"but this plain doesn't work for me" does not convey any sense of what went wrong. Please post the actual command line used, and the error messages issued. You may add the -V option to produce more informative messages.

0 Kudos
Highlighted
Moderator
6 Views

Zhenya,
may be the Linking Examples ( see into User's Guide) will help you or please see this KB article.
Don't forget to use the grouping symbols
-Wl,--start-group -...........-Wl,--end-group
--Gennady
0 Kudos
Highlighted
Beginner
6 Views

Thank you Gennady for the link to the KB article!
0 Kudos