Page 1 of 1

LAPACKE link error in Matlab mex function on Mac OSX10.9

PostPosted: Mon Mar 31, 2014 4:40 am
by reakwang
I'm new to LAPACK and I want to use the function LAPACKE_zheevd to calculate the eigen values of a Hermitian matrix. I successfully installed LAPACK and LAPACKE on the Mac OSX 10.9 system (64bit) with all the default Makefile. I tested the sample code in the web page of LAPACKE in C file and it's all fine. But when I try to call LAPACKE_zheevd in my Matlab mex function, there is a link error as shown below:

Undefined symbols for architecture x86_64:
"_zheevd_", referenced from:
_LAPACKE_zheevd_work in liblapacke.a(lapacke_zheevd_work.o)
(maybe you meant: _LAPACKE_zheevd_work)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

mex: link of ' "myeig.mexmaci64"' failed.


I use compile command:
mex -v myeig.c liblapacke.a
The Matlab software version is R2012b. The "lapacke.h" is included in the mex C file. The static libraries librefblas.a, liblapack.a, liblapacke.a and libtmglib.a are all in the same directory of mex C file. I've tried many times but still can't fix the problem. I don't know what to do now, and can anyone do me a favor to help ? Thank you!

Re: LAPACKE link error in Matlab mex function on Mac OSX10.9

PostPosted: Tue Apr 01, 2014 11:31 pm
by admin
Seems that he does not find the LAPACK routines.
Did you try to add liblapack.a to your mex compile command line?