I have been trying to get CasADi to build under visual studio using the prebuilt IPOPT binaries from
I used CMake to generate a visual studio solution, which did not build straight away and I had to make a few hacky changes:
- I had to change ipopt_internal.cpp to use IpoptApplicationFactory() instead of new IpoptApplication. This seems to be a requirement when using IPOPT as a dll as described here
https://projects.coin-or.org/Ipopt/wiki/CompilationHints and I previously made this change successfully when using IPOPT with ADOL-C.
- it looks like ipopt_internal.cpp queries the IpoptApplication instance for a list of options with RegOptions()->RegisteredOptionsList(). For me this was returning garbage data (the size of the list was reported as some random huge number), so I commented out this section and manually inserted some of the important IPOPT options such as "hessian_approximation" into CasADi's list of options.
With these changes, I was able to build the solution, but when I tried to run any of the examples I would run into crashes with invalid null pointers during getJacG(). As far as I can tell this is happening because the vector which should store the non-zero elements is empty. I have uploaded the call stack for the rocket_ipopt example here
The problem always seems to be with determining the constraint Jacobian - determining the gradient of the objective function seems to be working correctly.
I thought the problem might be to do with the changes I had made to the IPOPT interface, so I tried regenerating the CasADi solution without IPOPT support, but I ran into the same null pointer problem, for example in test_csparse_casadi. I also tried using Nmake to compile but still got the same problem.
Can anyone suggest what might be going wrong?
Best wishes,
David