Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Debugging ILOG CP programmes

    Posted 12/07/11 01:35 PM

    Originally posted by: anahana


    Hi,

    This may sound like a trivial question, especially that I have been using ILOG for some time now, but how can I debug a code written using ILOG CP, or CPLEX for that matter, libraries? Since the libraries are pre-compiled, if you attempt to debug your code (in C++ for example), you only get the disassembly screen.

    I've been using cout whenever I want to debug something and it's very hectic. Isn't there any other way? I know CP provided a debugger that connects to Solver, but what about Dispatcher and Scheduler? And to be honest, the debugger seems too much if you just want to debug small issues.

    Regards,
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Debugging ILOG CP programmes

    Posted 12/08/11 04:14 AM

    Originally posted by: SystemAdmin


    Hello.

    CP Optimizer, CPLEX and other ILOG optimization libraries are provided as compiled libraries without source code. It is indeed impossible to debug internals of those libraries (as you say, you will get only disassembly). However it does not block you to debug your own code, you just cannot "step into" functions provided by those libraries. Even when CP Optimizer calls your function (an instance IlcGoal for example), you can set a breakpoint in your own code and debug it. All you have to do is to instruct your compiler to generate debug information. Exact compiler options depends on your compiler, for example for GCC it is -g option. It is also recommended to disable compiler optimizations (for GCC -O0), and not define NDEBUG macro in order to activate asserts in the provided header files (usually that means to remove -DNDEBUG option).

    Does it help?

    Best regards, Petr
    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Debugging ILOG CP programmes

    Posted 12/08/11 05:32 AM

    Originally posted by: anahana


    Thanks Petr, this is helpful. However, I need to figure out how to do this for VC++. Usually when I add a break point and start the debugger I get a warning message: "Debugging information for *.exe cannot be found or does not match. Binary was not built with debug information." I choose to start the debugger. If I pause the execution and try to "step over" or "step out" of anything, I remain in the disassembly window and never switch to the code window. Maybe I need to do the modifications you suggested for it to work.

    I'll let you know how it goes.

    Regards,
    #CPOptimizer
    #DecisionOptimization


  • 4.  Re: Debugging ILOG CP programmes

    Posted 12/08/11 09:48 AM

    Originally posted by: anahana


    I figured out how to do it. Thanks for the help.
    #CPOptimizer
    #DecisionOptimization