5

I'm currently trying to get the IpOpt Interior point solver working. I am running the example, which runs fine, except for the options.

Whenever i try to set an option, for example:

app->Options()->SetStringValue("mu_strategy", "adaptive");

I get a std::bad_alloc exception. If I leave all the option sets from the example out, it runs fine, as mentioned above.

I have also tried setting the options file manually by giving the path in the initializer:

app->Initialize("C:\\ipopt.opt");

However, this throws me an exception inside the initialize().

I do have a ipopt.opt file in my executables folder.

Any clues as to what im doing wrong or what I could do to fix this?

Examples I have tried using (all give me the bad_alloc on setting the options):
- http://codepad.org/mHIfBz3k
- https://projects.coin-or.org/Ipopt/browser#releases/3.11.0/Ipopt/examples/hs071_cpp
(specifically: https://projects.coin-or.org/Ipopt/browser/releases/3.11.0/Ipopt/examples/hs071_cpp/hs071_main.cpp)

edit (resolved): I was using procompiled libraries for Visual Studio that were build in release mode. I tried using them in visual studio while my project was in debug mode, thus it crashed.

Satchmode
  • 123
  • 1
  • 8
  • 1
    From links provided, you seem to be using way old version 3.11.0, can you replicate issue with new versions also? How did you get your ipopt library - custom compile or eg. distribution package? Can you provide more details on your compilation steps? – pe3k Apr 18 '17 at 13:07
  • Hi, this question is quite old. I have resolved this issue some time ago. I was using procompiled libraries that were build in release mode. I tried using them in debug mode, thus it crashed. Im sorry for not closing the question, I will do so now. – Satchmode Apr 19 '17 at 12:08
  • @Satchmode make it an answer and close it then. Your solution might help other people as well. – Marco A. Apr 20 '17 at 07:24

1 Answers1

0

I was using precompiled libraries for Visual Studio that were build in release mode. I tried using them in visual studio while my project was in debug mode, thus it crashed.

Satchmode
  • 123
  • 1
  • 8