Rank: 4661 based on 18 downloads (last 30 days) and 1 file submitted
photo

Arne Vagren

E-mail

Personal Profile:

 

Watch this Author's files

 

Files Posted by Arne Vagren
Updated   File Tags Downloads
(last 30 days)
Comments Rating
19 Dec 2011 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren 1norm, lbfgs, mex, optimization, quasinewton, unconstrained minimiz... 18 6
  • 5.0
5.0 | 1 rating
Comments and Ratings by Arne Vagren View all
Updated File Comments Rating
19 Jan 2012 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren

Thanks Christian,

that's good to know!

By the way, did you see any performance gains when enabling SSE?

19 Dec 2011 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren

Thanks xu!

I tried to answer your question but apparently that response failed to be published. Anyway, I believe that the problems you have with Linux is due to the fact that you're using a version of gcc which is not supported in your verion of Matlab. If you install a supported compiler it should work (you can probably modify your mexopts.sh file such that GLIBCXX etc. is found, but that's less straightforward I guess)

Regards
Arne

19 Dec 2011 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren

To those that commented on this submission previously, I should perhaps say that I accidently deleted the submission and hence all the comments. I particularly regret deleting the commment where it got 5 stars :)

Comments and Ratings on Arne Vagren's Files View all
Updated File Comment by Comments Rating
23 Jan 2013 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren Dan Scholnik

There a small bug in the mex file on the linux 64 platform. The return value "ret" from liblbfgs is a signed integer, but in lbfgs_.c it is defined as mwSize, which is apparently unsigned. So the return values get hosed. I changed ret to be an int and it worked fine.

19 Jan 2012 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren Arne Vagren

Thanks Christian,

that's good to know!

By the way, did you see any performance gains when enabling SSE?

16 Jan 2012 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren Christian Kothe

Compiling this on a more or less vanilla Linux GCC setup through mex brought up a couple of issues for me:

* lbfgs_.c uses C++-style "//" comments, which gets the compiler enraged (I changed these to C-style)

* on non-MSVC platforms you'd need to also define HAVE_XMMINTRIN_H and HAVE_EMMINTRIN_H to get SSE to work (otherwise the relevant headers are not included by liblbfgs)

* liblbfgs uses the "inline" keyword which is not defined on my OS (while __inline is). I added the following to each of the arithmetic_*.h files:

#ifndef inline
#ifdef __inline
#define inline __inline
#else
#define inline
#endif
#endif

I think the latter 2 issues come up because liblbfgs relies on the automake / config.h mechanism to define the relevant macros/identifiers.

The following mex line then compiles it for me:

mex -DHAVE_EMMINTRIN_H -DHAVE_XMMINTRIN_H -DUSE_SSE -I"liblbfgs-1.10/include" -largeArrayDims lbfgs_.c liblbfgs-1.10/lib/lbfgs.c

19 Dec 2011 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren Arne Vagren

Thanks xu!

I tried to answer your question but apparently that response failed to be published. Anyway, I believe that the problems you have with Linux is due to the fact that you're using a version of gcc which is not supported in your verion of Matlab. If you install a supported compiler it should work (you can probably modify your mexopts.sh file such that GLIBCXX etc. is found, but that's less straightforward I guess)

Regards
Arne

19 Dec 2011 Interface to a LBFGS solver Matlab interface to a LBFGS-code for solving unconstrained minimization problems. Author: Arne Vagren xu

Contact us