Installing the OR-Tools binary

This page explains how to install OR-Tools from a binary distribution.

Installing on Linux or Mac

Note: binary distributions work on 64-bit machines only.

1. Update your Python configuration

If you're not going to use OR-tools from Python, skip this step.

Verify that you have Python 2.7+, 3.5, or 3.6:

python --version

If necessary, upgrade your Python installation at python.org.

Verify that you have pip 9.01 or higher with pip -V. If necessary, upgrade with pip install --upgrade pip (on Ubuntu: apt-get install python-pip).

2. Install other utilities

If you're on Mac OS X, you must install the Xcode Command Line Tools. To do so, open a Terminal window and enter:

xcode-select --install

If you're going to use OR-tools from C++ on Linux:

sudo apt-get install g++ make

If you're using OR-tools from C#, you must install Mono version 4.2.0 or later, with 64 bit support. You can download the latest version of Mono from the Mono Download page. (For Linux Ubuntu versions >= 16.04, sudo apt-get mono-complete.

3. Install OR-tools

There are two separate binary distributions: one for C++, Java, and C#; and a PyPI-based distribution for Python.

Python Windows/Mac/Linux binary distribution: pip install --upgrade ortools

C++/Java/C# binary distribution: Mac, Ubuntu 17.04, Ubuntu 16.04, Ubuntu 14.04, CentOS 7, Debian 9.

To test C++/Java/C# installations, open a command window and navigate to the directory where you unpacked binary distribution. Then enter the following command:

make all
This runs a selection of examples for OR-Tools. If all the examples run successfully, you are ready to start running OR-Tools programs.

Installing on Windows

The binary distributions work on 64-bit machines only. They have been tested on Windows 10 under Microsoft Visual Studio 2015 and 2017.

As with Mac and Linux, OR-Tools provides support for C++, Python (versions 2.7, 3.5, and 3.6), Java, and C#. There are two separate binary distributions, one for Python and the other for C++, Java and C#.

To install the binary distribution for Python, follow the instructions at the top of this page for Mac/Linux.

For the C++/Java/C# binary installation, download and install either Visual Studio 2017 the Visual Studio 2015 version.

  • For C++, add lib/ortools.lib to your project libraries, and add or‑tools/include to your project include path.
  • For Java, use the jar in lib/com.google.ortools.lib and add ‑Djava.library.path=PATH_TO_or‑tools/lib to your command line.
  • For C#, add bin/Google.OrTools.dll to your project dependencies.

To test the installation, open a Visual Studio x64 Native Tools Command Prompt and navigate to the directory where you unpacked the archive. Then enter the following command:

make all

This runs a selection of examples for OR-Tools. If all the examples run successfully, you are ready to start running OR-Tools programs.

FlatZinc binary distributions

FlatZinc is a solver input language understood by a wide range of solvers. OR-tools provides binary distributions with FlatZinc support for the following platforms: Ubuntu 17.04, Ubuntu 16.04, Ubuntu 14.04, CentOS 7, Debian 9, Mac, Visual Studio 2017, and Visual Studio 2015.

Troubleshooting

The instructions for installing OR-tools from source have a troubleshooting section that includes issues with binary installs as well.

Send feedback about...

Optimization
Optimization