-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhailo_python_installation.sh
More file actions
executable file
·97 lines (83 loc) · 2.83 KB
/
Copy pathhailo_python_installation.sh
File metadata and controls
executable file
·97 lines (83 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/env bash
set -e
# --- Defaults ---
BASE_URL="http://dev-public.hailo.ai/2025_01"
HAILORT_VERSION="4.20.0"
TAPPAS_CORE_VERSION="3.31.0"
DOWNLOAD_DIR="hailo_temp_resources"
# By default install both
INSTALL_TAPPAS=true
INSTALL_HAILORT=true
# --- Parse flags ---
while [[ $# -gt 0 ]]; do
case $1 in
--hailort-version=*)
HAILORT_VERSION="${1#*=}"
shift
;;
--tappas-core-version=*)
TAPPAS_CORE_VERSION="${1#*=}"
shift
;;
--download-dir=*)
DOWNLOAD_DIR="${1#*=}"
shift
;;
--only-tappas)
INSTALL_HAILORT=false
INSTALL_TAPPAS=true
shift
;;
--only-hailort)
INSTALL_TAPPAS=false
INSTALL_HAILORT=true
shift
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 [--hailort-version=X] [--tappas-core-version=Y] [--download-dir=DIR] [--only-tappas] [--only-hailort]"
exit 1
;;
esac
done
# Ensure you haven't disabled both
if [[ "$INSTALL_TAPPAS" = false && "$INSTALL_HAILORT" = false ]]; then
echo "Error: Cannot use both --only-tappas and --only-hailort together."
exit 1
fi
echo "→ HAILORT_VERSION = $HAILORT_VERSION"
echo "→ TAPPAS_CORE_VERSION= $TAPPAS_CORE_VERSION"
echo "→ DOWNLOAD_DIR = $DOWNLOAD_DIR"
echo "→ install Tapas? = $INSTALL_TAPPAS"
echo "→ install HailoRT? = $INSTALL_HAILORT"
mkdir -p "$DOWNLOAD_DIR"
# --- Compute Python and Arch tags ---
PY_MAJOR=$(python3 -c 'import sys; print(sys.version_info.major)')
PY_MINOR=$(python3 -c 'import sys; print(sys.version_info.minor)')
PY_TAG="cp${PY_MAJOR}${PY_MINOR}-cp${PY_MAJOR}${PY_MINOR}"
ARCH_TAG="$(uname -m | sed -e 's/x86_64/linux_x86_64/' -e 's/aarch64/linux_aarch64/')"
# --- Download wheels ---
if [[ "$INSTALL_TAPPAS" = true ]]; then
echo "→ Downloading Tapas-core wheel..."
# NOTE: We keep the original filename (tappas_core_python_binding-…)
wget "${BASE_URL}/tappas_core_python_binding-${TAPPAS_CORE_VERSION}-py3-none-any.whl" \
-O "${DOWNLOAD_DIR}/tappas_core_python_binding-${TAPPAS_CORE_VERSION}-py3-none-any.whl"
fi
if [[ "$INSTALL_HAILORT" = true ]]; then
echo "→ Downloading HailoRT wheel..."
# HailoRT wheel already matches its metadata name
wget "${BASE_URL}/hailort-${HAILORT_VERSION}-${PY_TAG}-${ARCH_TAG}.whl" \
-O "${DOWNLOAD_DIR}/hailort-${HAILORT_VERSION}-${PY_TAG}-${ARCH_TAG}.whl"
fi
# --- Install into current venv ---
echo "→ Upgrading pip…"
python3 -m pip install --upgrade pip
if [[ "$INSTALL_HAILORT" = true ]]; then
echo "→ Installing HailoRT…"
python3 -m pip install "${DOWNLOAD_DIR}/hailort-${HAILORT_VERSION}-${PY_TAG}-${ARCH_TAG}.whl"
fi
if [[ "$INSTALL_TAPPAS" = true ]]; then
echo "→ Installing Tapas-core…"
python3 -m pip install "${DOWNLOAD_DIR}/tappas_core_python_binding-${TAPPAS_CORE_VERSION}-py3-none-any.whl"
fi
echo "✅ Installation complete."