> ## 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.

# Ubuntu platform

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

<Tabs>
  <Tab title="On-device Compilation">
    This section explains how to compile QIMSDK plugins directly on the **target device** running Ubuntu.

    ## Prerequisites

    Before you begin, ensure the following:

    * You have access to a Qualcomm development kit running Ubuntu Linux.
    * You have administrative privileges (sudo access) for installing packages.
    * Internet connectivity for downloading packages and source code.

    ## Steps to Compile and Install

    To download the source code and compile the sample applications, run the following commands on the Qualcomm development kit.

    <Steps>
      <Step title="Update user permissions for your session">
        ```bash theme={null} theme={null}
        sudo su
        ```
      </Step>

      <Step title="Configure Ubuntu package manager to download source code">
        ```bash theme={null} theme={null}
        apt-add-repository -s ppa:ubuntu-qcom-iot/qcom-ppa
        ```
      </Step>

      <Step title="Build the dependencies">
        ```bash theme={null} theme={null}
        apt build-dep gst-plugins-qti-oss
        ```
      </Step>

      <Step title="Change directory to home folder">
        ```bash theme={null} theme={null}
        cd /home/ubuntu
        ```
      </Step>

      <Step title="Download the sources of the QIM Package">
        ```bash theme={null} theme={null}
        apt source gst-plugins-qti-oss
        ```
      </Step>

      <Step title="Go to QIM root folder">
        For example:

        ```bash theme={null} theme={null}
        cd gst-plugins-qti-oss-1.8.1+ubuntu3
        ```
      </Step>

      <Step title="Run CMake to build and install">
        ```bash theme={null} theme={null}
        cmake -B build -S . \
           -DCMAKE_INSTALL_PREFIX=/usr \
           -DCMAKE_INSTALL_INCLUDEDIR=include \
           -DENABLE_GST_PLUGIN_BASE=1 \
           -DENABLE_GST_IMSDK_PLUGINS=1 \
           -DENABLE_GST_PLUGIN_QMMFSRC=1 \
           -DENABLE_GST_PYTHON_EXAMPLES=1 \
           -DENABLE_GST_SAMPLE_APPS=1 \
           -DENABLE_GST_TEST_FRAMEWORK=1 \
           -DENABLE_GST_PLUGIN_TOOLS=1 \
           -DENABLE_GST_PLUGIN_MLACLASSIFICATION=1 \
           -DENABLE_GST_PLUGIN_MLVCLASSIFICATION=1 \
           -DENABLE_GST_PLUGIN_MLVDETECTION=1 \
           -DENABLE_GST_PLUGIN_MLVPOSE=1 \
           -DENABLE_GST_PLUGIN_MLVSEGMENTATION=1 \
           -DENABLE_GST_PLUGIN_MLVSUPERRESOLUTION=1 \
        && cmake --build build \
        && cmake --install build
        ```
      </Step>
    </Steps>

    <Note>
      After modifying any part of the source code, re-run step 7 to rebuild and reinstall your changes.
    </Note>

    ## Steps to build custom application

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

    <Steps>
      <Step title="Create a subdirectory in gst-sample-apps">
        ```bash theme={null} theme={null}
        cd gst-plugins-qti-oss-1.8.1+ubuntu3/gst-sample-apps && mkdir gst-<your_sample_app>
        ```
      </Step>

      <Step title="Build application">
        Follow [Step 7: Run CMake to build and install](#steps-to-compile-and-install)
      </Step>
    </Steps>
  </Tab>

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