-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
136 lines (103 loc) · 3.97 KB
/
install.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
WORKSPACE=$HOME/workspace
else
WORKSPACE=$1
fi
apt-get update
set -e
## Install prerequisites
apt-get install -y git cmake build-essential
## Qt5
# ref: https://wiki.qt.io/Building_Qt_5_from_Git
# Install prerequisites
apt-get build-dep -y qt5-default
apt-get install -y libxcb-xinerama0-dev
# Clone qt5, checkout to the target tag, init repository
git clone https://code.qt.io/qt/qt5.git $WORKSPACE/qt5
cd $WORKSPACE/qt5
git checkout tags/v5.9.1
perl init-repository --module-subset=default,-qtwebkit,-qtwebkit-examples,-qtwebengine
# Generate Makefile for open source project
mkdir -p $WORKSPACE/qt5/build
cd $WORKSPACE/qt5/build
../configure -opensource -confirm-license -nomake examples -nomake tests
# Compile and install QT to /usr/local/Qt-%VERSION%
make -j $(nproc)
make install -j $(nproc)
# Add QT binaries to PATH
QT_PATH=/usr/local/Qt-5.9.1
echo "export PATH=\$PATH:$QT_PATH/bin" >> $HOME/.bashrc
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$QT_PATH/lib" >> $HOME/.bashrc
source $HOME/.bashrc
## VTK
#Ref: http://www.vtk.org/Wiki/VTK/Building/Linux
# Install prerequisites
apt-get install -y libxt-dev
# Clone VTK to the traget tag
git clone -b v8.0.0 --single-branch --depth 1 https://github.com/Kitware/VTK $WORKSPACE/VTK
# Compile and install VTK with Qt
mkdir -p $WORKSPACE/VTK/build
cd $WORKSPACE/VTK/build
cmake -DCMAKE_BUILD_TYPE=Release -DVTK_QT_VERSION:STRING=5 -DQT_QMAKE_EXECUTABLE:PATH=$QT_PATH/bin/qmake -DVTK_Group_Qt:BOOL=ON -DCMAKE_PREFIX_PATH:PATH=$QT_PATH/lib/cmake/ -DBUILD_SHARED_LIBS:BOOL=ON ..
make -j $(nproc)
make install -j $(nproc)
## OpenCV
# Install prerequisites
apt-get install -y python-dev python-numpy
# Clone opencv to the target tag
git clone -b 3.3.0-rc --single-branch --depth 1 https://github.com/opencv/opencv $WORKSPACE/opencv
# Clone opencv_contrib at the target tag, which contains non-free modules (e.g., SURF)
git clone -b 3.3.0-rc --single-branch --depth 1 https://github.com/opencv/opencv_contrib $WORKSPACE/opencv_contrib
# Compile and install OpenCV with non-free modules (e.g., SURF)
mkdir -p $WORKSPACE/opencv/build
cd $WORKSPACE/opencv/build
cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_CXX11=ON -DWITH_VTK=ON -DOPENCV_EXTRA_MODULES_PATH=$WORKSPACE/opencv_contrib/modules ..
make -j $(nproc)
make install -j $(nproc)
## PCL
# Install prerequisites
apt-get install -y libboost-all-dev libflann-dev libeigen3-dev
# Clone PCL to the target tag
git clone -b pcl-1.8.0 --single-branch --depth 1 https://github.com/PointCloudLibrary/pcl.git $WORKSPACE/pcl
# Compile and install PCL
mkdir -p $WORKSPACE/pcl/build
cd $WORKSPACE/pcl/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j $(nproc)
make install -j $(nproc)
## RTABMap
#Install prerequisites
apt-get install -y libsqlite3-dev
# Clone RTABMap to the target tag
git clone -b 0.13.2 --single-branch --depth 1 https://github.com/introlab/rtabmap $WORKSPACE/rtabmap
# Compile and install RTABMap 0.11.14
mkdir -p $WORKSPACE/rtabmap/build
cd $WORKSPACE/rtabmap/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j $(nproc)
make install -j $(nproc)
## Libzbar
apt-get install -y libzbar-dev
## GRPC and Protobuf
#Ref: https://github.com/grpc/grpc/blob/master/INSTALL.md
#Install prerequisites
apt-get install -y autoconf libtool
#Clone latest GRPC and init its submodules
git clone -b v1.2.0 --single-branch --depth 1 --recurse-submodules https://github.com/grpc/grpc $WORKSPACE/grpc
#Compile and install GRPC
cd $WORKSPACE/grpc
make -j $(nproc)
make install -j $(nproc)
# Install protobuf compiled while comopiling GRPC
cd $WORKSPACE/grpc/third_party/protobuf
make install -j $(nproc)
## AprilTags
git clone -b master --single-branch --depth 1 https://github.com/swatbotics/apriltags-cpp.git $WORKSPACE/apriltags
mkdir -p $WORKSPACE/apriltags/build
cd $WORKSPACE/apriltags/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j $(nproc)
cp libapriltags.a /usr/local/lib/
mkdir -p /usr/local/include/apriltags
cp ../src/*h /usr/local/include/apriltags/