From 40f581b702c2b2c5a6d979fdc7efbfa04fd802f3 Mon Sep 17 00:00:00 2001 From: Chen Lai Date: Fri, 20 Jun 2025 14:16:02 -0700 Subject: [PATCH 1/4] Install libcpp from release package other than apt-get Differential Revision: [D77048745](https://our.internmc.facebook.com/intern/diff/D77048745/) [ghstack-poisoned] --- .ci/scripts/setup-qnn-deps.sh | 129 +++++++++++++++---- backends/qualcomm/scripts/install_qnn_sdk.sh | 17 +++ 2 files changed, 118 insertions(+), 28 deletions(-) create mode 100644 backends/qualcomm/scripts/install_qnn_sdk.sh diff --git a/.ci/scripts/setup-qnn-deps.sh b/.ci/scripts/setup-qnn-deps.sh index 45588e291e9..d41b9c40547 100644 --- a/.ci/scripts/setup-qnn-deps.sh +++ b/.ci/scripts/setup-qnn-deps.sh @@ -1,19 +1,55 @@ #!/bin/bash -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the BSD-style license found in the -# LICENSE file in the root directory of this source tree. - set -ex +# Function to install Android NDK (only if not already set) +setup_android_ndk() { + # Check if ANDROID_NDK_ROOT is already set and valid + if [ -n "${ANDROID_NDK_ROOT}" ] && [ -d "${ANDROID_NDK_ROOT}" ]; then + echo "Android NDK already set to ${ANDROID_NDK_ROOT} - skipping installation" + return + fi + + NDK_VERSION="r25c" + NDK_INSTALL_DIR="/tmp/android-ndk" + + if [ -d "${NDK_INSTALL_DIR}/ndk" ]; then + echo "Android NDK already installed at ${NDK_INSTALL_DIR}/ndk" + export ANDROID_NDK_ROOT="${NDK_INSTALL_DIR}/ndk" + return + fi + + echo "Installing Android NDK ${NDK_VERSION}" + mkdir -p "${NDK_INSTALL_DIR}" + NDK_ZIP="android-ndk-${NDK_VERSION}-linux.zip" + + curl -Lo "/tmp/${NDK_ZIP}" "https://dl.google.com/android/repository/${NDK_ZIP}" + unzip -q "/tmp/${NDK_ZIP}" -d "${NDK_INSTALL_DIR}" + mv "${NDK_INSTALL_DIR}/android-ndk-${NDK_VERSION}" "${NDK_INSTALL_DIR}/ndk" + + export ANDROID_NDK_ROOT="${NDK_INSTALL_DIR}/ndk" + echo "Android NDK installed to ${ANDROID_NDK_ROOT}" +} + verify_pkg_installed() { - echo $(dpkg-query -W --showformat='${Status}\n' $1|grep "install ok installed") + dpkg-query -W --showformat='${Status}\n' "$1" | grep -q "install ok installed" } install_qnn() { + # Check if QNN_SDK_ROOT is already set and valid + if [ -n "${QNN_SDK_ROOT}" ] && [ -d "${QNN_SDK_ROOT}" ]; then + echo "QNN SDK already set to ${QNN_SDK_ROOT} - skipping installation" + return + fi + echo "Start installing qnn." - QNN_INSTALLATION_DIR=/tmp/qnn + QNN_INSTALLATION_DIR="/tmp/qnn" + + # Clean up any previous installation + if [ -d "${QNN_INSTALLATION_DIR}" ]; then + echo "Removing previous QNN installation at ${QNN_INSTALLATION_DIR}" + rm -rf "${QNN_INSTALLATION_DIR}" + fi + mkdir -p "${QNN_INSTALLATION_DIR}" curl -Lo /tmp/v2.28.0.24.10.29.zip "https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v2.28.0.241029.zip" @@ -21,33 +57,70 @@ install_qnn() { unzip -qo /tmp/v2.28.0.24.10.29.zip -d /tmp echo "Finishing unzip qnn sdk." - # Print the content for manual verification + echo "Contents of /tmp/qairt:" ls -lah "/tmp/qairt" - mv "/tmp/qairt"/* "${QNN_INSTALLATION_DIR}" - echo "Finishing installing qnn '${QNN_INSTALLATION_DIR}' ." + # Check if we're moving a directory or files + if [ -d "/tmp/qairt/2.28.0.241029" ]; then + # Move the specific version directory instead of its contents + mv "/tmp/qairt/2.28.0.241029" "${QNN_INSTALLATION_DIR}" + else + # Move all contents normally + mv "/tmp/qairt"/* "${QNN_INSTALLATION_DIR}" + fi + + echo "Finishing installing qnn '${QNN_INSTALLATION_DIR}' ." + echo "Final QNN installation contents:" ls -lah "${QNN_INSTALLATION_DIR}" + + # Set QNN_SDK_ROOT environment variable + export QNN_SDK_ROOT="${QNN_INSTALLATION_DIR}" + echo "Set QNN_SDK_ROOT=${QNN_SDK_ROOT}" } -setup_libc++() { +setup_libcpp() { clang_version=$1 - sudo apt-get update - pkgs_to_check=("libc++-${clang_version}-dev") - j=0 - while [ $j -lt ${#pkgs_to_check[*]} ]; do - install_status=$(verify_pkg_installed ${pkgs_to_check[$j]}) - if [ "$install_status" == "" ]; then - sudo apt-get install -y ${pkgs_to_check[$j]} - if [[ $? -ne 0 ]]; then - echo "ERROR: Failed to install required packages for libc++" - exit 1 - fi - fi - j=$(( $j +1)); - done + LLVM_VERSION="12.0.0" + INSTALL_DIR="/usr/local/libcxx-${LLVM_VERSION}" + + echo "Installing libc++-${clang_version}-dev manually from LLVM releases" + + # Create temporary directory + TEMP_DIR=$(mktemp -d) + pushd "${TEMP_DIR}" + + # Download and extract LLVM binaries + LLVM_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-20.04.tar.xz" + curl -LO "${LLVM_URL}" + tar -xf "clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-20.04.tar.xz" + + # Create necessary directories + sudo mkdir -p "${INSTALL_DIR}/include" + sudo mkdir -p "${INSTALL_DIR}/lib" # FIX: Create lib directory + + # Copy libc++ headers and libraries + sudo cp -r clang+llvm*/include/c++/v1/* "${INSTALL_DIR}/include/" + sudo cp -r clang+llvm*/lib/*.so* "${INSTALL_DIR}/lib/" + + # Create system symlinks + sudo mkdir -p /usr/include/c++ + sudo ln -sf "${INSTALL_DIR}/include" /usr/include/c++/v1 + sudo ln -sf "${INSTALL_DIR}/lib/libc++.so.1.0" /usr/lib/libc++.so.1 + sudo ln -sf "${INSTALL_DIR}/lib/libc++.so.1" /usr/lib/libc++.so + sudo ln -sf "${INSTALL_DIR}/lib/libc++abi.so.1.0" /usr/lib/libc++abi.so.1 + sudo ln -sf "${INSTALL_DIR}/lib/libc++abi.so.1" /usr/lib/libc++abi.so + + # Update library cache + sudo ldconfig + + # Cleanup + popd + rm -rf "${TEMP_DIR}" + + echo "libc++-${clang_version}-dev installed to ${INSTALL_DIR}" } -# This needs to match with the clang version from the Docker image -setup_libc++ 12 +# Main execution flow +setup_libcpp 12 install_qnn diff --git a/backends/qualcomm/scripts/install_qnn_sdk.sh b/backends/qualcomm/scripts/install_qnn_sdk.sh new file mode 100644 index 00000000000..c653955fada --- /dev/null +++ b/backends/qualcomm/scripts/install_qnn_sdk.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +# Test the end-to-end flow of mps runner. + +set -e + +# shellcheck source=/dev/null +source "$(dirname "${BASH_SOURCE[0]}")/../../../.ci/scripts/setup-qnn-deps.sh" + +setup_libcpp 12 +setup_android_ndk +install_qnn From e2350e2a42ac51886d38f4b2f19d23a4f282b906 Mon Sep 17 00:00:00 2001 From: Chen Lai Date: Sun, 22 Jun 2025 14:20:14 -0700 Subject: [PATCH 2/4] Update on "Install libcpp from release package other than apt-get" A few changes 1. Use the release package from https://releases.llvm.org/ to install libcpp, so we can install from different linux in addition to Ubuntu 2. Seperate out the qnn version and the url to a seperate file, for better versin management in the future Differential Revision: [D77048745](https://our.internmc.facebook.com/intern/diff/D77048745/) Differential Revision: [D77048745](https://our.internmc.facebook.com/intern/diff/D77048745) [ghstack-poisoned] --- .ci/scripts/setup-qnn-deps.sh | 127 +------------------ backends/qualcomm/scripts/install_qnn_sdk.sh | 125 +++++++++++++++++- backends/qualcomm/scripts/qnn_config.sh | 10 ++ 3 files changed, 138 insertions(+), 124 deletions(-) create mode 100644 backends/qualcomm/scripts/qnn_config.sh diff --git a/.ci/scripts/setup-qnn-deps.sh b/.ci/scripts/setup-qnn-deps.sh index d41b9c40547..6e6cf7a73ab 100644 --- a/.ci/scripts/setup-qnn-deps.sh +++ b/.ci/scripts/setup-qnn-deps.sh @@ -1,126 +1,13 @@ #!/bin/bash -set -ex - -# Function to install Android NDK (only if not already set) -setup_android_ndk() { - # Check if ANDROID_NDK_ROOT is already set and valid - if [ -n "${ANDROID_NDK_ROOT}" ] && [ -d "${ANDROID_NDK_ROOT}" ]; then - echo "Android NDK already set to ${ANDROID_NDK_ROOT} - skipping installation" - return - fi - - NDK_VERSION="r25c" - NDK_INSTALL_DIR="/tmp/android-ndk" - - if [ -d "${NDK_INSTALL_DIR}/ndk" ]; then - echo "Android NDK already installed at ${NDK_INSTALL_DIR}/ndk" - export ANDROID_NDK_ROOT="${NDK_INSTALL_DIR}/ndk" - return - fi - - echo "Installing Android NDK ${NDK_VERSION}" - mkdir -p "${NDK_INSTALL_DIR}" - NDK_ZIP="android-ndk-${NDK_VERSION}-linux.zip" - - curl -Lo "/tmp/${NDK_ZIP}" "https://dl.google.com/android/repository/${NDK_ZIP}" - unzip -q "/tmp/${NDK_ZIP}" -d "${NDK_INSTALL_DIR}" - mv "${NDK_INSTALL_DIR}/android-ndk-${NDK_VERSION}" "${NDK_INSTALL_DIR}/ndk" - - export ANDROID_NDK_ROOT="${NDK_INSTALL_DIR}/ndk" - echo "Android NDK installed to ${ANDROID_NDK_ROOT}" -} - -verify_pkg_installed() { - dpkg-query -W --showformat='${Status}\n' "$1" | grep -q "install ok installed" -} - -install_qnn() { - # Check if QNN_SDK_ROOT is already set and valid - if [ -n "${QNN_SDK_ROOT}" ] && [ -d "${QNN_SDK_ROOT}" ]; then - echo "QNN SDK already set to ${QNN_SDK_ROOT} - skipping installation" - return - fi - - echo "Start installing qnn." - QNN_INSTALLATION_DIR="/tmp/qnn" - - # Clean up any previous installation - if [ -d "${QNN_INSTALLATION_DIR}" ]; then - echo "Removing previous QNN installation at ${QNN_INSTALLATION_DIR}" - rm -rf "${QNN_INSTALLATION_DIR}" - fi - - mkdir -p "${QNN_INSTALLATION_DIR}" - - curl -Lo /tmp/v2.28.0.24.10.29.zip "https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v2.28.0.241029.zip" - echo "Finishing downloading qnn sdk." - unzip -qo /tmp/v2.28.0.24.10.29.zip -d /tmp - echo "Finishing unzip qnn sdk." +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. - # Print the content for manual verification - echo "Contents of /tmp/qairt:" - ls -lah "/tmp/qairt" - - # Check if we're moving a directory or files - if [ -d "/tmp/qairt/2.28.0.241029" ]; then - # Move the specific version directory instead of its contents - mv "/tmp/qairt/2.28.0.241029" "${QNN_INSTALLATION_DIR}" - else - # Move all contents normally - mv "/tmp/qairt"/* "${QNN_INSTALLATION_DIR}" - fi - - echo "Finishing installing qnn '${QNN_INSTALLATION_DIR}' ." - echo "Final QNN installation contents:" - ls -lah "${QNN_INSTALLATION_DIR}" - - # Set QNN_SDK_ROOT environment variable - export QNN_SDK_ROOT="${QNN_INSTALLATION_DIR}" - echo "Set QNN_SDK_ROOT=${QNN_SDK_ROOT}" -} - -setup_libcpp() { - clang_version=$1 - LLVM_VERSION="12.0.0" - INSTALL_DIR="/usr/local/libcxx-${LLVM_VERSION}" - - echo "Installing libc++-${clang_version}-dev manually from LLVM releases" - - # Create temporary directory - TEMP_DIR=$(mktemp -d) - pushd "${TEMP_DIR}" - - # Download and extract LLVM binaries - LLVM_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-20.04.tar.xz" - curl -LO "${LLVM_URL}" - tar -xf "clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-20.04.tar.xz" - - # Create necessary directories - sudo mkdir -p "${INSTALL_DIR}/include" - sudo mkdir -p "${INSTALL_DIR}/lib" # FIX: Create lib directory - - # Copy libc++ headers and libraries - sudo cp -r clang+llvm*/include/c++/v1/* "${INSTALL_DIR}/include/" - sudo cp -r clang+llvm*/lib/*.so* "${INSTALL_DIR}/lib/" - - # Create system symlinks - sudo mkdir -p /usr/include/c++ - sudo ln -sf "${INSTALL_DIR}/include" /usr/include/c++/v1 - sudo ln -sf "${INSTALL_DIR}/lib/libc++.so.1.0" /usr/lib/libc++.so.1 - sudo ln -sf "${INSTALL_DIR}/lib/libc++.so.1" /usr/lib/libc++.so - sudo ln -sf "${INSTALL_DIR}/lib/libc++abi.so.1.0" /usr/lib/libc++abi.so.1 - sudo ln -sf "${INSTALL_DIR}/lib/libc++abi.so.1" /usr/lib/libc++abi.so - - # Update library cache - sudo ldconfig - - # Cleanup - popd - rm -rf "${TEMP_DIR}" +set -ex - echo "libc++-${clang_version}-dev installed to ${INSTALL_DIR}" -} +source "$(dirname "${BASH_SOURCE[0]}")/../../../backends/qualcomm/scripts/install_qnn_sdk.sh" -# Main execution flow setup_libcpp 12 install_qnn diff --git a/backends/qualcomm/scripts/install_qnn_sdk.sh b/backends/qualcomm/scripts/install_qnn_sdk.sh index c653955fada..e52cd435b20 100644 --- a/backends/qualcomm/scripts/install_qnn_sdk.sh +++ b/backends/qualcomm/scripts/install_qnn_sdk.sh @@ -5,12 +5,129 @@ # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. -# Test the end-to-end flow of mps runner. +set -ex -set -e +# Source QNN configuration +source "$(dirname "$0")/qnn_config.sh" -# shellcheck source=/dev/null -source "$(dirname "${BASH_SOURCE[0]}")/../../../.ci/scripts/setup-qnn-deps.sh" +# Function to install Android NDK (only if not already set) +setup_android_ndk() { + # Check if ANDROID_NDK_ROOT is already set and valid + if [ -n "${ANDROID_NDK_ROOT}" ] && [ -d "${ANDROID_NDK_ROOT}" ]; then + echo "Android NDK already set to ${ANDROID_NDK_ROOT} - skipping installation" + return + fi + + NDK_VERSION="r25c" + NDK_INSTALL_DIR="/tmp/android-ndk" + + if [ -d "${NDK_INSTALL_DIR}/ndk" ]; then + echo "Android NDK already installed at ${NDK_INSTALL_DIR}/ndk" + export ANDROID_NDK_ROOT="${NDK_INSTALL_DIR}/ndk" + return + fi + + echo "Installing Android NDK ${NDK_VERSION}" + mkdir -p "${NDK_INSTALL_DIR}" + NDK_ZIP="android-ndk-${NDK_VERSION}-linux.zip" + + curl -Lo "/tmp/${NDK_ZIP}" "https://dl.google.com/android/repository/${NDK_ZIP}" + unzip -q "/tmp/${NDK_ZIP}" -d "${NDK_INSTALL_DIR}" + mv "${NDK_INSTALL_DIR}/android-ndk-${NDK_VERSION}" "${NDK_INSTALL_DIR}/ndk" + + export ANDROID_NDK_ROOT="${NDK_INSTALL_DIR}/ndk" + echo "Android NDK installed to ${ANDROID_NDK_ROOT}" +} + +verify_pkg_installed() { + dpkg-query -W --showformat='${Status}\n' "$1" | grep -q "install ok installed" +} + +install_qnn() { + # Check if QNN_SDK_ROOT is already set and valid + if [ -n "${QNN_SDK_ROOT}" ] && [ -d "${QNN_SDK_ROOT}" ]; then + echo "QNN SDK already set to ${QNN_SDK_ROOT} - skipping installation" + return + fi + + echo "Start installing qnn v${QNN_VERSION}" + QNN_INSTALLATION_DIR="/tmp/qnn" + + # Clean up any previous installation + if [ -d "${QNN_INSTALLATION_DIR}" ]; then + echo "Removing previous QNN installation at ${QNN_INSTALLATION_DIR}" + rm -rf "${QNN_INSTALLATION_DIR}" + fi + + mkdir -p "${QNN_INSTALLATION_DIR}" + + QNN_ZIP_FILE="v${QNN_VERSION}.zip" + curl -Lo "/tmp/${QNN_ZIP_FILE}" "${QNN_ZIP_URL}" + echo "Finishing downloading qnn sdk." + unzip -qo "/tmp/${QNN_ZIP_FILE}" -d /tmp + echo "Finishing unzip qnn sdk." + + # Print the content for manual verification + echo "Contents of /tmp/qairt:" + ls -lah "/tmp/qairt" + + # Move the specific version directory + if [ -d "/tmp/qairt/${QNN_VERSION}" ]; then + mv "/tmp/qairt/${QNN_VERSION}" "${QNN_INSTALLATION_DIR}" + else + mv "/tmp/qairt"/* "${QNN_INSTALLATION_DIR}" + fi + + echo "Finishing installing qnn '${QNN_INSTALLATION_DIR}' ." + echo "Final QNN installation contents:" + ls -lah "${QNN_INSTALLATION_DIR}" + + # Set QNN_SDK_ROOT environment variable + export QNN_SDK_ROOT="${QNN_INSTALLATION_DIR}" + echo "Set QNN_SDK_ROOT=${QNN_SDK_ROOT}" +} + +setup_libcpp() { + clang_version=$1 + LLVM_VERSION="12.0.0" + INSTALL_DIR="/usr/local/libcxx-${LLVM_VERSION}" + + echo "Installing libc++-${clang_version}-dev manually from LLVM releases" + + # Create temporary directory + TEMP_DIR=$(mktemp -d) + pushd "${TEMP_DIR}" + + # Download and extract LLVM binaries + LLVM_URL="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-20.04.tar.xz" + curl -LO "${LLVM_URL}" + tar -xf "clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-20.04.tar.xz" + + # Create necessary directories + sudo mkdir -p "${INSTALL_DIR}/include" + sudo mkdir -p "${INSTALL_DIR}/lib" # FIX: Create lib directory + + # Copy libc++ headers and libraries + sudo cp -r clang+llvm*/include/c++/v1/* "${INSTALL_DIR}/include/" + sudo cp -r clang+llvm*/lib/*.so* "${INSTALL_DIR}/lib/" + + # Create system symlinks + sudo mkdir -p /usr/include/c++ + sudo ln -sf "${INSTALL_DIR}/include" /usr/include/c++/v1 + sudo ln -sf "${INSTALL_DIR}/lib/libc++.so.1.0" /usr/lib/libc++.so.1 + sudo ln -sf "${INSTALL_DIR}/lib/libc++.so.1" /usr/lib/libc++.so + sudo ln -sf "${INSTALL_DIR}/lib/libc++abi.so.1.0" /usr/lib/libc++abi.so.1 + sudo ln -sf "${INSTALL_DIR}/lib/libc++abi.so.1" /usr/lib/libc++abi.so + + # Update library cache + sudo ldconfig + + # Cleanup + popd + rm -rf "${TEMP_DIR}" + + echo "libc++-${clang_version}-dev installed to ${INSTALL_DIR}" +} setup_libcpp 12 setup_android_ndk diff --git a/backends/qualcomm/scripts/qnn_config.sh b/backends/qualcomm/scripts/qnn_config.sh new file mode 100644 index 00000000000..fe2d82e939e --- /dev/null +++ b/backends/qualcomm/scripts/qnn_config.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Copyright (c) Meta Platforms, Inc. and affiliates. +# All rights reserved. +# +# This source code is licensed under the BSD-style license found in the +# LICENSE file in the root directory of this source tree. + +# QNN SDK Configuration +QNN_VERSION="2.28.0.241029" +QNN_ZIP_URL="https://softwarecenter.qualcomm.com/api/download/software/qualcomm_neural_processing_sdk/v${QNN_VERSION}.zip" From db5eeda1e3a37cf164e93c84f8094ad894e3a706 Mon Sep 17 00:00:00 2001 From: Chen Lai Date: Sun, 22 Jun 2025 14:28:51 -0700 Subject: [PATCH 3/4] Update on "Install libcpp from release package other than apt-get" A few changes 1. Use the release package from https://releases.llvm.org/ to install libcpp, so we can install from different linux in addition to Ubuntu 2. Seperate out the qnn version and the url to a seperate file, for better versin management in the future Differential Revision: [D77048745](https://our.internmc.facebook.com/intern/diff/D77048745/) Differential Revision: [D77048745](https://our.internmc.facebook.com/intern/diff/D77048745) [ghstack-poisoned] --- .ci/scripts/setup-qnn-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/scripts/setup-qnn-deps.sh b/.ci/scripts/setup-qnn-deps.sh index 6e6cf7a73ab..d962f7b908a 100644 --- a/.ci/scripts/setup-qnn-deps.sh +++ b/.ci/scripts/setup-qnn-deps.sh @@ -7,7 +7,7 @@ set -ex -source "$(dirname "${BASH_SOURCE[0]}")/../../../backends/qualcomm/scripts/install_qnn_sdk.sh" +source "$(dirname "${BASH_SOURCE[0]}")/../../backends/qualcomm/scripts/install_qnn_sdk.sh" setup_libcpp 12 install_qnn From 4eefd954c48257d37767ada8a4b89bc559c05111 Mon Sep 17 00:00:00 2001 From: Chen Lai Date: Sun, 22 Jun 2025 14:58:14 -0700 Subject: [PATCH 4/4] Update on "Install libcpp from release package other than apt-get" A few changes 1. Use the release package from https://releases.llvm.org/ to install libcpp, so we can install from different linux in addition to Ubuntu 2. Seperate out the qnn version and the url to a seperate file, for better versin management in the future Differential Revision: [D77048745](https://our.internmc.facebook.com/intern/diff/D77048745/) Differential Revision: [D77048745](https://our.internmc.facebook.com/intern/diff/D77048745) [ghstack-poisoned] --- backends/qualcomm/scripts/install_qnn_sdk.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backends/qualcomm/scripts/install_qnn_sdk.sh b/backends/qualcomm/scripts/install_qnn_sdk.sh index e52cd435b20..a935b3c86e8 100644 --- a/backends/qualcomm/scripts/install_qnn_sdk.sh +++ b/backends/qualcomm/scripts/install_qnn_sdk.sh @@ -7,8 +7,11 @@ set -ex -# Source QNN configuration -source "$(dirname "$0")/qnn_config.sh" +# Get the absolute path of this script +SCRIPT_DIR="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )" + +# Source QNN configuration from the same directory +source "${SCRIPT_DIR}/qnn_config.sh" # Function to install Android NDK (only if not already set) setup_android_ndk() {