การติดตั้ง OR-เครื่องมือสำหรับ C++ จากไบนารีใน MacOS
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
บทนำ
คำแนะนำนี้จะอธิบายวิธีติดตั้ง OR-Tools สำหรับ C++ ใน MacOS
แม้ว่าคำแนะนำเหล่านี้อาจใช้ได้กับตัวแปร 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" จาก App Store หากมีการเชื่อมต่ออินเทอร์เน็ตช้า
อาจใช้เวลานานหลายนาที
ตรวจสอบว่าคุณได้ติดตั้งเครื่องมือบรรทัดคำสั่ง Xcode สำเร็จแล้วดังนี้
xcode-select -p
คุณควรจะเห็นสิ่งต่อไปนี้
/Library/Developer/CommandLineTools
ทำตามขั้นตอนต่อไปนี้เพื่อติดตั้งไลบรารี OR-Tools สำหรับ C++
ดาวน์โหลดและดึงข้อมูลการกระจายแบบไบนารีสำหรับระบบของคุณ ดังนี้
ตรวจสอบความถูกต้องของการติดตั้ง
หากต้องการทดสอบการติดตั้ง C++ ให้เปิดหน้าต่างเทอร์มินัลและไปยัง
ไดเรกทอรีที่คุณคลายการแพคข้อมูลการกระจายไบนารี จากนั้นป้อน
คำสั่งต่อไปนี้
make test
การดำเนินการนี้จะเรียกใช้ตัวอย่างสำหรับ OR-Tools หากตัวอย่างทั้งหมดทํางาน
เรียบร้อยแล้ว คุณก็พร้อมที่จะ
เริ่มต้นใช้งาน OR-Tools
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-08-22 UTC
[null,null,["อัปเดตล่าสุด 2024-08-22 UTC"],[[["\u003cp\u003eThis 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.\u003c/p\u003e\n"],["\u003cp\u003eBefore installing OR-Tools, ensure you have Xcode Command Line Tools installed by running \u003ccode\u003excode-select --install\u003c/code\u003e in the Terminal.\u003c/p\u003e\n"],["\u003cp\u003eDownload the appropriate OR-Tools binary distribution for your system (Intel or M1) from the provided links and extract it.\u003c/p\u003e\n"],["\u003cp\u003eValidate your OR-Tools installation by navigating to the extracted directory in the terminal and running the command \u003ccode\u003emake test\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful installation and validation, you can proceed to utilize OR-Tools for your C++ projects.\u003c/p\u003e\n"]]],["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"],null,["# Installing OR-Tools for C++ from Binary on MacOS\n\nIntroduction\n------------\n\nThis guide explains how to install OR-Tools for C++ on MacOS.\n\nAlthough these instructions might also work on other MacOS variants, we\nhave only tested them on machines meeting the following requirements:\n\n\n- MacOS 13.0.1 (Ventura) Intel 64-bit (x86_64)\n- MacOS 13.0.1 (Ventura) M1 (arm64)\n\n\u003cbr /\u003e\n\nPrerequisites\n-------------\n\nThe following sections describe the prerequisites for installing OR-Tools.\n\n### Xcode Command Line Tools\n\nYou must install the *Xcode Command Line Tools* . To do so, open the\nTerminal, found in `/Applications/Utilities/`, and enter: \n\n xcode-select --install\n\nClick \"Install\" to download and install Xcode Command Line Tools. You don't need\nto \"Get Xcode\" from the App Store. If you have a slow Internet connection, it\nmay take many minutes.\n\nVerify that you've successfully installed Xcode Command Line Tools: \n\n xcode-select -p\n\nYou should see: \n\n /Library/Developer/CommandLineTools\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- [MacOS Intel](https://github.com/google/or-tools/releases/download/v9.12/or-tools_x86_64_macOS-15.3.1_cpp_v9.12.4544.tar.gz)\n- [MacOS M1](https://github.com/google/or-tools/releases/download/v9.12/or-tools_arm64_macOS-15.3.1_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)."]]