| 1 | # Osi 0.108.11 |
| 2 | |
| 3 | [](https://www.coin-or.org) |
| 4 | |
| 5 | Projects such as this one are maintained by a small group of volunteers under |
| 6 | the auspices of the non-profit [COIN-OR Foundation](https://www.coin-or.org) |
| 7 | and we need your help! Please consider [sponsoring our |
| 8 | activities](https://github.com/sponsors/coin-or) or [volunteering](mailto:[email protected]) to help! |
| 9 | |
| 10 | [](https://github.com/coin-or/Osi/releases) |
| 11 | |
| 12 | _This file is auto-generated from [config.yml](.coin-or/config.yml) using the |
| 13 | [generate_readme](.coin-or/generate_readme) script. |
| 14 | To make changes, please edit [config.yml](.coin-or/config.yml) or the generation scripts |
| 15 | [here](.coin-or/generate_readme) and [here](https://github.com/coin-or/coinbrew/blob/master/scripts/generate_readme)._ |
| 16 | |
| 17 | Osi (*O*pen *S*olver *I*nterface) provides an abstract base class to a generic linear programming (LP) solver, along with derived classes for specific solvers. |
| 18 | Many applications may be able to use the Osi to insulate themselves from a specific LP solver. |
| 19 | That is, programs written to the OSI standard may be linked to any solver with an OSI interface and should produce correct results. |
| 20 | The OSI has been significantly extended compared to its first incarnation. |
| 21 | Currently, the OSI supports linear programming solvers and has rudimentary support for integer programming. |
| 22 | Among others the following operations are supported: |
| 23 | * creating the LP formulation; |
| 24 | * directly modifying the formulation by adding rows/columns; |
| 25 | * modifying the formulation by adding cutting planes provided by [CGL](https://www.github.com/coin-or/Cgl); |
| 26 | * solving the formulation (and resolving after modifications); |
| 27 | * extracting solution information; |
| 28 | * invoking the underlying solver's branch-and-bound component. |
| 29 | |
| 30 | The following is a list of derived Osi classes: |
| 31 | |
| 32 | |Solver|Derived Class|Note| |
| 33 | |------|-------------|----| |
| 34 | |[Cbc](https://www.github.com/coin-or/Cbc)|OsiCbc| unmaintained | |
| 35 | |[Clp](https://www.github.com/coin-or/Clp)|OsiClp| | |
| 36 | |[CPLEX](https://www.ibm.com/analytics/cplex-optimizer)|OsiCpx| | |
| 37 | |[DyLP](https://www.github.com/coin-or/DyLP)|OsiDylp| | |
| 38 | |[GLPK](http://www.gnu.org/software/glpk/glpk.html)|OsiGlpk| Glpk | |
| 39 | |[Gurobi](http://www.gurobi.com)|OsiGrb| | |
| 40 | |[HiGHS](https://www.github.com/coin-or/HiGHS)|OsiHiGHS| under development | |
| 41 | |[MOSEK](http://www.mosek.com)|OsiMsk| | |
| 42 | |[SoPlex](http://soplex.zib.de)|OsiSpx| SoPlex < 4.0 | |
| 43 | |[SYMPHONY](https://www.github.com/coin-or/SYMPHONY)|OsiSym| | |
| 44 | |[Vol](https://www.github.com/coin-or/Vol)|OsiVol| | |
| 45 | |[XPRESS-MP](https://www.fico.com/en/products/fico-xpress-optimization)|OsiXpr| | |
| 46 | |
| 47 | Each solver interface is in a separate directory of Osi or distributed |
| 48 | with the solver itself. |
| 49 | |
| 50 | Within COIN-OR, Osi is used by [Cgl](https://www.github.com/coin-or/Cgl), [Cbc](https://www.github.com/coin-or/Cbc), and [Bcp](https://www.github.com/coin-or/Bcp), among others. |
| 51 | |
| 52 | The main project managers are Lou Hafer (@LouHafer) and Matt Saltzmann (@mjsaltzman). |
| 53 | |
| 54 | An incomplete list of recent changes to Osi are found in the [CHANGELOG](Osi/CHANGELOG) |
| 55 | |
| 56 | |
| 57 | Osi is written in C++ and is released as open source under the [Eclipse Public License 2.0](http://www.opensource.org/licenses/EPL-2.0). |
| 58 | |
| 59 | It is distributed under the auspices of the [COIN-OR Foundation](https://www.coin-or.org). |
| 60 | |
| 61 | The Osi development site is https://github.com/coin-or/Osi. |
| 62 | |
| 63 | ## CITE |
| 64 | |
| 65 | Code: [](https://zenodo.org/badge/latestdoi/173476455) |
| 66 | |
| 67 | ## CURRENT BUILD STATUS |
| 68 | |
| 69 | [](https://github.com/coin-or/Osi/actions/workflows/windows-ci.yml?query=branch%3Areleases/0.108.11) |
| 70 | |
| 71 | [](https://github.com/coin-or/Osi/actions/workflows/linux-ci.yml?query=branch%3Areleases/0.108.11) |
| 72 | |
| 73 | ## DOWNLOAD |
| 74 | |
| 75 | What follows is a quick start guide for obtaining or building |
| 76 | Osi on common platforms. More detailed information is |
| 77 | available [here](https://coin-or.github.io/user_introduction.html). |
| 78 | |
| 79 | ### Docker image |
| 80 | |
| 81 | There is a Docker image that provides Osi, as well as other projects |
| 82 | in the [COIN-OR Optimization |
| 83 | Suite](https://github.com/coin-or/COIN-OR-OptimizationSuite) [here](https://hub.docker.com/repository/docker/coinor/coin-or-optimization-suite) |
| 84 | |
| 85 | ### Binaries |
| 86 | |
| 87 | For newer releases, binaries will be made available as assets attached to |
| 88 | releases in Github |
| 89 | [here](https://github.com/coin-or/Osi/releases). Older binaries |
| 90 | are archived as part of Cbc |
| 91 | [here](https://www.coin-or.org/download/binary/Cbc). |
| 92 | |
| 93 | * *Linux* (see https://repology.org/project/coin-or-osi/versions for a complete listing): |
| 94 | * arch: |
| 95 | ``` |
| 96 | $ sudo pacman -S coin-or-osi |
| 97 | ``` |
| 98 | * Debian/Ubuntu: |
| 99 | ``` |
| 100 | $ sudo apt-get install coinor-osi coinor-libosi-dev |
| 101 | ``` |
| 102 | * Fedora/Redhat/CentOS: |
| 103 | ``` |
| 104 | $ sudo yum install coin-or-Osi coin-or-Osi-devel |
| 105 | ``` |
| 106 | * freebsd: |
| 107 | ``` |
| 108 | $ sudo pkg install math/osi |
| 109 | ``` |
| 110 | * linuxbrew: |
| 111 | ``` |
| 112 | $ brew install osi |
| 113 | ``` |
| 114 | * *Windows*: The easiest way to get Osi on Windows is to download an archive as described above. |
| 115 | * *Mac OS X*: The easiest way to get Osi on Mac OS X is through [Homebrew](https://brew.sh). |
| 116 | ``` |
| 117 | $ brew tap coin-or-tools/coinor |
| 118 | $ brew install coin-or-tools/coinor/osi |
| 119 | ``` |
| 120 | |
| 121 | * *conda* (cross-platform, no Windows for now): |
| 122 | ``` |
| 123 | $ conda install coin-or-osi |
| 124 | ``` |
| 125 | |
| 126 | Due to license incompatibilities, pre-compiled binaries lack some |
| 127 | functionality. If binaries are not available for your platform for the latest |
| 128 | version and you would like to request them to be built and posted, feel free |
| 129 | to let us know on the mailing list. |
| 130 | |
| 131 | ### Source |
| 132 | |
| 133 | Source code can be obtained either by |
| 134 | |
| 135 | * Downloading a snapshot of the source code for the latest release version of Osi from the |
| 136 | [releases](https://github.com/coin-or/Osi/releases) page, |
| 137 | * Cloning this repository from [Github](https://github.com/coin-or/Osi), or |
| 138 | * Using the [coinbrew](https://github.com/coin-or/coinbrew) script to get the project and all dependencies (recommended, see below). |
| 139 | |
| 140 | ### Dependencies |
| 141 | |
| 142 | Osi has a number of dependencies, which are detailed in |
| 143 | [config.yml](.coin-or/config.yml). Dependencies on other COIN-OR projects are |
| 144 | automatically downloaded when obtaining the source with `coinbrew`. For some |
| 145 | of the remaining third-party dependencies, automatic download scripts and |
| 146 | build wrappers are provided (and will also be automatically run for required |
| 147 | and recommended dependencies), while other libraries that are aeasy to obtain |
| 148 | must be installed using an appropriate package manager (or may come with your |
| 149 | OS by default). |
| 150 | |
| 151 | ## BUILDING from source |
| 152 | |
| 153 | These quick start instructions assume you are in a bash shell. |
| 154 | |
| 155 | ### Using `coinbrew` |
| 156 | |
| 157 | To download and build Osi from source, execute the |
| 158 | following on the command line. |
| 159 | ``` |
| 160 | wget https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew |
| 161 | chmod u+x coinbrew |
| 162 | ./coinbrew fetch [email protected] |
| 163 | ./coinbrew build Osi |
| 164 | ``` |
| 165 | For more detailed instructions on coinbrew, see https://coin-or.github.io/coinbrew. |
| 166 | The `coinbrew` script will fetch the additional projects specified in the Dependencies section of [config.yml](.coin-or/config.yml). |
| 167 | |
| 168 | ### Without `coinbrew` (Expert users) |
| 169 | |
| 170 | * Download the source code, e.g., by cloning the git repo https://github.com/coin-or/Osi |
| 171 | * Download and install the source code for the dependencies listed in [config.yml](.coin-or/config.yml) |
| 172 | * Build the code as follows (make sure to set PKG_CONFIG_PTH to install directory for dependencies). |
| 173 | |
| 174 | ``` |
| 175 | ./configure -C |
| 176 | make |
| 177 | make test |
| 178 | make install |
| 179 | ``` |
| 180 | |
| 181 | ## Doxygen Documentation |
| 182 | |
| 183 | If you have `Doxygen` available, you can build a HTML documentation by typing |
| 184 | |
| 185 | `make doxydoc` |
| 186 | |
| 187 | in the build directory. If Osi was built via `coinbrew`, then the build |
| 188 | directory will be `./build/Osi/0.108.11` by default. The doxygen documentation main file |
| 189 | is found at `<build-dir>/doxydoc/html/index.html`. |
| 190 | |
| 191 | If you don't have `doxygen` installed locally, you can use also find the |
| 192 | documentation [here](http://coin-or.github.io/Osi/Doxygen). |
| 193 | |
| 194 | ## Project Links |
| 195 | |
| 196 | * [Code of Conduct](https://www.coin-or.org/code-of-conduct/) |
| 197 | * [COIN-OR Web Site](http://www.coin-or.org/) |
| 198 | * [Discussion forum](https://github.com/coin-or/Osi/discussions) |
| 199 | * [Report a bug](https://github.com/coin-or/Osi/issues/new) |
| 200 | * [Doxygen-generated html documentation](https://coin-or.github.io/Osi/Doxygen) |
| 201 | * [OSI2 Discussion](https://github.com/coin-or/Osi2/discussions) |
| 202 | * The most recent tutorial on OSI can be accessed from the [page on presentations from the 2004 CORS/INFORMS Joint Meeting in Banff](http://www.coin-or.org/Presentations/CORSINFORMSWorkshop04/index.html). |
| 203 | * [The COIN-OR Open Solver Interface: Technology Overview](http://www.coin-or.org/Presentations/CORS2004-OSI.pdf): An overview of the COIN-OR OSI and design issues for a next-generation version given at CORS/INFORMS 2004 by Matthew Saltzman. |
| 204 | |
| 205 | ------- |
| 206 | |
| 207 | ## Dynamically loading commercial solver libraries |
| 208 | |
| 209 | ### At build time |
| 210 | |
| 211 | 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](https://code.google.com/p/lazylpsolverlibs/). To do so, follow these steps: |
| 212 | |
| 213 | 1. Install lazylpsolverlibs (follow the instructions of the [lazylpsolverlibs wiki](https://code.google.com/p/lazylpsolverlibs/wiki/HowToSetup)) |
| 214 | 2. Use the following command line to configure Osi: |
| 215 | ``` |
| 216 | ./configure --with-cplex-incdir="$(pkg-config --variable=includedir lazycplex)/lazylpsolverlibs/ilcplex" \ |
| 217 | --with-cplex-lib="$(pkg-config --libs lazycplex)" \ |
| 218 | --with-gurobi-incdir="$(pkg-config --variable=includedir lazygurobi)/lazylpsolverlibs" \ |
| 219 | --with-gurobi-lib="$(pkg-config --libs lazygurobi)" \ |
| 220 | --with-xpress-incdir="$(pkg-config --variable=includedir lazyxprs)/lazylpsolverlibs" \ |
| 221 | --with-xpress-lib="$(pkg-config --libs lazyxprs)" |
| 222 | ``` |
| 223 | 3. Then follow the normal installation process (make, make install) |
| 224 | |
| 225 | ### At run time |
| 226 | |
| 227 | 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. |
| 228 | 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. |
| 229 | For example: |
| 230 | ``` |
| 231 | export LAZYLPSOLVERLIBS_CPLEX_LIB=/usr/ilog/cplex121/bin/x86_debian4.0_4.1/libcplex121.so |
| 232 | ``` |
| 233 | |
| 234 | ### Troubleshooting |
| 235 | |
| 236 | If pkg-config reports errors during the configure step, try modifying the PKG_CONFIG_PATH variable. Most likely, you need to do: |
| 237 | ``` |
| 238 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig |
| 239 | ``` |
| 240 |