Skip to content
Open Solver Interface
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.coin-or copy updated projDesc.xml Mar 6, 2019
Osi
doxydoc Doxygen tweaks: restore AUTOBRIEF, make COIN_DOXYGEN unchatty. Aug 13, 2010
.gitattributes Visual Studio 2019 project and solution Jul 19, 2019
.travis.yml Fix for Travis Oct 31, 2018
Dependencies restoring Osi/trunk Feb 22, 2019
INSTALL update README's and INSTALL Mar 15, 2019
LICENSE added base LICENSE file Jun 19, 2006
Makefile.am
Makefile.in Re-running the autotools Mar 26, 2015
README update README's and INSTALL Mar 15, 2019
README.md
appveyor.yml Updating Travis and Appveyor to new build script and new build images Oct 31, 2018
compile Merge branches/devel with trunk as of r950. May 24, 2007
config.guess Point to Clp/trunk, Cbc/trunk. Update config.guess, config.sub to match Jun 27, 2007
config.sub Point to Clp/trunk, Cbc/trunk. Update config.guess, config.sub to match Jun 27, 2007
configure restoring Osi/trunk Feb 22, 2019
configure.ac restoring Osi/trunk Feb 22, 2019
depcomp first commit to be able to make more modifications May 11, 2006
install-sh first commit to be able to make more modifications May 11, 2006
ltmain.sh first commit to be able to make more modifications May 11, 2006
missing first commit to be able to make more modifications May 11, 2006

README.md

OSI

Osi (Open Solver Interface) provides an abstract base class to a generic linear programming (LP) solver, along with derived classes for specific solvers. Many applications may be able to use the Osi to insulate themselves from a specific LP solver. That is, programs written to the OSI standard may be linked to any solver with an OSI interface and should produce correct results. The OSI has been significantly extended compared to its first incarnation. Currently, the OSI supports linear programming solvers and has rudimentary support for integer programming. Among others the following operations are supported:

  • creating the LP formulation;
  • directly modifying the formulation by adding rows/columns;
  • modifying the formulation by adding cutting planes provided by CGL;
  • solving the formulation (and resolving after modifications);
  • extracting solution information;
  • invoking the underlying solver's branch-and-bound component.

The following is a list of derived Osi classes:

Solver Derived Class Note
Cbc OsiCbc unmaintained
Clp OsiClp
CPLEX OsiCpx
DyLP OsiDylp
GLPK OsiGlpk Glpk <= 4.48
Gurobi OsiGrb
HiGHS OsiHiGHS under development
MOSEK OsiMsk
SoPlex OsiSpx SoPlex < 4.0
SYMPHONY OsiSym
Vol OsiVol
XPRESS-MP OsiXpr

Each solver interface is in a separate directory of Osi or distributed with the solver itself.

Osi is written in C++ and is released as open source code under the Eclipse Public License (EPL). It is available from the COIN-OR initiative. Within COIN-OR, Osi is used by Cgl, Cbc, and Bcp, among others.

The Osi website is https://github.com/coin-or/Osi.

The main project managers are Lou Hafer (@LouHafer) and Matt Saltzmann (@mjsaltzman).

An incomplete list of recent changes to Osi are found in the CHANGELOG

Getting Started using CoinBrew

To build CoinUtils from source, obtain the coinbrew script from https://coin-or.github.io/coinbrew/ and run

/path/to/coinbrew fetch --main-proj=Osi
/path/to/coinbrew build --main-proj=Osi --test
/path/to/coinbrew install --main-proj=Osi

The coinbrew script will fetch these additional projects.

Getting Started without CoinBrew (Expert users)

  1. Install CoinUtils
  2. Obtain the source code, e.g., from https://github.com/coin-or/Osi
  3. Run ./configure -C to generate makefiles
  4. Run make to build the CoinUtils library
  5. Run make test to build and run the CoinUtils unit test program
  6. Run make install to install library and header files.

Doxygen Documentation

If you have Doxygen available, you can build a HTML documentation by typing

make doxydoc

in the build directory. If CoinUtils was build via coinbrew, then the build directory is ./build/CoinUtils. The doxygen documentation main file is found at ./doxydoc/html/index.html in the build directory.

If Doxygen is not available, you can use also use this link.

Project Links


Dynamically loading commercial solver libraries

At build time

It is possible to create an osi build that supports cplex, gurobi and xpress even if you don't have (yet) any of these solvers on your machine using lazylpsolverlibs. To do so, follow these steps:

  1. Install lazylpsolverlibs (follow the instructions of the lazylpsolverlibs wiki)
  2. Use the following command line to configure Osi:
./configure --with-cplex-incdir="$(pkg-config --variable=includedir lazycplex)/lazylpsolverlibs/ilcplex" \
            --with-cplex-lib="$(pkg-config --libs lazycplex)" \
            --with-gurobi-incdir="$(pkg-config --variable=includedir lazygurobi)/lazylpsolverlibs" \
            --with-gurobi-lib="$(pkg-config --libs lazygurobi)" \
            --with-xpress-incdir="$(pkg-config --variable=includedir lazyxprs)/lazylpsolverlibs" \
            --with-xpress-lib="$(pkg-config --libs lazyxprs)"
  1. Then follow the normal installation process (make, make install)

At run time

Your build should now support cplex, gurobi and xpress, which means that if you install one of these solvers, osi will be able to use it. At run time, you just need to point one of the environment variables LAZYLPSOLVERLIBS_GUROBI_LIB, LAZYLPSOLVERLIBS_CPLEX_LIB or LAZYLPSOLVERLIBS_XPRS_LIB to the full path of the corresponding solver library. For example:

export LAZYLPSOLVERLIBS_CPLEX_LIB=/usr/ilog/cplex121/bin/x86_debian4.0_4.1/libcplex121.so

Troubleshooting

If pkg-config reports errors during the configure step, try modifying the PKG_CONFIG_PATH variable. Most likely, you need to do:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
You can’t perform that action at this time.