Installer OR-Tools for C++ à partir de Binary sur Linux
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Présentation
Ce guide explique comment installer OR-Tools pour C++ sous Linux.
Bien que ces instructions puissent également fonctionner sur d'autres variantes Linux, nous
ne les ont testés que sur des machines répondant aux exigences suivantes:
Alpine Edge 64 bits (X86_64)
Centos 7 LTS 64 bits (x86_64)
SID Debian 64 bits (x86_64)
Debian 11 (bullseye) 64 bits (x86_64)
Fedora 38 64 bits (x86_64)
Fedora 37 64 bits (x86_64)
OpenSuse Leap 64 bits (x86_64)
Ubuntu 24.04 64 bits (x86_64)
Ubuntu 22.04 LTS 64 bits (x86_64)
Ubuntu 20.04 LTS 64 bits (x86_64)
Prérequis
Les sections suivantes décrivent les conditions préalables à l'installation de OR-Tools.
Outils C++
Pour installer les outils C++, ouvrez une fenêtre de terminal et saisissez:
Pour tester vos installations C++, ouvrez une fenêtre de terminal et accédez à
le répertoire dans lequel vous avez décompressé la distribution binaire. Saisissez ensuite la
la commande suivante:
maketest
Cette opération permet d'exécuter une sélection d'exemples pour OR-Tools. Si tous les exemples s'exécutent
avec succès, vous êtes prêt à
Premiers pas avec OR-Tools.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2024/08/23 (UTC).
[null,null,["Dernière mise à jour le 2024/08/23 (UTC)."],[[["\u003cp\u003eThis guide provides instructions for installing Google's OR-Tools for C++ development on various Linux distributions, specifically focusing on the x86_64 architecture.\u003c/p\u003e\n"],["\u003cp\u003eBefore installing OR-Tools, ensure you have the necessary C++ development tools installed by following the distribution-specific commands provided.\u003c/p\u003e\n"],["\u003cp\u003eDownload the pre-built binary distribution of OR-Tools for your Linux distribution and extract it to a desired location.\u003c/p\u003e\n"],["\u003cp\u003eValidate your OR-Tools installation by running the provided test suite using the \u003ccode\u003emake test\u003c/code\u003e command within the extracted directory.\u003c/p\u003e\n"]]],["This guide details installing OR-Tools for C++ on various Linux distributions (Alpine, Centos, Debian, Fedora, OpenSuse, Ubuntu) with x86_64 architecture. First, install C++ tools via terminal commands specific to each distribution, including packages like `build-essential`, `cmake`, and `gcc-c++`. Next, download and extract the appropriate OR-Tools binary from provided links based on the Linux system. Finally, validate the installation by navigating to the extracted directory and running `make test`.\n"],null,["# Installing OR-Tools for C++ from Binary on Linux\n\nIntroduction\n------------\n\nThis guide explains how to install OR-Tools for C++ on Linux.\n\nAlthough these instructions might also work on other Linux variants, we\nhave only tested them on machines meeting the following requirements:\n\n\n- Alpine Edge 64-bit (x86_64)\n- Centos 7 LTS 64-bit (x86_64)\n- Debian SID 64-bit (x86_64)\n- Debian 11 (bullseye) 64-bit (x86_64)\n- Fedora 38 64-bit (x86_64)\n- Fedora 37 64-bit (x86_64)\n- OpenSuse Leap 64-bit (x86_64)\n- Ubuntu 24.10 64-bit (x86_64)\n- Ubuntu 22.04 LTS 64-bit (x86_64)\n- Ubuntu 20.04 LTS 64-bit (x86_64)\n\n\u003cbr /\u003e\n\n| **Note:** OR-Tools only provides archives for the **x86_64** (also known as **amd64**) architecture.\n\nPrerequisites\n-------------\n\nThe following sections describe the prerequisites for installing OR-Tools.\n\n### C++ tools\n\nTo install C++ tools, open a terminal window and enter: \n\n### Alpine\n\n apk add alpine-sdk linux-headers cmake lsb-release-minimal\n\n### Centos\n\n sudo yum groupinstall -y 'Development Tools'\n sudo yum install -y pkgconfig redhat-lsb-core\n\n### Debian\n\n sudo apt update\n sudo apt install -y build-essential cmake lsb-release\n\n### Fedora\n\n sudo dnf groupinstall -y 'Development Tools'\n sudo dnf install -y gcc-c++ cmake redhat-lsb-core\n\n### Fedora\n\n sudo dnf groupinstall -y 'Development Tools'\n sudo dnf install -y gcc-c++ cmake redhat-lsb-core\n\n### OpenSUSE\n\n sudo zypper refresh\n sudo zypper install -y git gcc11 gcc11-c++ lsb-release\n\n### Ubuntu\n\n sudo apt update\n sudo apt install -y build-essential cmake lsb-release\n\n### Ubuntu\n\n sudo apt update\n sudo apt install -y build-essential cmake lsb-release\n\n### Ubuntu\n\n sudo apt update\n sudo apt install -y build-essential cmake lsb-release\n\nInstalling OR-Tools\n-------------------\n\nTake the following steps to install the OR-Tools library for C++:\n\nDownload and extract the binary distribution for your system:\n\n\n- [Almalinux 9](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_almalinux-9_cpp_v9.12.4544.tar.gz)\n- [Alpine Edge](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_alpine-edge_cpp_v9.12.4544.tar.gz)\n- [Debian Sid](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_debian-sid_cpp_v9.12.4544.tar.gz)\n- [Debian 12](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_debian-12_cpp_v9.12.4544.tar.gz)\n- [Debian 11](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_debian-11_cpp_v9.12.4544.tar.gz)\n- [Fedora 41](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_fedora-41_cpp_v9.12.4544.tar.gz)\n- [Fedora 40](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_fedora-40_cpp_v9.12.4544.tar.gz)\n- [OpenSuse Leap](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_opensuse-leap_cpp_v9.12.4544.tar.gz)\n- [Rockylinux 9](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_rockylinux-9_cpp_v9.12.4544.tar.gz)\n- [Ubuntu 24.10](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-24.10_cpp_v9.12.4544.tar.gz)\n- [Ubuntu 24.04 LTS](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-24.04_cpp_v9.12.4544.tar.gz)\n- [Ubuntu 22.04 LTS](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-22.04_cpp_v9.12.4544.tar.gz)\n- [Ubuntu 20.04 LTS](https://github.com/google/or-tools/releases/download/v9.12/or-tools_amd64_ubuntu-20.04_cpp_v9.12.4544.tar.gz)\n\n\u003cbr /\u003e\n\nValidate your installation\n--------------------------\n\nTo test your C++ installations, open a terminal window and navigate to\nthe directory where you unpacked the binary distribution. Then enter the\nfollowing command:\n\n\n make test\n\n\u003cbr /\u003e\n\nThis runs a selection of examples for OR-Tools. If all the examples run\nsuccessfully, you are ready to\n[get started with OR-Tools](../../introduction/cpp)."]]