在 MacOS 上从二进制文件安装适用于 C++ 的 OR 工具
简介
本指南介绍了如何在 MacOS 上安装适用于 C++ 的 OR-Tools。
虽然这些说明可能也适用于其他 MacOS 版本,
仅在满足以下要求的计算机上进行了测试:
- MacOS 13.0.1 (Ventura) Intel 64 位 (x86_64)
- MacOS 13.0.1 (Ventura) M1 (arm64)
前提条件
以下各部分介绍了安装 OR-Tools 的前提条件。
您必须安装 Xcode 命令行工具。为此,请打开
终端,可在 /Applications/Utilities/
中找到,然后输入:
xcode-select --install
点击“安装”以下载并安装 Xcode 命令行工具。您不需要
点击“获取 Xcode”下载该应用如果您的互联网连接速度很慢,
可能需要几分钟时间
验证您已成功安装 Xcode 命令行工具:
xcode-select -p
您应该会看到:
/Library/Developer/CommandLineTools
请按照以下步骤安装适用于 C++ 的 OR-Tools 库:
下载并解压缩适用于您系统的二进制发行版:
验证您的安装情况
如需测试 C++ 安装,请打开终端窗口并转到
解压缩二进制发行版的目录。然后输入
以下命令:
make test
这会为 OR-Tools 运行一系列示例。如果所有示例都运行
您就可以
开始使用 OR 工具。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-22。
[null,null,["最后更新时间 (UTC):2024-08-22。"],[[["This guide provides step-by-step instructions for installing OR-Tools for C++ on MacOS 13.0.1 (Ventura), specifically for Intel 64-bit and M1 architectures."],["Before installing OR-Tools, ensure you have Xcode Command Line Tools installed by running `xcode-select --install` in the Terminal."],["Download the appropriate OR-Tools binary distribution for your system (Intel or M1) from the provided links and extract it."],["Validate your OR-Tools installation by navigating to the extracted directory in the terminal and running the command `make test`."],["Upon successful installation and validation, you can proceed to utilize OR-Tools for your C++ projects."]]],["To install OR-Tools for C++ on MacOS, first install Xcode Command Line Tools by running `xcode-select --install` in the terminal and verifying with `xcode-select -p`. Next, download and extract the OR-Tools binary distribution for either MacOS Intel or M1. Finally, validate the installation by navigating to the extracted directory in the terminal and running `make test`. Successful completion indicates OR-Tools is ready for use.\n"]]