-
Notifications
You must be signed in to change notification settings - Fork 28
/
install_ubuntu.sh
58 lines (51 loc) · 1.2 KB
/
install_ubuntu.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
#!/bin/sh
echo
echo "+------------------------------+"
echo "| FicTrac install script |"
echo "+------------------------------+"
echo
# Get Ubuntu version
ver="$(lsb_release -sr)"
echo "Found Ubuntu version $ver"
if [ "$ver" = "22.04" ] || [ "$ver" = "20.04" ]; then
echo
echo "+-- Installing dependencies ---+"
echo
sudo apt-get update
sudo apt-get install -y gcc g++ cmake libavcodec-dev libnlopt-dev libboost-dev libopencv-dev
echo
echo "+-- Creating build directory --+"
echo
FICTRAC_DIR="$(dirname "$0")"
cd "$FICTRAC_DIR" # make sure we are in fictrac dir
if [ -d ./build ]; then
echo "Removing existing build dir"
rm -r ./build
fi
mkdir build
if [ -d ./build ]; then
echo "Created build dir"
cd ./build
else
echo "Uh oh, something went wrong attempting to create the build dir!"
exit
fi
echo
echo "+-- Generating build files ----+"
echo
cmake ..
echo
echo "+-- Building FicTrac ----------+"
echo
cmake --build . --config Release --parallel $(nproc) --clean-first
cd ..
if [ -f ./bin/fictrac ]; then
echo
echo "FicTrac built successfully!"
echo
else
echo
echo "Hmm... something seems to have gone wrong - can't find FicTrac executable."
echo
fi
fi