[Ipopt] MinGW problems
hans.pirnay at rwth-aachen.de
Mon Nov 29 15:53:15 EST 2010
Hi Rodrigo, Jens,
thanks for all your help. I finally got it to work.
I am on windows 7, but that doesn't really seem to change anything. The mex
file I compiled on 7 works on XP just as well. Here's what I did:
- got the current mingw + msys using the automated installer, installing
everything but the objective c and ada compilers.
- followed the steps on the website, configure using the same options as
configure, make, make test, make install all worked flawlessly. The problems
started with gnumex.
1. I am using Matlab 7.11, so I had to use the new gnumex 2.03 which fixes a
bug in Matlab 7.11's mex.pl file
2. I changed the mexopts.bat file according to Rodrigo's suggestions. The
problem I ran into was that all the .a libraries were not found, because the
compiler only looked for .lib files. I got around this problem by creating
symbolic links of the form *.lib to all the necessary *.a files
With these changes, it compiled without problems
Since "ipopt matlab windows" seems to be a very popular google search term,
I was wondering if there exist any copyright/legal objections against
posting the compiled ipopt mex file (with MUMPS) and all the necessary files
to run it somewhere online?
On Mon, Nov 29, 2010 at 2:40 AM, Rodrigo Lopez-Negrete <
r.lopez.negrete at gmail.com> wrote:
> Hi Hans and Jens,
> I just tried compiling the matlab interface again. I was able to do it
> following *some* of my instructions on the Ipopt website. Here's what I did.
> I used a clean install of MinGW/Msys with the newest available installer
> from the MinGW website (mingw-get-inst-20101030.exe). I'm using Windows XP
> and the compilers that come with the MinGW download:
> $ gcc -v
> Using built-in specs.
> Target: mingw32
> Configured with: ../gcc-4.5.0/configure
> --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions
> --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry
> --enable-libstdcxx-debug --enable-version-specific-runtime-libs
> --disable-werror --build=mingw32 --prefix=/mingw
> Thread model: win32
> gcc version 4.5.0 (GCC)
> I configured Ipopt using
> $ ../configure -C --enable-doscompile --enable-static --disable-shared
> ADD_CXXFLAGS="-fexceptions" ADD_CFLAGS="-fexceptions" ADD_FFLAGS="-fexceptions"
> Make the ipopt library. All tests passed for me.
> Then I generated the mexopts.bat file using gnumex. This file I copied to
> the $IPOPT/build/Ipopt/contrib/MatlabInterface/src folder, and I modified it
> as follows:
> set GM_MEXLANG=cxx
> set GM_ADD_LIBS= -llibmx -llibmex -llibmat
> -Lc:/MinGW/msys/uno/home/testnew/Ipopt/build/lib/coin/ThirdParty -lipopt
> -lcoinhsl -lcoinmetis -lcoinmumps -lcoinlapack -lcoinblas -Lc:/MinGW/lib
> -LC:/MinGW/lib -Lc:/mingw/bin/../lib/gcc/mingw32/4.5.0
> -Lc:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../.. -L/mingw/lib -lgfortran
> -lmingw32 -lgcc_s -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32
> -ladvapi32 -lshell32 -lpthread -lm
> set COMPILER=g++
> The makefile I setup like this (as per my Matlab installation)
> 1. MATLAB_HOME = /c/PROGRA~1/MATLAB/R2009a/
> 2. MEXSUFFIX = mexw32
> 3. MEX = $(MATLAB_HOME)/sys/perl/win32/bin/perl.exe $(MATLAB_HOME)/bin/
> 4. remove the -cxx flag from MEXFLAGS
> When doing make for the Matlab interface it complains about not finding the
> 'm' library, however it compiles and generates the ipopt.mexw32 file. I
> tested it with the examples, and it worked.
> I hope this helps. If you try this and it works, let me know. I may update
> the Ipopt website.
> On Thu, Nov 25, 2010 at 4:01 AM, Jens Schubert <
> jens.schubert.1 at googlemail.com> wrote:
>> Hi Hans,
>> > I used tdm-gcc-4.3.2 as described in the compulation hints.
>> I just checked the mingw home page. I found that the documentation was
>> updated since I had read it last time. However, go to
>> and scroll down to 'Manual Installations'. Follow all the instructions
>> - this will need some time. I checked a few links, for me it looks
>> like they point all to the gcc4.5 version. So here you will get all
>> the necessary packages.
>> Then, after you updated to the newest version of gcc, try to use it.
>> In my gcc-version (4.5.0-1) the compiler did not yet work fully
>> correctly, that is why one had to set the linker-option ( I found this
>> in the release notes). [I just see that this version is the same as
>> the version suggested on the mingw page.]
>> >> For me it works with gcc4.5.0 and using the linkeroption
>> >> '--enable-runtime-pseudo-reloc-v2' durch '--enable-auto-import'.
>> > I'm not sure what exactly you mean - can you clarify where I need to
>> > specify which of these options?
>> Well, this depends on your environment. I work in the 'msys'-shell as
>> suggested on the mingw home page. If gcc is called,
>> (a) either directly by typing on the msys command-prompt,
>> (b) or by a make-tool
>> (c) or by some other program
>> there is always a way to set the compiler options. In my case (b) I
>> just put it as an option behind the gcc-comand in the makefile.
>> > Can you tell me why you chose these
>> > options?
>> See above: I found it in the release notes.
>> The (nearly) complete list of all options may be found in the gcc manual.
>> But the list is too long for just reading it, you need to use the list
>> as reference for looking up unknown things.
>> Good luck
>> Jens Schubert
>> > Thanks for your help!
>> > Hans
>> >> Hope it helps
>> >> Jens
>> >> 2010/11/24 Hans Pirnay <hans.pirnay at rwth-aachen.de>:
>> >>> Hi everyone,
>> >>> I am trying to compile Ipopt for Windows so I might finally be able to
>> >>> use it for Matlab, but I ran into problems using Rodrigo's guide on
>> >>> https://projects.coin-or.org/Ipopt/wiki/CompilationHints
>> >>> I set up a MinGW system, and successfully ran configure and make with
>> >>> the same options Rodrigo used. However, any executables I create (all
>> >>> examples, as well as running make test) compile fine, but fail at
>> >>> runtime with the usual
>> >>> "hs071_cpp.exe has encountered a problem and needs to close. --- Send
>> >>> Error Report / Don't Send" - window.
>> >>> I tried to compile a simple helloworld program just to check if any
>> >>> code compiled on MinGW fails, but that worked fine.
>> >>> Has anyone encountered and overcome this problem before? Any help is
>> >>> appreciated!
>> >>> thanks
>> >>> Hans
>> >>> _______________________________________________
>> >>> Ipopt mailing list
>> >>> Ipopt at list.coin-or.org
>> >>> http://list.coin-or.org/mailman/listinfo/ipopt
>> Ipopt mailing list
>> Ipopt at list.coin-or.org
> *Rodrigo López-Negrete de la Fuente*
> Doctoral Candidate
> Email: rln at cmu.edu
> WWW: http://rodrigo.lopez-negrete.org
> Department of Chemical Engineering
> Carnegie Mellon University
> 5000 Forbes Ave.
> Pittsburgh, PA 15213-3890
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ipopt