Jordi Pont-Tuset bio photo

Jordi Pont-Tuset

I'm from a small town near Girona, Catalunya. Currently in Zürich, Switzerland. Passionate about computer vision, technology, running, and mountains.

Twitter   G. Scholar LinkedIn Github e-Mail Google+

CPLEX is a pretty awesome optimization toolbox from IBM, and it is free for academic use. It can be called from C++ (apart from Matlab, Python, etc.), but it’s not the easiest library to compile… You will encounter some problems for instance if your code has some C++11 functionalities from the C++ standard library.


Long story short, CPLEX requires the flag -stdlib=libstdc++, which downgrades the version of the standard library to a version where the C++11 functionalities where not available by default. This way, your part of the code with C++11 won’t compile.


The good part is that you can still use the C++11 code by including the Technical Report 1 part of the library, that is, by adding tr1/ to the files that the compiler does not found and changing std:: by std::tr1:: in the functions that are not found.