-
Notifications
You must be signed in to change notification settings - Fork 3
/
tools_install.sh
executable file
·170 lines (136 loc) · 3.89 KB
/
tools_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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/bin/bash
# Set current directory
CUR_DIR=${PWD}
# Dependencies from the default Ubuntu repositories
sudo apt update
sudo apt install -y \
bc \
build-essential \
cmake \
curl \
ffmpeg \
freeglut3-dev \
fuse \
git \
gthumb \
libatlas-base-dev \
libboost-all-dev \
libceres-dev \
libcgal-dev \
libcgal-qt5-dev \
libeigen3-dev \
libfreeimage-dev \
libfreenect-dev \
libfreenect0.5 \
libgflags-dev \
libglew-dev \
libglfw3-dev \
libglu1-mesa-dev \
libgoogle-glog-dev \
libjpeg-dev \
libomp-dev \
libopencv-dev \
libopenni2-dev \
libpcl-dev \
libpng-dev \
libqt5opengl5-dev \
libsoil-dev \
libsuitesparse-dev \
libtiff-dev \
libturbojpeg \
libusb-1.0-0-dev \
libva-dev \
libxi-dev \
libxmu-dev \
libxxf86vm-dev \
mercurial \
meshlab \
opencl-headers \
pkg-config \
qtbase5-dev \
tar \
wget
sudo apt install -y libmetis-dev
sudo apt install -y beignet-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.a /usr/lib/libglut.a
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so /usr/lib/libglut.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so.3
sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3.9.0 /usr/lib/libglut.so.3.9.0
# ------------- git-lfs -------------
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt install -y git-lfs
git lfs install
# ------------- cmake -------------
cmake_version="$(echo $(cmake --version) | grep -Po '(\d+.*\d+)(?=\.)')"
if [[ ( ${cmake_version%%.*} < 3 ) || ( ${cmake_version%%.*} == 3 && ( 1 -eq "$(echo "${cmake_version##*.} < 10" | bc)" ) ) ]]; then
echo "Cmake minimum required version: 3.10"
sudo apt purge cmake -y
version=3.10
build=3
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz > /dev/null
rm cmake-$version.$build.tar.gz
cd cmake-$version.$build
./bootstrap
make -j$(nproc) && sudo make install
hash -r
cd ${CUR_DIR}
fi
sudo ldconfig
# ------------- libfreenect -------------
git clone https://github.com/OpenKinect/libfreenect.git libfreenect
cd libfreenect
sudo cp ./platform/linux/udev/51-kinect.rules /etc/udev/rules.d/
mkdir build
cd build
cmake -L ..
make -j$(nproc) && sudo make install
cd ${CUR_DIR}
# ------------- libfreenect2 -------------
# Requirements: USB 3.0 controller. USB 2 is not supported
sudo apt install -y libjpeg-turbo8-dev # Ubuntu 14.04 to 16.04
sudo apt install -y libturbojpeg0-dev # Ubuntu 17.10 and newer
git clone https://github.com/OpenKinect/libfreenect2.git libfreenect2
cd libfreenect2
sudo cp ./platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/
mkdir build
cd build
cmake ..
make -j$(nproc) && sudo make install
cd ${CUR_DIR}
# ------------- Colmap -------------
git clone https://github.com/colmap/colmap.git colmap
cd colmap
mkdir build
cd build
cmake ..
make -j$(nproc) && sudo make install
# Under newer Ubuntu versions it might be necessary to explicitly select the used GCC version due to compatiblity issues with CUDA
# sudo apt install -y gcc-6 g++-6
# CC=/usr/bin/gcc-6 CXX=/usr/bin/g++-6 cmake ..
cd ${CUR_DIR}
# ------------- OpenMVS -------------
git clone https://github.com/cdcseacave/VCG.git vcglib # VCGLib (Required)
git clone https://github.com/cdcseacave/openMVS.git openMVS
cd openMVS
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DVCG_ROOT="${CUR_DIR}/vcglib" -DOpenMVS_USE_CUDA=ON
make -j$(nproc) && sudo make install
cd ${CUR_DIR}
# ------------- Super4PCS -------------
git clone https://github.com/nmellado/Super4PCS.git Super4PCS
cd Super4PCS
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install
cd ${CUR_DIR}
# ------------- LowCost3DReconstruction -------------
git clone https://github.com/Eberty/LowCost3DReconstruction.git LowCost3DReconstruction
cd LowCost3DReconstruction
mkdir build
cd build
cmake ..
make -j$(nproc) && sudo make install
cd ${CUR_DIR}