> ## Documentation Index
> Fetch the complete documentation index at: https://imsdkdocs.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="Download SDK">
        <Tabs>
          <Tab title="x86 Host">
            ```bash theme={null} theme={null}
            wget -O sdk.zip https://artifacts.codelinaro.org/artifactory/qli-ci/flashable-binaries/meta-qcom/qcom-armv8a/x86-qli-2.0-standardsdk.zip
            ```
          </Tab>

          <Tab title="Arm Host">
            ```bash theme={null} theme={null}
            wget -O sdk.zip https://artifacts.codelinaro.org/artifactory/qli-ci/flashable-binaries/meta-qcom/qcom-armv8a/arm-qli-2.0-standardsdk.zip
            ```
          </Tab>
        </Tabs>
      </Step>

      <Step title="Extract and Install the SDK">
        ```bash theme={null} theme={null}
        unzip sdk.zip && cd images/qcom-armv8a/sdk/
        ```

        <Tabs>
          <Tab title="x86 Host">
            ```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
            ```
          </Tab>

          <Tab title="Arm Host">
            ```bash theme={null} theme={null}
            bash qcom-distro-aarch64-qcom-multimedia-proprietary-image-armv8a-qcom-armv8a-toolchain-2.0.sh -d <path_to_install_sdk> -y
            ```
          </Tab>
        </Tabs>
      </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

    Go through the [prerequisites](#prerequisites) and [Steps to Compile](#steps-to-compile) section before starting this.

    <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">
        Follow [Step 2: Run CMake to generate the Makefile and build](#steps-to-compile)
      </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>
