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

Post here if you have a question about linking your program with LAPACK or ScaLAPACK library

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

Postby reakwang » Mon Mar 31, 2014 4:40 am

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!
reakwang
 
Posts: 1
Joined: Mon Mar 31, 2014 4:11 am

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

Postby admin » Tue Apr 01, 2014 11:31 pm

Seems that he does not find the LAPACK routines.
Did you try to add liblapack.a to your mex compile command line?
admin
Site Admin
 
Posts: 512
Joined: Wed Dec 08, 2004 7:07 pm


Return to Linking Problem

Who is online

Users browsing this forum: No registered users and 1 guest