Decision Optimization

 View Only
  • 1.  Support for C++11/C++14?

    Posted Wed December 02, 2015 02:02 PM

    Originally posted by: danschmidt


    Does the Cplex/Concert C++ interface in 12.6.2 support the more up-to-date revisions of the C++ standard (C++11/C++14)?

     

    I'm using the linux static library with the gnu compiler collection and compile with '-DILOUSESTL -DIL_STD', so that combination would be particularly interesting to me.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Support for C++11/C++14?

    Posted Thu December 03, 2015 02:16 AM

    I think this depends more on your compiler than on CPLEX. CPLEX does not use any of the new C++11 features but it also does not use "old" features in a way that would conflict with the new standard (as far as I can tell).

    For example, I just compiled the CPLEX C++ examples with 4.8.4 and options -std=c++11 and -Wc++11-compat. All examples compiled without warnings and the binaries ran without problem.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Support for C++11/C++14?

    Posted Thu December 03, 2015 03:04 PM

    Originally posted by: danschmidt


    That's great to hear, thanks for getting back to me!

    My main worry was binary compatibility: I could run into trouble because the C++98-STL is not 100% identical to the C++11/14-STLs: If I understand the process correctly, the cplex static lib was build using the C++98 STL headers whereas I would compile with the C++11/14 STL headers. Consequently the compiler might make some wrong assumptions about the size and layout of the STL types and functions.

     

    But if I understand you correctly, that shouldn't be a problem. Thanks!


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Support for C++11/C++14?

    Posted Mon December 07, 2015 01:44 AM

    Like I said, it depends on the compiler and the runtime libraries. It seems like things work without trouble for me and the specific g++ version I used. However, my tests did certainly not cover all bits and pieces of CPLEX and with different compilers or different runtime libraries things may be different.

    What you can conclude from my experiment is that it is worth trying.


    #CPLEXOptimizers
    #DecisionOptimization