forked from dusty-nv/jetson-inference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakePreBuild.sh
60 lines (43 loc) · 1.37 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
#!/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 dialog
$SUDO apt-get install -y libglew-dev glew-utils libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libglib2.0-dev
$SUDO apt-get install -y qtbase5-dev
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
$SUDO apt-get update
# download/install models and PyTorch
if [ $BUILD_CONTAINER = "NO" ]; then
./download-models.sh $BUILD_INTERACTIVE
./install-pytorch.sh $BUILD_INTERACTIVE
else
# in container, the models are mounted and PyTorch is already installed
echo "Running in Docker container => skipping model downloads";
fi
echo "[Pre-build] Finished CMakePreBuild script"