Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Giới thiệu
Hướng dẫn này giải thích cách cài đặt OR-Tools cho C++ trên MacOS.
Mặc dù những hướng dẫn này cũng có thể áp dụng cho các biến thể MacOS khác, nhưng chúng tôi
chỉ thử nghiệm chúng trên các máy đáp ứng các yêu cầu sau:
MacOS 13.0.1 (Ventura) Intel 64 bit (x86_64)
MacOS 13.0.1 (Ventura) M1 (arm64)
Điều kiện tiên quyết
Các phần sau đây mô tả các điều kiện tiên quyết để cài đặt OR-Tools.
Công cụ dòng lệnh Xcode
Bạn phải cài đặt Công cụ dòng lệnh Xcode. Để thực hiện việc này, hãy mở
Cửa sổ dòng lệnh, có ở /Applications/Utilities/ rồi nhập:
xcode-select --install
Nhấp vào "Cài đặt" để tải xuống và cài đặt Công cụ dòng lệnh Xcode. Bạn không cần
để "Tải Xcode" từ App Store. Nếu bạn có kết nối Internet chậm,
có thể mất nhiều phút.
Xác minh rằng bạn đã cài đặt thành công Công cụ dòng lệnh Xcode:
xcode-select -p
Bạn sẽ thấy:
/Library/Developer/CommandLineTools
Cài đặt OR-Tools
Làm theo các bước sau để cài đặt thư viện OR-Tools cho C++:
Tải xuống và trích xuất bản phân phối nhị phân cho hệ thống của bạn:
Để kiểm tra các bản cài đặt C++ của bạn, hãy mở cửa sổ dòng lệnh và điều hướng đến
Thư mục nơi bạn đã giải nén bản phân phối nhị phân. Sau đó nhập
sau đây:
make test
Thao tác này sẽ chạy một tập hợp các ví dụ về Công cụ OR. Nếu tất cả các ví dụ trên chạy
thành công, bạn đã sẵn sàng
bắt đầu sử dụng OR-Tools.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2024-08-22 UTC."],[[["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"]]