guroobi is an OCaml wrapper to the commercial Gurobi optimization library, specifically of its C API. guroobi was developed and tested with Gurobi version 10.
To build guroobi, first download and install Gurobi; this will require a license, as Gurobi is commercial software. Then, clone the guroobi repository:
git clone https://github.com/onechronos/guroobi.git
cd guroobi
Next, set two environment variables necessary to build guroobi and run unit tests:
export GUROBI_ROOT=/path/to/gurobi
export LD_LIBRARY_PATH=$GUROBI_ROOT/lib
Here, /path/to/gurobi
must be replaced with the path of the
directory where Gurobi architecture-specific files live. Finally,
build and install:
opam pin add .
or
dune build
dune install
guroobi's unit tests offer some examples of guroobi in action. They consist of OCaml translations of some of Gurobi's C examples.
Other OCaml wrappers to Gurobi exist: ocaml-gurobi, ocaml-lp. Unlike these, guroobi is not based on ocaml-ctypes. In the author's opinion, the verbosity emanating from this design decision is worth the extra flexibility.
Testing for Guroobi is done via the Gurobi C Examples. Tests can be run by
dune runtest
The following tests are replicated:
- batchmode
- bilinear
- callback
- dense
- diet
- facility
- feasopt
- fixanddive
- gc_funcnonlinear
- gc_pwl
- gc_pwl_func
- genconstr
- lp
- lpmethod
- lpmod
- mip1
- mip2
- multiobj
- multiscenario
- params
- piecewise
- poolsearch
- qcp
- qp
- sensitivity
- sos
- sudoku
- tsp
- tune
- workforce1
- workforce2
- workforce3
- workforce4
- workforce5