[Osi] Problem building examples with OSI/CLP

Ted Ralphs ted at lehigh.edu
Tue Jul 5 18:34:31 EDT 2011


On Sat, Jul 2, 2011 at 7:25 AM, Stefan Vigerske
<stefan at math.hu-berlin.de> wrote:
> Hi,
>
>> Hi There,
>>
>> Thanks to Ted Ralphs for answering my question last week about choosing a package for my project.  I'm going to try using OSI and CLP.  I have some very basic questions about getting set up.  i haven't been able to find this information after looking around the mail lists.
>>
>> 1.) There is an Osi subdirectory when I install Clp.  Is that all I need, or do I also need to install the Osi project?  If I do install and build the Osi project there isn't mention of Clp.  For example, the solver directories are:
>>
>> Osi OsiCommonTest OsiCpx OsiGlpk OsiGrb  OsiMsk OsiSpx OsiXpr
>>
>> so I'm guessing I just use what is installed by Clp.
>
> You also need Osi, because it implements the Osi base class and other
> helper classes. These are in the src/Osi subdirectory of Osi.
> Clp only has the OsiClp class, which derives from the general
> OsiSolverInterface in Osi.

Just to clarify, you only need what you get by checking out Clp. As
Stefan indicated, you need the Osi base class, which is in the
coin-Clp/Osi directory, and the implementation of OsiClp (derived from
the Osi base class), which is in coin-Clp/Clp/src/OsiClp.

>> 2.) I can't get the examples in coin-Clp/Osi/examples to build.  The README seems out of date.  Could someone detail how I would build build.cpp, for example? (I'm using Mac OSX.) The file build.cpp starts out:
>>
>> // ________________________________________
>>
>> #include<iostream>
>> #include OSIXXXhpp
>> #include "CoinPackedMatrix.hpp"
>> #include "CoinPackedVector.hpp"
>>
>> int
>> main(void)
>> {
>>     // Create a problem pointer.  We use the base class here.
>>     OsiSolverInterface *si;
>>
>>     // When we instantiate the object, we need a specific derived class.
>>     si = new OSIXXX;
>>
>> // ________________________________________
>>
>> I'm not sure what to substitute for XXX.  There is no file that I can find fitting OSIXXX.hpp   There isn't a OsiClp.hpp either, which I might have guessed it would be.  What class to I instantiate with the new statement?

As above, see coin-Clp/Clp/src/OsiClp.

> If you build Osi with Glpk, Cplex, Gurobi, Mosek, Soplex, or Xpress,
> then the Makefile that is generated by configure should define OSIXXXhpp
> and OSIXXX. It is set to one of those Osi interfaces that are available
> for Osi. Since OsiClp is not part of Osi anymore (but moved to Clp), it
> is not available there, but it should not be difficult to adapt the
> Makefile to define OSIXXXhpp and OSIXXX in a way that Clp is used.
> Some more documentation is available at
> https://projects.coin-or.org/BuildTools/wiki/user-examples

Just to make sure it's clear, "XXX" should be "Clp".

Cheers,

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





More information about the Osi mailing list