[Ipopt] MATLAB Interface Debian

Marco Rozgic marco.rozgic at hsu-hh.de
Wed Apr 4 12:54:02 EDT 2012


Hello everybody,
After playing around with the IPOPT MATLAB interface for MAC OS X I 
turned my attention to compile it on a Linux Debian machine. Right now I 
encounter some strange problems. After compiling everything a file 
ipopt.mexa64 was created. I called MATLAB, add the correct path and ran 
a test problem (examplehs071). Below you will see the 'suggested' 
solution, which is the solution to every problem I tried. Furthermore I 
will provide the configure command I used. I have the feeling that there 
is something amiss with some pointers, why else should every x point to 
10^-300 or something like that...
I hope the information below can help you guys making suggestions. Any 
help is appreciated.
Best,
Marco

Configure:
../configure CXX='g++-4.3 -m64' CC='gcc-4.3 -m64' F77='gfortran-4.3 
-m64' ADD_CFLAGS="-D_GNU_SOURCE -fexceptions -fPIC 
-fno-omit-frame-pointer -pthread" ADD_CXXFLAGS="-D_GNU_SOURCE -fPIC 
-fno-omit-frame-pointer -pthread" ADD_FFLAGS="-fexceptions -fPIC 
-fno-omit-frame-pointer" --with-matlab-home='/usr/local/MATLAB/R2011b'


make ipopt.mexa64:
->    MATLAB                = /usr/local/MATLAB/R2011b
->    CC                    = g++-4.3 -m64
->    CC flags:
          CFLAGS             =   -fexceptions -fPIC 
-fno-omit-frame-pointer -pthread
          CDEBUGFLAGS        = -g
          COPTIMFLAGS        = -O3 -pipe -DNDEBUG -pedantic-errors 
-Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith 
-Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long 
-D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread  -DIPOPT_BUILD 
-DMATLAB_MEXFILE
          CLIBS              = 
-Wl,-rpath-link,/usr/local/MATLAB/R2011b/bin/glnxa64 
-L/usr/local/MATLAB/R2011b/bin/glnxa64 -lmx -lmex -lmat -lm -lstdc++
          arguments          =  -DMX_COMPAT_32
->    CXX                   = g++-4.3 -m64
->    CXX flags:
          CXXFLAGS           =  -fPIC -fexception 
-fno-omit-frame-pointer -pthread
          CXXDEBUGFLAGS      = -g
          CXXOPTIMFLAGS      = -O3 -pipe -DNDEBUG -pedantic-errors 
-Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith 
-Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long 
-D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread  -DIPOPT_BUILD 
-DMATLAB_MEXFILE
          CXXLIBS            = 
-Wl,-rpath-link,/usr/local/MATLAB/R2011b/bin/glnxa64 
-L/usr/local/MATLAB/R2011b/bin/glnxa64 -lmx -lmex -lmat -lm
          arguments          =  -DMX_COMPAT_32
->    FC                    = gfortran-4.3
->    FC flags:
          FFLAGS             = -fexceptions -fbackslash -fPIC 
-fno-omit-frame-pointer
          FDEBUGFLAGS        = -g
          FOPTIMFLAGS        = -O
          FLIBS              = 
-Wl,-rpath-link,/usr/local/MATLAB/R2011b/bin/glnxa64 
-L/usr/local/MATLAB/R2011b/bin/glnxa64 -lmx -lmex -lmat -lm
          arguments          =  -DMX_COMPAT_32
->    LD                    = g++-4.3 -m64
->    Link flags:
          LDFLAGS            = -pthread -shared 
-Wl,--version-script,/usr/local/MATLAB/R2011b/extern/lib/glnxa64/mexFunction.map 
-Wl,--no-undefined
          LDDEBUGFLAGS       = -g
          LDOPTIMFLAGS       = -O3 -pipe -DNDEBUG -pedantic-errors 
-Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith 
-Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long 
-D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread  -DIPOPT_BUILD 
-DMATLAB_MEXFILE   -Wl,--rpath -Wl,/home/rozgicm/Ipopt-3.10.1/build64/lib
          LDEXTENSION        = .mexa64
          arguments          =  -L/home/rozgicm/Ipopt-3.10.1/build64/lib 
-lipopt -L/home/rozgicm/Ipopt-3.10.1/build64/lib -lcoinhsl -lblas 
-L/usr/lib/gcc/x86_64-linux-gnu/4.3.5 
-L/usr/lib/gcc/x86_64-linux-gnu/4.3.5/../../../../lib -L/lib/../lib 
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.5/../../.. 
-lgfortranbegin -lgfortran -lm -lgcc_s 
-L/home/rozgicm/Ipopt-3.10.1/build64/lib -lcoinmetis -llapack -lblas -lm 
-ldl
->    LDCXX                 =
->    Link flags:
          LDCXXFLAGS         =
          LDCXXDEBUGFLAGS    =
          LDCXXOPTIMFLAGS    =
          LDCXXEXTENSION     =
          arguments          =  -L/home/rozgicm/Ipopt-3.10.1/build64/lib 
-lipopt -L/home/rozgicm/Ipopt-3.10.1/build64/lib -lcoinhsl -lblas 
-L/usr/lib/gcc/x86_64-linux-gnu/4.3.5 
-L/usr/lib/gcc/x86_64-linux-gnu/4.3.5/../../../../lib -L/lib/../lib 
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.5/../../.. 
-lgfortranbegin -lgfortran -lm -lgcc_s 
-L/home/rozgicm/Ipopt-3.10.1/build64/lib -lcoinmetis -llapack -lblas -lm 
-ldl
----------------------------------------------------------------

-> g++-4.3 -m64 -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses 
-Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings 
-Wconversion -Wno-unknown-pragmas -Wno-long-long -D_GNU_SOURCE -fPIC 
-fno-omit-frame-pointer -pthread  -DIPOPT_BUILD -DMATLAB_MEXFILE   
-Wl,--rpath -Wl,/home/rozgicm/Ipopt-3.10.1/build64/lib -pthread -shared 
-Wl,--version-script,/usr/local/MATLAB/R2011b/extern/lib/glnxa64/mexFunction.map 
-Wl,--no-undefined -o  "ipopt.mexa64"   "matlabexception.o"  
"matlabfunctionhandle.o"  "matlabjournal.o"  "iterate.o"  
"ipoptoptions.o"  "options.o"  "sparsematrix.o"  "callbackfunctions.o"  
"matlabinfo.o"  "matlabprogram.o"  "ipopt.o"  
-L/home/rozgicm/Ipopt-3.10.1/build64/lib -lipopt 
-L/home/rozgicm/Ipopt-3.10.1/build64/lib -lcoinhsl -lblas 
-L/usr/lib/gcc/x86_64-linux-gnu/4.3.5 
-L/usr/lib/gcc/x86_64-linux-gnu/4.3.5/../../../../lib -L/lib/../lib 
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.5/../../.. 
-lgfortranbegin -lgfortran -lm -lgcc_s 
-L/home/rozgicm/Ipopt-3.10.1/build64/lib -lcoinmetis -llapack -lblas -lm 
-ldl -Wl,-rpath-link,/usr/local/MATLAB/R2011b/bin/glnxa64 
-L/usr/local/MATLAB/R2011b/bin/glnxa64 -lmx -lmex -lmat -lm


MATLAB solution of examplehs071:

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear 
optimization.
  Ipopt is released as open source code under the Eclipse Public License 
(EPL).
          For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************

This is Ipopt version 3.10.1, running with linear solver ma57.

Number of nonzeros in equality constraint Jacobian...:        4
Number of nonzeros in inequality constraint Jacobian.:        4
Number of nonzeros in Lagrangian Hessian.............:       10

Total number of variables............................:        4
                      variables with only lower bounds:        0
                 variables with lower and upper bounds:        0
                      variables with only upper bounds:        0
Total number of equality constraints.................:        1
Total number of inequality constraints...............:        1
         inequality constraints with only lower bounds:        0
    inequality constraints with lower and upper bounds:        0
         inequality constraints with only upper bounds:        0

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du 
alpha_pr  ls
    0 6.9272290e-310 1.83e-322 2.62e-322   0.0 0.00e+00    -  0.00e+00 
0.00e+00   0

Number of Iterations....: 0

                                    (scaled)                 (unscaled)
Objective...............:  6.9272289987459229e-310   6.9272289987459229e-310
Dual infeasibility......:  2.6185479229586067e-322   2.6185479229586067e-322
Constraint violation....:  1.8280428896126122e-322   1.8280428896126122e-322
Complementarity.........:  2.6185479229586067e-322   2.6185479229586067e-322
Overall NLP error.......:  2.6185479229586067e-322   2.6185479229586067e-322


Number of objective function evaluations             = 1
Number of objective gradient evaluations             = 1
Number of equality constraint evaluations            = 1
Number of inequality constraint evaluations          = 2
Number of equality constraint Jacobian evaluations   = 1
Number of inequality constraint Jacobian evaluations = 1
Number of Lagrangian Hessian evaluations             = 0
Total CPU secs in IPOPT (w/o function evaluations)   =      0.020
Total CPU secs in NLP function evaluations           =      0.000

EXIT: Optimal Solution Found.

ans =

   1.0e-309 *

     0.6927    0.6927    0.6927    0.6927



More information about the Ipopt mailing list