Installing OR-Tools for C++ from Binary on Linux

  • This guide provides instructions for installing Google's OR-Tools for C++ development on various Linux distributions, specifically focusing on the x86_64 architecture.

  • Before installing OR-Tools, ensure you have the necessary C++ development tools installed by following the distribution-specific commands provided.

  • Download the pre-built binary distribution of OR-Tools for your Linux distribution and extract it to a desired location.

  • Validate your OR-Tools installation by running the provided test suite using the make test command within the extracted directory.

 Introduction

This guide explains how to install OR-Tools for C++ on Linux.

Although these instructions might also work on other Linux variants, we have only tested them on machines meeting the following requirements:

  • Alpine Edge 64-bit (x86_64)
  • Centos 7 LTS 64-bit (x86_64)
  • Debian SID 64-bit (x86_64)
  • Debian 11 (bullseye) 64-bit (x86_64)
  • Fedora 38 64-bit (x86_64)
  • Fedora 37 64-bit (x86_64)
  • OpenSuse Leap 64-bit (x86_64)
  • Ubuntu 24.10 64-bit (x86_64)
  • Ubuntu 22.04 LTS 64-bit (x86_64)
  • Ubuntu 20.04 LTS 64-bit (x86_64)

Prerequisites

The following sections describe the prerequisites for installing OR-Tools.

C++ tools

To install C++ tools, open a terminal window and enter:

Alpine

apk add alpine-sdk linux-headers cmake lsb-release-minimal

Centos

sudo yum groupinstall -y 'Development Tools'
sudo yum install -y pkgconfig redhat-lsb-core

Debian

sudo apt update
sudo apt install -y build-essential cmake lsb-release

Fedora

sudo dnf groupinstall -y 'Development Tools'
sudo dnf install -y gcc-c++ cmake redhat-lsb-core

Fedora

sudo dnf groupinstall -y 'Development Tools'
sudo dnf install -y gcc-c++ cmake redhat-lsb-core

OpenSUSE

sudo zypper refresh
sudo zypper install -y git gcc11 gcc11-c++ lsb-release

Ubuntu

sudo apt update
sudo apt install -y build-essential cmake lsb-release

Ubuntu

sudo apt update
sudo apt install -y build-essential cmake lsb-release

Ubuntu

sudo apt update
sudo apt install -y build-essential cmake lsb-release

Take the following steps to install the OR-Tools library for C++:

Download and extract the binary distribution for your system:

Validate your installation

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

make test

This runs a selection of examples for OR-Tools. If all the examples run successfully, you are ready to get started with OR-Tools.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-03-18 UTC.