-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.sh
executable file
·102 lines (80 loc) · 2.93 KB
/
setup.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
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
98
99
100
101
102
#!/usr/bin/env bash
# this script aims at configuring a computer to run USE Tracker
function error
{
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
exit 1
}
# find out if sudo is available, otherwise use su
SUDOAVAILABLE=$(which sudo | wc -l)
# find latest version of libwxgtk
# wxversion=$(apt-cache search libwxgtk | egrep -o '[0-9](\.[0-9]+)+' | sort | tail -1)
# wxgtkpackages=$(apt-cache search libwxgtk | grep dev | grep $wxversion)
wxversion=3.0
# make sure the following dependencies have been installed
echo The setup program of the USE Tracker is about to update your system
echo
echo
if (( "$SUDOAVAILABLE" >= "1" ))
then
sudo echo Updating, please wait...
sudo apt-get -q -y update
sudo apt-get -q -y upgrade
echo Installing Dependencies
sudo apt-get --yes install build-essential cmake premake4 libwxbase$wxversion-dev libopencv-dev libboost-program-options-dev libboost-filesystem-dev libwxgtk$wxversion-dev libwxgtk-media$wxversion-dev freeglut3-dev libva-dev libbz2-dev libx264-dev libbluetooth-dev || error '$LINENO: Aborted, could not install the required dependencies.'
else
su -c "echo Updating, please wait...;\
apt-get -q -y update;\
apt-get -q -y upgrade; \
echo Installing Dependencies; \
apt-get --yes install build-essential cmake premake4 libwxbase$wxversion-dev libopencv-dev libboost-program-options-dev libboost-filesystem-dev libwxgtk$wxversion-dev libwxgtk-media$wxversion-dev freeglut3-dev libva-dev libbz2-dev libx264-dev libbluetooth-dev || error '$LINENO: Aborted, could not install the required dependencies.' "
fi
# download and compile latest stable opencv
echo
echo
echo "Downloading ArUco" $version
#version="$(wget -q -O - http://sourceforge.net/projects/aruco/files/ | egrep -m1 -o '\"[0-9](\.[0-9]+)+' | cut -c2-)"
version="1.3.0"
#wget -O aruco-$version.tgz http://sourceforge.net/projects/aruco/files/$version/aruco-"$version".tgz/download
wget -O aruco-$version.tgz https://downloads.sourceforge.net/project/aruco/OldVersions/aruco-1.3.0.tgz
echo
echo
echo "Building ArUco" $version
tar zxvf aruco-$version.tgz
cd aruco-$version
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_UTILS=0 .
make
echo
echo
echo "Installing ArUco" $version
if (( "$SUDOAVAILABLE" >= "1" ))
then
sudo make install
sudo ldconfig
else
su -c "make install; ldconfig"
fi
echo "ArUco" $version "ready to be used"
cd ..
echo "Building ArUcoColor"
cd arucoColor
premake4 gmake
make config=release clean
make config=release
echo "ArUcoColor ready to be used"
cd ..
echo
echo
echo "Building USE Tracker"
make clean
make release
# install images & program
# $SU installmkdir -p /usr/share/useTracker
if (( "$SUDOAVAILABLE" >= "1" ))
then
sudo mkdir -p /usr/share/useTracker/images
sudo install images/* /usr/share/useTracker/images/
sudo install ./bin/Release/useTracker /usr/bin/
else
su -c "mkdir -p /usr/share/useTracker/images; install images/* /usr/share/useTracker/images/; install ./bin/Release/useTracker /usr/bin/"
fi