# 使用 Github 编译（基础层）

Source: [https://docs.qualcomm.com/doc/80-65220-2Y/topic/build-with-github-binaries.html](https://docs.qualcomm.com/doc/80-65220-2Y/topic/build-with-github-binaries.html)

使用详细说明来同步和编译 QIRP SDK 的基础层，并使用运行所有示例程序所需的二进制文件。

**前提条件：**

- 确保您已根据[主机设置](https://docs.qualcomm.com/bundle/publicresource/topics/80-70014-254/github_workflow_unregistered_users.html#build_with_standalone_commands_unreg)部署主机。

Note:
- 对于 QIRP SDK，您可以按照以下步骤中的描述**以独立命令进行编译**。
- 当前发行版本不支持**使用 Dockerfile 进行编译**。

## 下载基础层

下载 QIRP SDK 的所有基础层。

### 方法 1：使用 manifest 下载

- 通过运行以下命令下载 QIRP SDK 的层。

Note: 要获取最新 `<robotics-release-manifest>`，参见 [Qualcomm® Linux Intelligent Robotics Product SDK (QIRP SDK) 2.0 发行说明](https://docs.qualcomm.com/bundle/publicresource/topics/80-75695-1)。

        cd <workspace>
        repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-kirkstone -m <robotics-release-manifest>
        repo sync -c -j8Copy to clipboard

    **示例：**

    要下载“`qcom-6.6.28-QLI.1.1-Ver.1.1_robotics-product-sdk-1.1`”发行版本，运行此命令：

        repo init -u https://github.com/quic-yocto/qcom-manifest -b qcom-linux-kirkstone -m qcom-6.6.28-QLI.1.1-Ver.1.1_robotics-product-sdk-1.1.xml
        repo sync -c -j8Copy to clipboard

    **结果：**以下层已下载。

        meta-qcom
        meta-qcom-hwe
        meta-qcom-distro
        meta-ros
        meta-qcom-robotics
        meta-qcom-robotics-distro
        meta-qcom-robotics-sdk
        meta-qcom-qim-product-sdkCopy to clipboard

### 方法 2：使用“git clone”命令下载

1. 按照 [Qualcomm Repo Manifest README 文件](https://github.com/quic-yocto/qcom-manifest/blob/qcom-linux-kirkstone/README.md)的说明，搭建主机环境并同步最新 Yocto 项目 BSP。
2. 基于下载的 Yocto 项目 BSP 的 `<workspace>` 目录，下载 QIRP SDK 的各层。

        cd <workspace>
        git clone https://git.codelinaro.org/clo/le/meta-ros.git -b ros.qclinux.1.0.r1-rel layers/meta-ros
        git clone https://github.com/quic-yocto/meta-qcom-robotics.git layers/meta-qcom-robotics
        git clone https://github.com/quic-yocto/meta-qcom-robotics-distro.git layers/meta-qcom-robotics-distro
        git clone https://github.com/quic-yocto/meta-qcom-robotics-sdk.git layers/meta-qcom-robotics-sdk
        git clone https://github.com/quic-yocto/meta-qcom-qim-product-sdk layers/meta-qcom-qim-product-sdkCopy to clipboard

**结果：**
    [方法 1：使用 manifest 下载](https://docs.qualcomm.com/doc/80-65220-2Y/topic/using-detailed-instructions_3_2.html#ID-concept-download-src__section_bhb_qzk_4bc) 中所述的层已下载。

## 编译 QIRP SDK

Source: [https://docs.qualcomm.com/doc/80-65220-2Y/topic/build-with-github-binaries.html](https://docs.qualcomm.com/doc/80-65220-2Y/topic/build-with-github-binaries.html)

描述如何编译 QIRP SDK。

### Procedure

1. 搭建编译环境。
        
- 如果使用**选项 1：使用 manifest 下载**（在[下载基础层](https://docs.qualcomm.com/doc/80-65220-2Y/topic/build-with-github-binaries.html#download-binaries)中），执行以下命令：

            cd <workspace>
            MACHINE=qcm6490 DISTRO=qcom-robotics-ros2-humble source setup-robotics-environmentCopy to clipboard
    - 如果使用**选项 2：使用“git clone”命令下载**（在[下载基础层](https://docs.qualcomm.com/doc/80-65220-2Y/topic/build-with-github-binaries.html#download-binaries)中），执行以下命令：

            cd <workspace>
            ln -s layers/meta-qcom-robotics-distro/set_bb_env.sh ./setup-robotics-environment
            ln -s layers/meta-qcom-robotics-sdk/scripts/qirp-build ./qirp-build
            MACHINE=qcm6490 DISTRO=qcom-robotics-ros2-humble source setup-robotics-environmentCopy to clipboard
2. 编译机器人镜像和 QIRP SDK 组件。
        
../qirp-build qcom-robotics-full-imageCopy to clipboard

**编译结果：**

    - QIRP SDK artifacts： `<workspace>/build-qcom-robotics-ros2-humble/tmp-glibc/deploy/qirpsdk_artifacts/qirp-sdk_<version>.tar.gz`
    - 机器人镜像： `<workspace>/build-qcom-robotics-ros2-humble/tmp-glibc/deploy/images/qcm6490/qcom-robotics-full-image`

Last Published: Aug 09, 2024

[Previous Topic
使用 QSC-CLI 编译](https://docs.qualcomm.com/bundle/publicresource/80-65220-2Y/topics/using-qsc-cli_3_1.md) [Next Topic
使用 Github 编译（固件和附加功能）](https://docs.qualcomm.com/bundle/publicresource/80-65220-2Y/topics/using-detailed-instructions_3_2.md)