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 20.10/20.04 LTS/18.04 LTS 64-bit (x86_64)
- Alpine Edge 64-bit (x86_64)
- Debian 10.2 (buster) 64-bit (x86_64)
- Centos 8 64-bit (x86_64)
.Net Core SDK >= 2.1.302
Next, install the .Net Core SDK version 3.1.101 or higher. To do so, open a terminal window and enter:
Alpine Edge
You can find more details here.sudo apk add wget icu-libs libintl"
dotnet_sdk_version=3.1.101 && wget -O dotnet.tar.gz https://dotnetcli.azureedge.net/dotnet/Sdk/$dotnet_sdk_version/dotnet-sdk-$dotnet_sdk_version-linux-musl-x64.tar.gz
mkdir -p /usr/share/dotnet
tar -C /usr/share/dotnet -oxzf dotnet.tar.gz
ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
Centos 8
sudo dnf install dotnet-sdk-3.1
You can find more details here.
Debian 10
You can found more details here.sudo apt update
sudo apt install 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/10/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo apt update
sudo apt install dotnet-sdk-3.1
Ubuntu 20.10
You can found more details here.apt-get update -qq
apt-get install -yq apt-transport-https
wget -q https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
apt-get update -qq
apt-get install -yq dotnet-sdk-3.1
Ubuntu 20.04 LTS
You can found more details here.apt-get update -qq
apt-get install -yq apt-transport-https
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
apt-get update -qq
apt-get install -yq dotnet-sdk-3.1
Ubuntu 18.04 LTS
You can found more details here.apt-get update -qq
apt-get install -yq apt-transport-https
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
apt-get update -qq
apt-get install -yq dotnet-sdk-3.1
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:
- FlatZinc—Ubuntu 20.10
- FlatZinc—Ubuntu 20.04 LTS
- FlatZinc—Ubuntu 18.04 LTS
- FlatZinc—Alpine Edge
- FlatZinc—CentOS 8
- FlatZinc—Debian 10
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.