Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Create mex file from levmar.c

Subject: Create mex file from levmar.c

From: Toan Cao

Date: 5 May, 2014 21:37:12

Message: 1 of 1

Hello everyone,

I would like to use Levmar package (code C for Levenberg-Marquardt algorithm) in Matlab. But i can not create a mex file from the file levmar.c in this package.
I follow the guide in this package for creating mex file (after finishing to choose complier for mex file):
----------------------------------------------------------------------------
mex -DHAVE_LAPACK -I.. -O -L<levmar library dir> -L<blas/lapack libraries dir> levmar.c -llevmar -lclapack -lblas -lf2c
----------------------------------------------------------------------------
My compiler is Microsoft Visual C++ 2008.
The compiling process always has errors, like this:
----------------------------------------------------------------------------
MEX could not find the library "levmar" specified with -l option.
MEX looked for a file with one of the names:
       levmar.lib
       liblevmar.lib
.....
----------------------------------------------------------------------------
1) How can i have the file levmar.lib?
2) For clapack.lib, blas.lib, f2c.lib, althouth i already direct to directory of these libraries (download from http://www.netlib.org/clapack/), the same errors also happen. How to solve these errors?

If you have used this package in Matlab, please share for me the experience what is main reason i encounter these errors .
Thank you very much

Toan

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us