# 编译并安装示例程序

Source: [https://docs.qualcomm.com/doc/80-70015-15BY/topic/compile-reference-apps-esdk.html](https://docs.qualcomm.com/doc/80-70015-15BY/topic/compile-reference-apps-esdk.html)

1. 搭建环境：

        cd $ESDK_ROOT
        source environment-setup-armv8-2a-qcom-linuxCopy to clipboard
2. 下载示例程序源代码。

        cd $ESDK_ROOT
        devtool modify qcom-gst-ai-classificationCopy to clipboard

NOTE:Starting bitbake server...
        Loading cache:100% |######################################|时间：0:00:00 
        Loaded 9814 entries from dependency cache.
        Parsing recipes:100% |####################################|Time:0:00:01 
        Parsing of 6704 .bb  files complete (6674 cached, 30 parsed).9842 targets, 842 skipped, 0 masked, 0 errors.
        NOTE:Resolving any missing task queue dependencies 
        Initialising tasks:100% |#################################|时间：0:00:55 
        Sstate summary：Wanted 10 local 0 mirrors 0 Missed 10 Current 10 (0% match, 50% complete) 
        NOTE:Executing Tasks 
        NOTE:Tasks Summary:Attempted 93 tasks of which 90 didn't need to be rerun and all succeeded.
        INFO: Source tree extracted to /local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gst-ai-classificationCopy to clipboard

    其中 *qcom-gst-ai-classification* 是下载参考应用程序源代码的 bitbake 配方。

参考应用程序源代码将下载到 $ESDK\_ROOT/workspace/sources/qcom-gst-ai-classification。

        [/local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gst-ai-classification]$ ls 
        CMakeLists.txt main.c 
        [/local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gst-ai-classification]$Copy to clipboard
3. 定制完成后，使用以下命令重新编译示例程序。

        devtool build qcom-gst-ai-classificationCopy to clipboard

        NOTE:Starting bitbake server...
        Loading cache:100% |######################################| 
        Time:0:00:00
        Loaded 9814 entries from dependency cache.
        Parsing recipes:100% |####################################|Time:0:00:01 
        Parsing of 6704 .bb  files complete (6674 cached, 30 parsed).9842 targets, 842 skipped, 0 masked, 0 errors.
        NOTE:Resolving any missing task queue dependencies 
        Initialising tasks:100% |#################################|时间：0:00:55 
        Checking sstate mirror object availability:100% |###################|Time:0:01:06 
        Sstate Summary:Wanted 391 Local 0 Mirrors 0 Missed 391 Current 381 (0% match, 49% complete) 
        NOTE:Executing Tasks 
        NOTE: qcom-gst-ai-classification: compiling from external source tree /local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gst-ai-classification
        Copy to clipboard
4. 生成应用程序安装程序 (.ipk) 以便在设备上安装应用程序。

        devtool package qcom-gst-ai-classificationCopy to clipboard

    确认可安装软件包已位于以下路径。

        ls $ESDK_ROOT/tmp/deploy/ipk/armv8-2a | grep qcom-gst-ai-classificationCopy to clipboard

        qcom-gst-ai-classification_1.0-r0_armv8-2a.ipk 
        qcom-gst-ai-classification_dbg_1.0-r0_armv8-2a.ipk 
        qcom-gst-ai-classification_dev_1.0-r0_armv8-2a.ipk 
        qcom-gst-ai-classification_src_1.0-r0_armv8-2a.ipk 
        [/local/mnt/workspace/QIMSDK_ESDK_6490/workspace/sources/qcom-gst-ai-classification]$ Copy to clipboard
5. 复制 qcom-gst-ai-classification\_1.0-r0\_armv8-2a.ipk 到 RB3Gen2 设备以安装完成编译的参考应用程序。
6. 登录 SSH shell：

        ssh root@<IP addr of the target device>Copy to clipboard

Note: 如果提示输入密码，则输入 oelinux123 作为 SSH shell 的密码。

    在目标设备上运行以下命令。

        mount -o remount,rw /
        exit Copy to clipboard

    在主机上执行以下操作：

        cd $ESDK_ROOT/tmp/deploy/ipk/armv8-2a/
        scp qcom-gst-ai-classification_1.0-r0_armv8-2a.ipk 
        root@<IP address of the target device>:/opt/Copy to clipboard

    登录 SSH shell：

        ssh root@<IP addr of the target device>Copy to clipboard

    在目标设备上执行以下操作：

        opkg --force-depends --force-reinstall --force-overwrite install /opt/qcom-gst-ai-classification_1.0-r0_armv8-2a.ipkCopy to clipboard
7. 确认 IPK
                已经安装成功，如下所示：

        Installing qcom-gst-ai-classification (1.0) on root 
        Configuring qcom-gst-ai-classification.
        sh-5.1#Copy to clipboard

现在，从终端启动修改后的应用程序即可运行。

**例如：**

运行以下命令，以启用显示屏。

    export XDG_RUNTIME_DIR=/dev/socket/weston && export WAYLAND_DISPLAY=wayland-1Copy to clipboard

使用以下命令来运行应用程序

    /usr/bin/gst-ai-classificationCopy to clipboard

Last Published: Jan 26, 2026

[Previous Topic
编译应用程序和 Qualcomm IM SDK](https://docs.qualcomm.com/bundle/publicresource/80-70015-15BY/topics/compile-app-esdk.md) [Next Topic
编译并安装 Qualcomm IM SDK 插件](https://docs.qualcomm.com/bundle/publicresource/80-70015-15BY/topics/esdk-compile-qimsdk-plugins.md)