Page 1 of 1

Levenberg Marquardt

Posted: July 5th, 2007, 6:52 am
by soulman
I am trying to use following Levmar library on a windows XP system for constrained case optimization and therefore need to rely on LAPACK:http://www.ics.forth.gr/~lourakis/levmar/It seelms there is a problem with the LAPACK library. I have downloaded CLAPACK and built following library http://www.netlib.org/clapack/CLAPACK3-Windows.zip I get following error messages when building levmar : Generating Code... lib /nologo /out:levmar.lib lm.obj Axb.obj misc.obj lmlec.obj lmbc.obj cl /nologo /DHAVE_LAPACK /I. /MD /W3 /GX /O2 /c lmdemo.ccl : Command line warning D9035 : option 'GX' has been deprecated and will be removed in a future releasecl : Command line warning D9036 : use 'EHsc' instead of 'GX'lmdemo.c cl /nologo lmdemo.obj /link /subsystem:console /opt:ref /libpath:C:\src\lib\LAPACK /libpath:. /out:lmdemo.exe clapack.lib blas.lib libF77.lib libI77.lib levmar.liblevmar.lib(misc.obj) : error LNK2019: unresolved external symbol _sgemm_ referenced in function _strans_mat_mat_multlevmar.lib(misc.obj) : error LNK2019: unresolved external symbol _dgemm_ referenced in function _dtrans_mat_mat_multlmdemo.exe : fatal error LNK1120: 2 unresolved externalsNMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\cl.EXE"' : return code '0x2'Stop. I get the same error message when I build CLAPACK myself or use the precompiled (existing) library. I have checked and both functions sgemm and dgemm are existing in CLAPACK. I spent a week on this issue and still cannot resolve it. Did anyone get this levmar working in windows for the constrained case as the unconstrained seems to work fine?

Levenberg Marquardt

Posted: July 5th, 2007, 6:53 am
by soulman
I forgot to mention that I am building it in Visual Studio 2005

Levenberg Marquardt

Posted: July 5th, 2007, 8:10 am
by soulman
Finally found it! If you want to get it working under windows for the constrained case you need to do following (at least it worked for me):copy blaswrap.h from the CLAPACK into the folder where LEVMAR is extracted. open misc_core.c in LEVMAR and add in the beginning of the file#include "blaswrap.h" . This is required since there are different naming conventions for the functions used between fortran and C.Hope this helps if anyone has the same problem.

Levenberg Marquardt

Posted: July 6th, 2007, 6:10 am
by newbanker
This is certainly a self containted thread... :-)Thanks for the useful information.

Levenberg Marquardt

Posted: January 6th, 2008, 10:48 pm
by Zoran
Thank you, soulman, your LEVMAR text was very helpfull to me.Zoran