Installing OR-Tools for .Net from Binary on Linux

Introduction

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

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

  • Ubuntu 19.10/18.04/16.04 64-bit (x86_64)
  • Debian 9.4 (stretch) 64-bit (x86_64)
  • Centos 7 64-bit (x86_64)

.Net Core SDK >= 2.1.302

Next, install the .Net Core SDK version 2.1.302 or higher. To do so, open a terminal window and enter:

Centos 7

rpm -Uvh "https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm"
yum -y update
yum -y install dotnet-sdk-2.1
You can find more details here.

Debian 9

apt-get update -qq
apt-get install -yq gpg apt-transport-https
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/debian/9/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
apt-get update -qq
apt-get install -yq dotnet-sdk-2.1
You can found more details here.

Ubuntu 19.10

apt-get update -qq
apt-get install -y -q gpg apt-transport-https
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
apt-get update -qq
apt-get install -y -q dotnet-sdk-2.1
You can found more details here.

Ubuntu 18.04

apt-get update -qq
apt-get install -y -q gpg apt-transport-https
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget -q https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
apt-get update -qq
apt-get install -y -q dotnet-sdk-2.1
You can found more details here.

Ubuntu 16.04

apt-get update -qq
wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
apt-get install -yq apt-transport-https
apt-get update
apt-get install -yq dotnet-sdk-2.1
You can find more details here.

Installing OR-Tools

Take the following steps to install the OR-Tools library for .Net:

Download and extract the binary distribution for your system:

FlatZinc binary distributions

FlatZinc is a solver input language understood by a wide range of solvers.
OR-Tools also provides binary distributions with FlatZinc support:

Validate your installation

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

make test_dotnet

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