Date  File  Comment by  Comment  Rating 

03 Mar 2015  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Daniel  It works ! Awesome ! 

23 Feb 2015  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  I just verified the new C version compiles on 64bit windows, so I have updated the description above to link to the new github code. I will no longer support this versinon of the code, but I will attempt to support the github version 

22 Feb 2015  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  I have a new version that is all in C and should compile MUCH easier, especially on Windows. Please let me know if you have comments. I haven't yet tried compiling on Windows so that may need some finetuning. See https://github.com/stephenbeckr/LBFGSBC 

12 Feb 2015  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Daniel  @Marcin, I think the wrapper works well in Yosemite (this is also my current OS I am using most). You have to make sure you have the updated Xcode and the fortran form http://hpc.sourceforge.net. Also install the OpenBlas libraries (you will find many guides online) After that, you open MATLAB and set up mex, i.e. mex setup C++ and mex setup FORTRAN. Make sure you have
After this, in MATLAB, type mex v c lbfgsb_wrapper.c largeArrayDims UDEBUG CFLAGS="\$CFLAGS O3" and then, mex v output lbfgsb_wrapper lbfgsb_wrapper.o Lbfgsb.3.0/lbfgsb.f Lbfgsb.3.0/linpack.f Lbfgsb.3.0/timer.f lm lopenblas Good luck ! 

02 Feb 2015  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Dan Scholnik  Luckily the fix should not measurably affect speed in the mostcommon case where x is not aliased to another variable. (I'm actually quite fond of writing inplace mex files myself, often to call LAPACK routines directly that matlab does not expose. But of course then I know to be careful. This one took a while to hunt down since it didn't occur to me for a while.) 

01 Feb 2015  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  @Dan, good observation and I will include the fix when I next update. For now, the code is true to it's C/Fortran style origins where this practice was commonplace, as it's more efficient for largescale problems. (Back when you told LAPACK how much extra memory you could afford, and saving the entire history of variables was only possible for tiny problems). 

01 Feb 2015  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Dan Scholnik  The inplace modification of the current iterate x can cause some nasty hairpulling bugs. If (for example) one is saving x off in a global variable within the objective function, then due to Matlab's copyonwrite optimization the global version will be silently changed as well since Matlab is not aware of the inplace changes. This can be avoided by adding the line extern bool mxUnshareArray(mxArray *array_ptr, bool noDeepCopy); at the top of lbfgsb_wrapper.c to declare the undocumented mxUnshareArray function, and then adding the line mxUnshareArray((mxArray *)prhs[N_x], true); at the top of mexFunction() before x is overwritten. This forces matlab to perform any delayed copies. Here's a good link with more info: http://undocumentedmatlab.com/blog/matlabmexinplaceediting 

06 Jan 2015  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  @v, I'm sorry but I can't really give you the help you need to install the 64bit windows version. 

01 Jan 2015  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Marcin  I'm having a hard time compiling this for Max OS X Yosemite. I have MATLAB R2014b. When I run the 'compile_ex' script, I'm getting the following: Error using mex
Following the advice I was able to find, I then tried: mex v c lbfgsb_wrapper.c largeArrayDims UDEBUG CFLAGS="\$CFLAGS O3" ; which runs ok, and then: mex v output lbfgsb_wrapper lbfgsb_wrapper.o Lbfgsb.3.0/lbfgsb.f Lbfgsb.3.0/linpack.f Lbfgsb.3.0/timer.f FC="gfortran" lm lmwblascompat32 LINKEXPORT='Wl,versionscript,/usr/local/MATLAB/R2014a/extern/lib/glnxa64/mexFunction.map' which fails: Error using mex
Can anyone help? 

30 Dec 2014  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  fatemeh nj  I just have a bit problem, I receive this warning and my audio signal has not been recovered well, my warning is:
I also increase the number of 'K' but at the end the error was repeated! my first question is that I know the k determined sparsity but how can i know the sparsity of unknown signal? second question, could you also mention which paper you use for writing omp function? 

20 Dec 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  v  compiled the 64bit version  when it ran the tests in compile_mex_forWindows.m, it caused an internal error crashing matlab. The crash happens in lbfgsb_wrapper.c at the point it calls setulb 

22 Oct 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Daniel  Hi Thomas, Please download (it's free) the Dependency Walker 64 program and use it to analyze the mex file you created. Dependency Walker will tell you what dll's are missing and causing the "Attempt to access invalid address".
Daniel 

21 Oct 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Thomas Humphries  So I was happily using this code on my 32bit workstation and now am enjoying trying to get it to work on my 64bit laptop... I have followed Daniel's instructions below and have managed to get the .mexw64 file to compile, but when I try to run the example I get Invalid MEXfile 'C:\Users\...\lbfgsb.3.0_1.2\lbfgsb_wrapper.mexw64': Attempt to access invalid address. Error in lbfgsb (line 179)
Error in example_NNLS (line 100)
Probably a longshot, but does anyone have any suggestion what could be causing this? I am guessing some kind of library linking issue but nothing comes up during the compilation process... TH 

21 Oct 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Daniel  Hi Lucas, Sorry for my late reply, I haven't checked the posts in a while. I think the problem you describe is quite simple, namely you have to add in the PATH variable in Windows the path to the "lib" command from the Visual Studio folder. 

13 Oct 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Alexandre  I have received a couple of email asking me how to compile. Here how I proceeds in 2 steps on Linux (Mint 17 distro) mex v c lbfgsb_wrapper.c largeArrayDims UDEBUG CFLAGS="\$CFLAGS O3" ;
It is a colleague of mine who found out how to compile, therefore I am afraid I cannot explain why it works. 

12 Oct 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  wenbin  I have the same problem as Alexandre. When I try to compile it under Linux with matlab R2014a, I get the following error:
Error in compile_mex (line 61)
Anyone had meet this problem? Please kindly show me the solution, I'm really in trouble. 

15 Jul 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Alexandre  Problem sloved. It seems that Matlab R2014a does not allow to compile Fortran and C in a single MEX call. I believe that it allowed to link the files automatically. I had to compile the Fortran code to .o objects and link them to the .c files manually. 

15 Jul 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Alexandre  Hi Stephen, I managed to compile the Fortran part by splitting into 2 MEX calls: mex Lbfgsb.3.0/lbfgsb.f Lbfgsb.3.0/linpack.f Lbfgsb.3.0/timer.f lm lmwblas CFLAGS="\$CFLAGS O3"FC="gfortran" mex v lbfgsb_wrapper.c largeArrayDims UDEBUG ; The Fortran part is fine, but not the C compilation. I get the following error message: Error using mex
I have tried to play with the DNOUNDERSCORE UUPPERCASE_FORTRAN flags but none of them seem to help. How can I fix this issue? Thank you very much 

03 Jul 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  Hi Alexandre,


03 Jul 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Alexandre  I have tried to compile it under Linux Mint 17, with Matlab 2014a. I got the following error message: Error using mex
Error in compile_mex (line 61)
I've tried to find out about this error but it is nowhere to be found, as if it is an issue related to Matlab 2014 only. Any suggestion?


05 May 2014  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  Yang  Thanks for this source code 

17 Apr 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Lucas  Hi everyone, As I'm trying to compile the mex file on a W7 x64 with Matlab R2013a, I follow the tutorial of Daniel, and I would need some specification (thanks by the way for sharing this) :
I tried to run the compilation anyway, and it gives me this :
$ mex.bat O largeArrayDims UDEBUG lbfgsb_wrapper.c liblbfgsb.lib lmex lmx lopenblas C:\PROGRA~1\MATLAB\R2013A\BIN\MEX.PL: Error: 'lbfgsb_wrapper.c' not found.
I'm not a great expert on bash's command, and I can't figure out what's the real problem behind these. LS 

09 Apr 2014  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  TDJIO  Thanks for sharing! 

08 Apr 2014  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  sheng  Thank you very much for your share. 

06 Jan 2014  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Daniel  Hi, I succeded to compile and test the mex module for Windows 7 x64 (Sp1) linking with the multithreded OpenBlas. In this way one can take advantage of the multicore architecture of the available CPU. For the Windows operating system the process is rather convoluted and delicate (one can easily get into the so called "dll hell" problem). The solution is indeed based on creating a dll file. I got it working following a script from Roland, so many thanks to him who pioneered a way to compile using Cygwin and gracefully shared his own script.
x86_64w64mingw32gfortran.exe c Wall Wnouninitialized lbfgsb.f linpack.f blas.f timer.f
dlltool D liblbfgsb.dll d liblbfgsb.def e liblbfgsb.o l liblbfgsb.dll.a lbfgsb.o linpack.o blas.o timer.o
x86_64w64mingw32gfortran.exe mdll staticlibgfortran o liblbfgsb.dll liblbfgsb.o lbfgsb.o linpack.o timer.o blas.o cp liblbfgsb.dll liblbfgsb.dll.a liblbfgsb.lib .
/cygdrive/c/Progra~1/MATLAB/R2013b/bin/mex.bat O largeArrayDims UDEBUG lbfgsb_wrapper.c liblbfgsb.lib lmex lmx lopenblas 8) Test example_NNLS.m Good Luck!


27 Nov 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Robert  Dear Chenchen Tong, I got the same error, when running compile_mex.m on Ubuntu 12.04, gcc4.6 and MATLAB R2013a: === lbfgsb "driver1" test problem, 2D ===
For me the problem was solved by running MATLAB with LD_PRELOAD and LD_LIBRARY_PATH, pointing to the system libraries: LD_PRELOAD=/usr/lib/x86_64linuxgnu/libgfortran.so.3 LD_LIBRARY_PATH=/usr/lib/x86_64linuxgnu matlab 

29 Oct 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Ryan Muir  
25 Sep 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Daniel  Hi Roland, Could you please post detailed instructions for how to compile the lbfgsb_wrapper in Windows 7 64bit?
Thank you very much. Daniel 

06 Sep 2013  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  Jason  How to estimate sparsity? Works great if I know the sparse size exactly (by creating test data, for example), otherwise not such a great improvement over least squares (for my particular problem). 

06 Sep 2013  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  Jason  
05 Aug 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  Hi Roland,
You're right about the typo in the nrhs. I'll fix that in the next update. Right now, the gradient is necessary. The Python and R versions use large packages to get around this. They might have a finitedifferences gradient approximation mode, but I suspect they are really doing automatic differentiation (the good news is that this is the exact gradient, no approximation. The bad news is that it can be sometimes slow). There are automatic differentiation packages for Matlab, but none that seem to be very "mature". So you could try some of those, but if you can work out an explicit function to compute the gradient, that is usually the simplest (no automatic differentiation packages to get working) and the fastest for computation.


30 Jul 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Roland  I finally managed to run it on Win7 64 with mingw fortran and msvc c compilers. Stephan, is it necessary to give the gradient in any case? I know that the Python and R versions can use numerical approximations to the gradient. Do you know of a function that does that for me? 

29 Jul 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Roland  Thanks Steven, I'm still trying to get this to work. At the moment I got it compiled but it crashes when I run it with no expressive error messages. Still debugging... but on a different not, in line 266: if (nrhs < N_g1 ) { shouldn't it read "nrhs < N_g+1", so a "+" instead of ""? Cheers 

24 Jul 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  Hi Roland,


24 Jul 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Roland  Dear Stephen, Thanks for all your efforts. I would love to use your script but it doesn't compile. I have Matlab R2012b on Win 7 64bit. I use the compile_for_windows script and get the following error: >>>>>>>>>>>>>>>>>>>> >> compile_mex_forWindows
Error in compile_mex_forWindows (line 116)
<<<<<<<<<<<<<<<<<<<<<<<<< Any suggestions how to fix that would be very much appreciated. Thanks, Roland 

23 Jul 2013  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  Stephen Becker  Israa, I'm not exactly sure what you want to do, but if you wish to work with 2D images, then use vectorize (e.g. use vec = @(x) x(:) ) and reshape operators, so that the code only sees vectors. If done right, it will work just fine. Hope that helps a bit.


23 Jul 2013  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  israa tawfic  can i use this source code with an image, 

30 Jun 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  Hi Xin,


24 Jun 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  xin yu  Hi, Stephen


08 Jun 2013  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  Stephen Becker  Robin, that's a typo. It's an unimportant default value that doesn't affect the code, so I will change it the next time I have a major update. 

07 Jun 2013  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  Robin Longstride  Why do you use round with 2 nargin in CoSaMP line 97? It doesn't work. Thanks for this source code. 

13 May 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  I'm not sure what's going on. It's odd that it compiles if it can't find the symbol. It could be an issue with a runtime library. On linux, I had the option of using either g95 or gfortran, and I use g95, so maybe try that if it's easy on the mac. Otherwise, I'm afraid I can't be of much help. You could also try following the basic ideas outline in the compile_mex_forWindows (i.e. convert fortran to C). Best of luck! 

13 May 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Tim  My apologies for the numerous replies. I had to manually update dcopy dscal and daxpy as you suggested. The mex file is generated ("lbfgsb_wrapper.mexmaci64") but it crashes matlab. The error report says: "I should have added that the error report listed "Symbol not found: __gfortran_transfer_real_write"" 

13 May 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Tim  I should have added that the error report listed "Symbol not found: __gfortran_transfer_real_write" 

13 May 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  Hi Tim,
If you verify that the ddot/dcopy/dscal/daxpy are replaced with their ddot32/dcopy32/dscal32/daxpy32 and it still fails, then we have a different problem on our hands. Try compiling with v and let me know the output. 

13 May 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Tim  Hi,
I get the error "script failed, try running script by hand perhaps?," though the files are still generated with ddot32 replacing dot. It does not, however, compile when using the subsequent mex command ("can't find "_daxpy_" etc). It did compile using the previous, commented out mex command using lmwblas, and generated a mexmaci64 file. If I try running the example code calling lfbgs, Matlab crashes. The libblas version is 10.2.3 for R2010b. If you could offer any solutions I would be grateful, 

17 Apr 2013  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  Bo  Hi,


16 Apr 2013  CoSaMP and OMP for sparse recovery Orthogonal Matching Pursuit (OMP) and Compressive Sampling Matched Pursuit (CoSaMP).  Bo  Hi Stephan, It seems your functions can only accept A which is square matrix? Do I miss anything or this function will not work for overcomplete frames? Thank you!


14 Feb 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Stephen Becker  Hi Xunkai, I can't help much because I don't have access to Intel's compiler. But if you adapt the gfortran lines to work with the intel fortran compiler, then the rest of the compilation (the C code) should be similar. 

13 Feb 2013  LBFGSB (LBFGSB) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. Lbfgsb solves boxconstrained optimization.  Xunkai Wei  Win 7, 64bit system, I have intel fortran compiler and vs 2012 C++ compiler, could you show me how to compile the source code ? 
