[Ipopt] IPOPT on Mac OSX 10.6 with MATLAB R2011b
Marco Rozgic
marco.rozgic at hsu-hh.de
Tue Feb 7 02:26:53 EST 2012
Hello everybody.
I sorted out some compiler issues right now I am using the same setup as
the installation guide by Ray Zimmerman. I also think that I use the
same machine settings. The MATLAB version I use is R2011b, gcc -v gives
gcc -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure
--disable-checking --enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib
--build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10-
--host=x86_64-apple-darwin10 --target=i686-apple-darwin10
--with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
gofortran -v gives
gfortran -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /Builds/apple/gcc-5664/build/obj/src/configure
--disable-checking --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++,fortran
--program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib
--build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10-
--host=x86_64-apple-darwin10 --target=i686-apple-darwin10
--with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5664)
To compile IPOPT I use the following configure command:
../configure --with-blas="-framework vecLib"
--with-lapack="-framework vecLib" F77=gfortran
FFLAGS="-fexceptions -m64 -fbackslash" CFLAGS="-fno-common
-no-cpp-precomp -fexceptions -arch x86_64 -m64"
CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64
-m64" -disable-shared
Configure runs, as well as make; make test; make install (all tests
pass). Running the examples (cpp, c) also gives no errors. I change the
files ~/.matlab/R2011b/mexopts.sh and
build64/Ipopt/contrib/MatlabInterface/src/Makefile according to the
installation guide. Typing make in the MATLAB interface folder gives:
-> mexopts.sh sourced from directory (DIR = $PREF_DIR)
FILE = /Users/marcorozgic/.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/usr/lib/gcc/i686-apple-darwin10/4.2.1/x86_64 -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/marcorozgic/Documents/HSU/Optimierung/Ipopt-3.10.1/build64/lib
-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
-lipopt -lm -ldl -lcoinhsl -lgfortranbegin -lgfortran -lSystem -lcoinmetis
-> LDCXX =
-> Link flags:
LDCXXFLAGS =
LDCXXDEBUGFLAGS =
LDCXXOPTIMFLAGS =
LDCXXEXTENSION =
arguments =
-L/Users/marcorozgic/Documents/HSU/Optimierung/Ipopt-3.10.1/build64/lib
-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
-lipopt -lm -ldl -lcoinhsl -lgfortranbegin -lgfortran -lSystem -lcoinmetis
----------------------------------------------------------------
-> 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/marcorozgic/Documents/HSU/Optimierung/Ipopt-3.10.1/build64/lib
-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
-lipopt -lm -ldl -lcoinhsl -lgfortranbegin -lgfortran -lSystem
-lcoinmetis -L/Applications/MATLAB_R2011b.app/bin/maci64 -lmx -lmex
-lmat -lstdc++
Fatou:src marcorozgic$ cp ipopt.mexmaci64 ~/Documents/MATLAB/
This is why I assume that this worked. After doing this I want to try if
IPOPT works in MATLAB. For this purpose I try running examplelasso in in
/contrib/MatlabInterface/examples. As soon as I arrive the line
[x info] = ipopt(x0,funcs,options);
MATLAB crashes without further error messages. Does anybody has any
suggestion what to try next?
Best,
Marco Rozgic
More information about the Ipopt
mailing list