Using the CPLEX solver through COIN-OR’s Open Solver Interface

Today I could not find a single web search result for this:

OsiCpxSolverInterface.hpp: No such file or directory

If you come across this error, you are likely trying to compile code that uses COIN-OR software but that, ultimately, relies on CPLEX to solve optimization problems. In my case, that software was CBC and I reinstalled it (i.e., ./configure; make; make install) with the path to CPLEX libraries and headers on my computer. There is a good explanation for configure options in COIN-OR’s website, but I also needed to add some additional library compiler flags to make it work. So here is my configure command in the end:

./configure –with-cplex-lib=”-L/opt/ibm/ILOG/CPLEX_Studio1263/cplex/lib/x86-64_linux/static_pic/ -lcplex -lpthread -lm” -with-cplex-incdir=”/opt/ibm/ILOG/CPLEX_Studio1263/cplex/include/ilcplex”

If you came here with the same problem, I hope this post saves you some time  🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: