[Ipopt] Building Ipopt Matlab Interface (Win, 64 bit)

Dino Hüllmann hdino at student.ethz.ch
Wed Mar 6 08:20:23 EST 2013


Hi,

I'd like to write a tutorial for using Ipopt from a 64 bit Matlab.

Though, I encounter the following error when trying to build the 64 bit 
Matlab Interface:

matlabexception.o:matlabexception.cpp:(.text+0x91): undefined reference 
to `Ipopt::Snprintf(char*, long, char const*, ...)'
matlabexception.o:matlabexception.cpp:(.text+0x195): undefined reference 
to `Ipopt::Snprintf(char*, long, char const*, ...)'
matlabexception.o:matlabexception.cpp:(.text+0x22d): undefined reference 
to `Ipopt::Snprintf(char*, long, char const*, ...)'
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/ld.exe: 
matlabexception.o: bad reloc address 0x0 in section 
`.pdata$_ZNK15MatlabException4whatEv'
collect2.exe: error: ld returned 1 exit status
link command: g++ -shared 
C:\MinGW64\msys\home\Dino\trunk\Ipopt\contrib\MATLAB~1\gnumex\libdef\mex.def 
-o ipopt.mexw64 
-LC:\MinGW64\msys\home\Dino\trunk\Ipopt\contrib\MATLAB~1\gnumex\libdef 
-s matlabexception.o matlabfunctionhandle.o matlabjournal.o iterate.o 
ipoptoptions.o options.o sparsematrix.o callbackfunctions.o matlabinfo.o 
matlabprogram.o ipopt.o 
C:\MinGW64\msys\home\Dino\trunk\build\lib\libipopt.lib 
C:\MinGW64\msys\home\Dino\trunk\build\lib\libcoinmumps.lib 
C:\mingw64\lib\gcc\x86_64-w64-mingw32\4.7.1\libgfortran.lib [all the 
other libs] C:\mingw64\lib\gcc\x86_64-w64-mingw32\4.7.1\libm.lib -static 
-llibmx -llibmex -llibmat

   C:\PROGRA~1\MATLAB\R2012A\BIN\MEX.PL: Error: Link of 'ipopt.mexw64' 
failed.

The system setup is as follows:
Windows 7 64 bit
MATLAB R2012a 64 bit
TDM GCC 64 (gcc, g++, gfortran 4.7.1)
Ipopt trunk from svn

The Ipopt libs were build successfully using
../configure ADD_FFLAGS="-static-libgcc" CDEFS="-DWITHOUT_PTHREAD=1"
make
make install

Then I ran
make gnumex
duplicated all necessary libraries, renamed their file extension to .lib 
(is there a better way?) and
make


Thanks and kind regards
Dino



More information about the Ipopt mailing list