[Cbc] Using LP solvers other than CLP

Ted Ralphs ted at lehigh.edu
Tue Jan 25 00:45:00 EST 2011


Hi Ian,

What platform are you building on? Are you using the autotools? In
general, editing CbcConfig is probably not going to get you where you
want to go. Depending on exactly how you've built and installed Cbc,
the line you're editing is most likely be inside a block that is being
ignored because HAVE_CONFIG_H is defined. Even if not, I believe that
the line

#define COIN_HAS_CLP 0

still defines COIN_HAS_CLP. What you would want to do in principle is
to delete the line altogether or even put

#undef COIN_HAS_CLP

If you're using the autotools, there are options to configure that
will build Cbc with alternative solvers, but if I'm not mistaken,
these options are mostly not working at this point. Lou Hafer (cc'd)
has worked extensively on getting Cbc to work with other solvers and
will be able to say for sure (and save you a lot of trouble going down
blind alleys). With Visual C++, there is a separate solutions file
that builds Cbc with alternative solvers.  If you search the mailing
list, you should find some posts about this or I'm sure Lou will also
be able to let you know about it.

Cheers,

Ted

On Mon, Jan 24, 2011 at 10:06 PM, Iain Dunning <iaindunning at gmail.com> wrote:
> Hello,
> I've been investigating the use of LP solvers other than CLP with CBC, and
> I've hit a bit of a snag.
> In CbcConfig, there are 2 lines:
>
> /* Define to 1 if the Clp package is used */
> #define COIN_HAS_CLP 1
>
> As I am compiling the "minimum.cpp" example with an LP solver that isn't CLP
> (i.e. #include "OsiXYZSolverInterface.hpp"), I figured I should set this to
> zero
>
> #define COIN_HAS_CLP 0
>
> I re-compiled, and I happened to being stepping through when I noticed code
> that (I think) shouldn't of been compiled, was compiled!
>
> As an example, right near the start of void CbcModel::branchAndBound():
>
> ...
> ...
> #ifdef COIN_HAS_CLP
> {
>   OsiClpSolverInterface * clpSolver = dynamic_cast<OsiClpSolverInterface *>
> (solver_);
>   if (clpSolver) {
>     // pass in disaster handler
>     CbcDisasterHandler handler(this);
> ...
> ...
>
>
> Because COIN_HAS_CLP is still defined, the code still compiles. I can't help
> but feel this is _not_ the intended behaviour...
> Should it not be:
> #if COIN_HAS_CLP == 1
> or maybe just
> #if COIN_HAS_CLP
> ?
> Cheers,
> Iain Dunning
> University of Auckland
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc
>
>



-- 
Dr. Ted Ralphs
Associate Professor, Lehigh University
(610) 628-1280
ted 'at' lehigh 'dot' edu
coral.ie.lehigh.edu/~ted




More information about the Cbc mailing list