# Google OR-Tools: CP-SAT Subset

**URL:** <https://discuss.ocaml.org/t/google-or-tools-cp-sat-subset/17885>\
**Category:** Community\
**Tags:** announce\
**Created:** [March 10, 2026, 9:19pm UTC](https://discuss.ocaml.org/t/google-or-tools-cp-sat-subset/17885 "2026-03-10T21:19:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbrk](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/tbrk/32/1578_2.png) [@tbrk](https://discuss.ocaml.org/u/tbrk)\
**Post date:** [March 10, 2026, 9:19pm UTC](https://discuss.ocaml.org/t/google-or-tools-cp-sat-subset/17885/1 "2026-03-10T21:19:50Z")

</div>

The [Google OR-Tools](https://developers.google.com/optimization) are a suite of tools for solving optimization problems. They include, in particular, [CP-SAT](https://d-krupke.github.io/cpsat-primer/), which is a powerful constraint solver and optimizer for integer linear programming and boolean satisfiability problems.

The [ocaml-ortools](https://github.com/INRIA/ocaml-ortools) package provides an OCaml interface to a subset of CP-SAT constraints. It comprises two parts `ortools`, which allows modelling constraint problems in OCaml and translating them to a protocol buffer format (thanks to [ocaml-protc](https://github.com/mransan/ocaml-protoc)), and `ortools_solvers`, which allows an embedded version of CP-SAT to be called directly from OCaml. Both parts can be installed using opam or built with dune. The latter includes the source of OR-Tools 9.15 which is built together with most of its libraries and installed as part of the opam package.

Some simple examples can be found in the [online documentation](https://inria.github.io/ocaml-ortools/ortools/index.html) and [source code](https://github.com/INRIA/ocaml-ortools/tree/master/samples/sat). They can be built using the following commands.

```auto
opam install ortools ortools_solvers
ocamlfind ocamlopt -o prog -package ortools -package ortools_solvers -linkpkg prog.ml

```

I would be happy to accept pull requests for the missing CP-SAT constraints (I think it best to develop the interface together with real applications, and I only need the ILP and boolean parts at the moment), to translate more of the standard example programs (an easy way to contribute), and to include other solvers from the suite (likely to involve solving tedious compilation and compatibility problems across multiple platforms).

Thanks to @nojb, @Rucikir , and others for [their help](https://discuss.ocaml.org/t/foreign-archives-no-static-libraries-dylib-on-mac/17669) with [dune](https://discuss.ocaml.org/t/dune-cmake-and-j/17768), and @xvw and @panglesd for [their help](https://discuss.ocaml.org/t/odoc-index-for-multiple-packages-inter-package-links-and-local-global-sidebar/17652) with odoc. Thanks to @jmid , @mseri , and @avsm for discussing and merging my [opam-repository](https://github.com/ocaml/opam-repository) pull requests.
