Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
7234 Discussions

Undefined Symbols error calling LAPACK subroutines

carless
Beginner
924 Views

Hi,

I just started using the MKL for MAc OS X. I cannot link and I get an Undefined Symbols error when I try to call a LAPACK subroutine. I would very much appreciate some help.

I use the following software:

XCode v.3.1.1

Mac OS X v. 10.5.4

Intel Fortran Compiler v.10.1



In the main code I have the commands:



USE mkl95_PRECISION, ONLY: WP => SP

USE mkl95_LAPACK, ONLY: gttrf,gttrs



and



call cgttrf(ifou_r, dl, dd, du, du2, ipiv, info1)

call cgttrs(N, ifou_r, 1, dl, dd, du, du2, ipiv, BB, ifou_r, info2)



The compilation command reads:



ifort -O4 /Library/Frameworks/Intel_MKL.framework/Versions/10.0.3.020/include/mkl_lapack.f90 -o HHP HH_P.f90 -L/Library/Frameworks/Intel_MKL.framework/Versions/10.0.3.020/lib/em64t -I/Library/Frameworks/Intel_MKL.framework/Versions/10.0.3.020/include -lmkl_lapack -lmkl_intel_thread -lmkl_core -lguide -lpthread



I always get the following error:



Undefined symbols:

"_cgttrf_", referenced from:

_MAIN__ in ifortMrPnMw.o

"_cgttrs_", referenced from:

_MAIN__ in ifortMrPnMw.o

ld: symbol(s) not found



Thank you,

Carles

0 Kudos
2 Replies
Todd_R_Intel
Employee
924 Views
Quoting - carless
ifort -O4 /Library/Frameworks/Intel_MKL.framework/Versions/10.0.3.020/include/mkl_lapack.f90 -o HHP HH_P.f90 -L/Library/Frameworks/Intel_MKL.framework/Versions/10.0.3.020/lib/em64t -I/Library/Frameworks/Intel_MKL.framework/Versions/10.0.3.020/include -lmkl_lapack -lmkl_intel_thread -lmkl_core -lguide -lpthread

Try adding -lmkl_intel_lp64 before "-lmkl_lapack" in your build command above.libmkl_intel_lp64.dylib is the interface library which is always necessary in addition to the threading layer ("-lmkl_intel_thread" above) and computation layer ("-lmkl_core" above). Chapter 5 in the User Guide in your doc directory goes into some detail about this.

-Todd

0 Kudos
carless
Beginner
924 Views
Thank you so much for your assistance. The point is that I just saw that the Fortran 90 interface, which I need, had to be built by hand, and I just tryied it with no success however. To use the library that you suggest I should be able to build the em64t Fortran 90 interface, but maybe there is a bug in the software, since it gives me an error. If you would be so kind to read my next contribution to the forum it would certainly be a great help, I explain the problem there. Best, Carles



0 Kudos
Reply