Rank: 458989 based on 0 downloads (last 30 days) and 0 file submitted
photo

Daniel

E-mail
Company/University
College of William and Mary

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Daniel View all
Updated File Comments Rating
22 Oct 2014 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker

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".
This problem can be solved if you are using Windows 7 64bit. In the case of Windows 8.1 I could not get it to work as the dylib libraries from the cygwin fortran make use of some dll's that are no longer available in Windows 8.1

Daniel

21 Oct 2014 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker

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.

06 Jan 2014 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker

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.
The idea is the following:
1) install Openblas and add its lib folder to the $Path$ Environment variable.
2) install Cygwin64 (the Devel package)
3) make sure you have SDK 7.1 installed along with Visual Studio 10.0 (it's free) and all the updates for Win7.
4) add to the $Path$ environment variable "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64"
5) find and copy the x64 version of IESHIMS.dll into a folder added to $Path$ environment variable. (I know, this is counterintuitive and seems esoteric but if you don't it may not work) To check that this is needed one can use "Dependency Walker".
6) open the Cygwin64 terminal and go to the "lbfgsb3.0_mex1.2" folder and make sure the "Lbfgsb.3.0" subfolder with all its files is inside (if not download it).
7) Type (or creat a .sh script to run at once):
cd Lbfgsb.3.0
rm *.o
rm *.dll
rm *.lib
rm *.dll.a

x86_64-w64-mingw32-gfortran.exe -c -Wall -Wno-uninitialized lbfgsb.f linpack.f blas.f timer.f
echo EXPORTS > liblbfgsb.def
echo setulb_ >> liblbfgsb.def
echo _setulb_=setulb_ >> liblbfgsb.def

dlltool -D liblbfgsb.dll -d liblbfgsb.def -e liblbfgsb.o -l liblbfgsb.dll.a lbfgsb.o linpack.o blas.o timer.o
lib /def:liblbfgsb.def /machine:x64

x86_64-w64-mingw32-gfortran.exe -mdll -static-libgfortran -o liblbfgsb.dll liblbfgsb.o lbfgsb.o linpack.o timer.o blas.o

cp liblbfgsb.dll liblbfgsb.dll.a liblbfgsb.lib .
cp liblbfgsb.dll liblbfgsb.dll.a liblbfgsb.lib ..
cp /usr/x86_64-w64-mingw32/sys-root/mingw/bin/libgcc_s_seh-1.dll ..
cd ..

/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!

25 Sep 2013 LBFGSB (L-BFGS-B) mex wrapper Mex wrapper for lbfgsb v3.0 fortan library. L-bfgs-b solves box-constrained optimization. Author: Stephen Becker

Hi Roland,

Could you please post detailed instructions for how to compile the lbfgsb_wrapper in Windows 7 64bit?
I was only able to compile in Linux and Mac OS X so far . I also linked with the OpenBlas library which is very fast ( if you have a multi-core cpu).

Thank you very much.

Daniel

Contact us