I have started wrapping Ipopt, a numerical optimizer. As always, the beginnings are hard. I wrapped it with c2nim. Now I am getting a memory error that I have reported here.
I have put my code here. The ex01.nim code compiles fine, but when I run it I get the failure:
****************************************************************************** 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.13.0, running with linear solver mumps. NOTE: Other linear solvers might be more efficient (see Ipopt documentation). malloc(): corrupted top size Traceback (most recent call last) /home/jose/src/ipopt.nim/src/ex01.nim(312) ex01 SIGABRT: Abnormal termination.
It is recommending me to run a debugger (something that I have never used). I have checked this, but I don't know how to find which variable is the one causing the problem.
Any advise? A tutorial that might help me on finding this particular issue?
Just for the record, it was much more informative (at least for me) compiling with:
$ nim c --profiler:on --stacktrace:on ex01
and then checking the error messages provided by valgrind:
$ valgrind ./ex01
Thanks a Araq for trying.
I manage to find and solve the problem.
Regarding the cast, are you referring to these. I need to think about how to make it easier using the library.