Skip to content

Commit

Permalink
Support Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
quic-zhanweiw committed Dec 20, 2024
1 parent 60ee370 commit 141c22e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion samples/python/utils/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def update_progress(self, block_num=1, block_size=1, total_size=None):
def download_url_pywget(url, filepath, desc=None, fail=None):
ret = True

# Disable warning for insecure request since we set 'verify=False'.
# Create an unverified SSLContext - a context with disables all certificate verification.
import ssl
ssl._create_default_https_context = ssl._create_unverified_context

Expand Down
6 changes: 6 additions & 0 deletions script/qai_appbuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@
# SPDX-License-Identifier: BSD-3-Clause
#
#=============================================================================
import os
import sys
g_base_path = os.path.dirname(os.path.abspath(__file__))
if sys.platform.startswith('linux'):
import ctypes
ctypes.CDLL(g_base_path + "/libappbuilder.so", ctypes.RTLD_GLOBAL)

from .qnncontext import *
4 changes: 1 addition & 3 deletions script/qai_appbuilder/qnncontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
import sys
import functools
import time
import platform
from qai_appbuilder import appbuilder

machine = platform.machine()
QNN_SYSTEM_LIB = "QnnSystem.dll"
QNN_LIB_EXT = ".dll"
QNN_LIB_PRE = ""
PATH_SLASH = "\\"
if machine == "aarch64": # linux
if sys.platform.startswith('linux'):
QNN_SYSTEM_LIB = "libQnnSystem.so"
QNN_LIB_EXT = ".so"
QNN_LIB_PRE = "lib"
Expand Down

0 comments on commit 141c22e

Please sign in to comment.