[Ipopt] Matlab Interface Crash

Ray Zimmerman rz10 at cornell.edu
Tue Jan 10 09:23:21 EST 2012


Hi Siddarth,

It looks like you have deleted all of the gfortran related stuff from the LIBS line. Based on your original LIBS line, here's what I think your new LIBS line should look like.

LIBS = -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lipopt   -lcoinhsl -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64 -L/usr/lib/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1 -lgfortranbegin -lgfortran -lSystem -lcoinmetis -lm  -ldl

In my experience, if there is a problem with the compilation, it won't create the MEX file. Try deleting any existing ipopt.mexmaci64 file before attempting to run make.

Hope this helps,

-- 
Ray Zimmerman
Senior Research Associate
419A Warren Hall, Cornell University, Ithaca, NY 14853
phone: (607) 255-9645




On Jan 9, 2012, at 2:42 PM, Siddharth Goyal wrote:

> Hi,
> 
> I am trying to install ipopt and use it with matlab. I have used the instructions mentioned on following webpage.
> https://projects.coin-or.org/Ipopt/wiki/Ipopt_on_Mac_OS_X
> 
> I have used snow leopard,HSL MA 57,native OS X  with 64 bit matlab 2011.
> When I run the given examples in ipopt, matlab crashes. I suppose it is because of mex file.
> Let me give you more details about the makefile in src folder.
> 
> Originally LIBS line in the makefile had 
> LIBS = -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lipopt  -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinhsl -framework vecLib -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64 -L/usr/lib/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/../../.. -lgfortranbegin -lgfortran -lSystem  -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinmetis  -framework vecLib -framework vecLib -lm  -ldl
> 
> I changed it to 
> LIBS = -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lipopt  -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinhsl  -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinmetis -lm  -ldl
> 
> 
> when I make the file, the result on the terminal is 
> 
> -> mexopts.sh sourced from directory (DIR = $PREF_DIR)
>    FILE = /Users/siddharthgoyal/.matlab/R2011b/mexopts.sh
> ----------------------------------------------------------------
> ->    MATLAB                = /Applications/MATLAB_R2011b.app
> ->    CC                    = g++
> ->    CC flags:
>          CFLAGS             = -fno-common -no-cpp-precomp -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5  -fexceptions
>          CDEBUGFLAGS        = -g
>          COPTIMFLAGS        = -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64   -DIPOPT_BUILD -DMATLAB_MEXFILE 
>          CLIBS              = -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
>          arguments          =  -DMX_COMPAT_32
> ->    CXX                   = g++
> ->    CXX flags:
>          CXXFLAGS           = -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.5
>          CXXDEBUGFLAGS      = -g
>          CXXOPTIMFLAGS      = -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64   -DIPOPT_BUILD -DMATLAB_MEXFILE 
>          CXXLIBS            = -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
>          arguments          =  -DMX_COMPAT_32
> ->    FC                    = gfortran
> ->    FC flags:
>          FFLAGS             = -fexceptions -m64 -fbackslash
>          FDEBUGFLAGS        = -g
>          FOPTIMFLAGS        = -O
>          FLIBS              = -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -L -lgfortran -L/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64 -lgfortranbegin
>          arguments          =  -DMX_COMPAT_32
> ->    LD                    = g++
> ->    Link flags:
>          LDFLAGS            = -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2011b.app/extern/lib/maci64/mexFunction.map -framework vecLib
>          LDDEBUGFLAGS       = -g
>          LDOPTIMFLAGS       = -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64   -DIPOPT_BUILD -DMATLAB_MEXFILE  
>          LDEXTENSION        = .mexmaci64
>          arguments          =  -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lipopt -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinhsl -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinmetis -lm -ldl
> ->    LDCXX                 = 
> ->    Link flags:
>          LDCXXFLAGS         = 
>          LDCXXDEBUGFLAGS    = 
>          LDCXXOPTIMFLAGS    = 
>          LDCXXEXTENSION     = 
>          arguments          =  -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lipopt -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinhsl -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinmetis -lm -ldl
> ----------------------------------------------------------------
> 
> -> g++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64   -DIPOPT_BUILD -DMATLAB_MEXFILE   -Wl,-twolevel_namespace -undefined error -arch x86_64 -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,/Applications/MATLAB_R2011b.app/extern/lib/maci64/mexFunction.map -framework vecLib -o  "ipopt.mexmaci64"   "matlabexception.o"  "matlabfunctionhandle.o"  "matlabjournal.o"  "iterate.o"  "ipoptoptions.o"  "options.o"  "sparsematrix.o"  "callbackfunctions.o"  "matlabinfo.o"  "matlabprogram.o"  "ipopt.o"  -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lipopt -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinhsl -L/Users/siddharthgoyal/Documents/build/Ipopt-3.10.1/build64/lib -lcoinmetis -lm -ldl -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex -lmat -lstdc++
> 
> 
> 
> 
> 
> 
> Please let me know if this is a successful compilation. If yes, why does the matlab crash. If not, how can it be fixed.
> 
> 
> Thanks
> Siddharth
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20120110/0db66531/attachment-0001.html>


More information about the Ipopt mailing list