> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Yocto platform

This section explains how to compile QIMSDK plugins for Yocto platform.

<Tabs>
  <Tab title="On-host Compilation">
    This section explains how to compile QIMSDK plugins directly on a x86 host machine running Ubuntu.

    ## Prerequisites

    Before you begin, ensure the following:

    * Internet connectivity for downloading packages and source code.
    * Sufficient space on the host to download the SDK. Upto \~5GB.

    ## Download and install the sdk.

    <Steps>
      <Step title="Get the latest Nightly Build (wrynose) from the below link">
        ```bash theme={null} theme={null}
        https://github.com/qualcomm-linux/meta-qcom/actions/workflows/nightly-build.yml
        ```
      </Step>

      <Step title="Download SDK">
        ```bash theme={null} theme={null}
        Locate the “build-nightly / publish_summary summary” section within the
        workflow results.
        ```

        ```bash theme={null} theme={null}
        Expand the “Download URLs Details” section.
        ```

        ```bash theme={null} theme={null}
        Under the qcom-distro-sdk distribution for the qcom‑armv8a target,
        click on the “Files” link.
        ```

        ```bash theme={null} theme={null}
        In the file list, use the “Type” filter to select .sh files, then download:
        qcom-distro-x86_64-qcom-multimedia-proprietary-image-armv8a-qcom-armv8a-toolchain-2.0.sh
        ```
      </Step>

      <Step title="Extract and Install the SDK">
        ```bash theme={null} theme={null}
        bash qcom-distro-x86_64-qcom-multimedia-proprietary-image-armv8a-qcom-armv8a-toolchain-2.0.sh -d <path_to_install_sdk> -y
        ```
      </Step>

      <Step title="Source the cross-compilation toolchain environment">
        ```bash theme={null} theme={null}
        source <path_to_install_sdk>/environment-setup-armv8a-qcom-linux
        ```
      </Step>
    </Steps>

    <Note>
      Each time you wish to use the SDK in a new shell session, you need to source the environment setup script in Step 4.
    </Note>

    ## Steps to Compile

    To download the source code and compile the sample applications, run the following commands.

    <Steps>
      <Step title="Clone the sources from github">
        ```bash theme={null} theme={null}
        git clone https://github.com/qualcomm/gst-plugins-imsdk.git
        cd gst-plugins-imsdk
        ```
      </Step>

      <Step title="Run CMake to generate the Makefile and build">
        ```bash theme={null} theme={null}
        cmake -B build -S . \
          -DCMAKE_INSTALL_PREFIX=/usr \
          -DENABLE_GST_IMSDK_PLUGINS=1 \
          -DENABLE_GST_PLUGIN_MLTFLITE=1 \
          -DENABLE_GST_PYTHON_EXAMPLES=1 \
          -DENABLE_GST_SAMPLE_APPS=1 \
          -DENABLE_GST_SAMPLE_APPS_CAMERA=1 \
          -DENABLE_GST_PLUGIN_TOOLS=1 \
          -DENABLE_GST_CAMERA_PLUGINS=1 \
        && cmake --build build
        ```
      </Step>
    </Steps>

    <Note>
      After modifying any part of the source code, re-run step 2 to rebuild your changes.
      The corresponding libs from build directory can then be copied on to device.
    </Note>

    ## Steps to build custom application

    <Steps>
      <Step title="Create a subdirectory in gst-sample-apps">
        ```bash theme={null} theme={null}
        cd gst-plugins-imsdk/gst-sample-apps && mkdir gst-<your_sample_apps>
        ```
      </Step>

      <Step title="Build the application">
        Goto [Steps to Compile and Install](#steps-to-compile-and-install) section and follow step 2: "Run CMake to generate the Makefile and build"
      </Step>

      <Step title="Copy the binary to target device">
        ```bash theme={null} theme={null}
        #The application will be found in the below location
        gst-plugins-imsdk/build/gst-sample-apps/gst-<your_sample_apps>/
        ```
      </Step>
    </Steps>
  </Tab>

  <Tab title="On-device Compilation">
    <Note>
      On-device compilation for Yocto is not yet available in this documentation. Please refer to the on-host compilation instructions.
    </Note>
  </Tab>
</Tabs>
