forked from dusty-nv/jetson-inference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakePreBuild.sh
72 lines (60 loc) · 1.7 KB
/
CMakePreBuild.sh
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
#!/usr/bin/env bash
# this script is automatically run from CMakeLists.txt
BUILD_ROOT=$PWD
BUILD_INTERACTIVE=$1
if [ -f /.dockerenv ]; then
BUILD_CONTAINER="YES"
else
BUILD_CONTAINER="NO"
fi
echo "[Pre-build] dependency installer script running..."
echo "[Pre-build] build root directory: $BUILD_ROOT"
echo "[Pre-build] build interactive: $BUILD_INTERACTIVE"
echo "[Pre-build] build container: $BUILD_CONTAINER"
echo " "
# detect build architecture
ARCH=$(uname -i)
# break on errors
#set -e
# docker doesn't use sudo
if [ $BUILD_CONTAINER = "YES" ]; then
SUDO=""
else
SUDO="sudo"
fi
# install packages
$SUDO apt-get update
$SUDO apt-get install -y --no-install-recommends \
dialog \
libglew-dev \
glew-utils \
gstreamer1.0-libav \
gstreamer1.0-nice \
libgstreamer1.0-dev \
libgstrtspserver-1.0-dev \
libglib2.0-dev \
libsoup2.4-dev \
libjson-glib-dev \
python3-pip \
python3-packaging \
qtbase5-dev \
avahi-utils
if [ $BUILD_CONTAINER = "NO" ]; then
# these are installed in a different step in the Dockerfile
$SUDO apt-get install -y --no-install-recommends \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgstreamer-plugins-bad1.0-dev
fi
if [ $ARCH != "x86_64" ]; then
# on x86, these are already installed by conda and installing them again creates conflicts
$SUDO apt-get install -y libpython3-dev python3-numpy
fi
# install cython for if numpy gets built by later packages
pip3 install --no-cache-dir --verbose --upgrade Cython
# download/install models and PyTorch
if [ $BUILD_CONTAINER = "NO" ]; then
#./download-models.sh $BUILD_INTERACTIVE
./install-pytorch.sh $BUILD_INTERACTIVE
fi
echo "[Pre-build] Finished CMakePreBuild script"