forked from stella-cv/stella_vslam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.socket
250 lines (237 loc) · 6.61 KB
/
Dockerfile.socket
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND noninteractive
# install dependencies via apt
ENV DEBCONF_NOWARNINGS yes
RUN set -x && \
apt-get update -y -qq && \
apt-get upgrade -y -qq --no-install-recommends && \
: "basic dependencies" && \
apt-get install -y -qq \
build-essential \
pkg-config \
cmake \
git \
wget \
curl \
tar \
unzip && \
: "g2o dependencies" && \
apt-get install -y -qq \
libatlas-base-dev \
libsuitesparse-dev \
libglew-dev && \
: "OpenCV dependencies" && \
apt-get install -y -qq \
libjpeg-dev \
libpng++-dev \
libtiff-dev \
libopenexr-dev \
libwebp-dev \
ffmpeg \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libswscale-dev \
libtbb-dev && \
: "backward-cpp dependencies" && \
apt install -y -qq binutils-dev && \
: "other dependencies" && \
apt-get install -y -qq \
libyaml-cpp-dev \
sqlite3 \
libsqlite3-dev && \
: "remove cache" && \
apt-get autoremove -y -qq && \
rm -rf /var/lib/apt/lists/*
ARG CMAKE_INSTALL_PREFIX=/usr/local
ARG NUM_THREADS=1
ENV CPATH=${CMAKE_INSTALL_PREFIX}/include:${CPATH}
ENV C_INCLUDE_PATH=${CMAKE_INSTALL_PREFIX}/include:${C_INCLUDE_PATH}
ENV CPLUS_INCLUDE_PATH=${CMAKE_INSTALL_PREFIX}/include:${CPLUS_INCLUDE_PATH}
ENV LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${LIBRARY_PATH}
ENV LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
# Eigen
ARG EIGEN3_VERSION=3.3.7
WORKDIR /tmp
RUN set -x && \
wget -q https://gitlab.com/libeigen/eigen/-/archive/${EIGEN3_VERSION}/eigen-${EIGEN3_VERSION}.tar.bz2 && \
tar xf eigen-${EIGEN3_VERSION}.tar.bz2 && \
rm -rf eigen-${EIGEN3_VERSION}.tar.bz2 && \
cd eigen-${EIGEN3_VERSION} && \
mkdir -p build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
.. && \
make -j${NUM_THREADS} && \
make install && \
cd /tmp && \
rm -rf *
ENV Eigen3_DIR=${CMAKE_INSTALL_PREFIX}/share/eigen3/cmake
# g2o
ARG G2O_COMMIT=20230223_git
WORKDIR /tmp
RUN set -x && \
git clone https://github.com/RainerKuemmerle/g2o.git && \
cd g2o && \
git checkout ${G2O_COMMIT} && \
mkdir -p build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_UNITTESTS=OFF \
-DG2O_USE_CHOLMOD=OFF \
-DG2O_USE_CSPARSE=ON \
-DG2O_USE_OPENGL=OFF \
-DG2O_USE_OPENMP=OFF \
-DG2O_BUILD_APPS=OFF \
-DG2O_BUILD_EXAMPLES=OFF \
-DG2O_BUILD_LINKED_APPS=OFF \
.. && \
make -j${NUM_THREADS} && \
make install && \
cd /tmp && \
rm -rf *
ENV g2o_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/g2o
# OpenCV
ARG OPENCV_VERSION=4.7.0
WORKDIR /tmp
RUN set -x && \
wget -q https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip && \
unzip -q ${OPENCV_VERSION}.zip && \
rm -rf ${OPENCV_VERSION}.zip && \
cd opencv-${OPENCV_VERSION} && \
mkdir -p build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
-DBUILD_DOCS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_JASPER=OFF \
-DBUILD_OPENEXR=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_PROTOBUF=OFF \
-DBUILD_opencv_apps=OFF \
-DBUILD_opencv_dnn=OFF \
-DBUILD_opencv_ml=OFF \
-DBUILD_opencv_python_bindings_generator=OFF \
-DENABLE_CXX11=ON \
-DENABLE_FAST_MATH=ON \
-DWITH_EIGEN=ON \
-DWITH_FFMPEG=ON \
-DWITH_TBB=ON \
-DWITH_OPENMP=ON \
.. && \
make -j${NUM_THREADS} && \
make install && \
cd /tmp && \
rm -rf *
ENV OpenCV_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/opencv4
# socket.io-client-cpp
ARG SIOCLIENT_COMMIT=ff6ef08e45c594e33aa6bc19ebdd07954914efe0
WORKDIR /tmp
RUN set -x && \
git clone https://github.com/shinsumicco/socket.io-client-cpp.git && \
cd socket.io-client-cpp && \
git checkout ${SIOCLIENT_COMMIT} && \
git submodule init && \
git submodule update && \
mkdir -p build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
-DBUILD_UNIT_TESTS=OFF \
.. && \
make -j${NUM_THREADS} && \
make install && \
cd /tmp && \
rm -rf *
ENV sioclient_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/sioclient
# protobuf
WORKDIR /tmp
RUN set -x && \
apt-get update -y -qq && \
apt-get upgrade -y -qq --no-install-recommends && \
apt-get install -y -qq autogen autoconf libtool && \
wget -q https://github.com/google/protobuf/archive/v3.6.1.tar.gz && \
tar xf v3.6.1.tar.gz && \
cd protobuf-3.6.1 && \
./autogen.sh && \
./configure --prefix=${CMAKE_INSTALL_PREFIX} --enable-static=no && \
make -j${NUM_THREADS} && \
make install && \
cd /tmp && \
rm -rf * && \
apt-get purge -y -qq autogen autoconf libtool && \
apt-get autoremove -y -qq && \
rm -rf /var/lib/apt/lists/*
# backward-cpp
ARG BACKWARD_CPP_COMMIT=5ffb2c879ebdbea3bdb8477c671e32b1c984beaa
WORKDIR /tmp
RUN set -x && \
git clone https://github.com/bombela/backward-cpp.git && \
cd backward-cpp && \
git checkout ${BACKWARD_CPP_COMMIT} && \
mkdir -p build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
.. && \
make -j${NUM_THREADS} && \
make install && \
cd /tmp && \
rm -rf *
# stella_vslam
COPY . /stella_vslam/
WORKDIR /stella_vslam/
RUN set -x && \
mkdir -p build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
.. && \
make -j${NUM_THREADS} && \
make install && \
rm -rf CMakeCache.txt CMakeFiles Makefile cmake_install.cmake example src && \
chmod -R 777 ./*
ARG SOCKET_PUBLISHER_COMMIT=e2aaf66b27a6477b478bc8e86992907f09f29188
WORKDIR /tmp
RUN set -x && \
git clone https://github.com/stella-cv/socket_publisher.git && \
cd socket_publisher && \
git checkout -q ${SOCKET_PUBLISHER_COMMIT} && \
git submodule update --init --recursive && \
mkdir -p build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
.. && \
make -j${NUM_THREADS} && \
make install && \
cd /tmp && \
rm -rf *
ARG EXAMPLES_COMMIT=3606f68c9c3fb05a838e992230cb4a17106a7c41
WORKDIR /
RUN set -x && \
git clone https://github.com/stella-cv/stella_vslam_examples.git && \
cd stella_vslam_examples && \
git checkout -q ${EXAMPLES_COMMIT} && \
git submodule update --init --recursive && \
mkdir -p build && \
cd build && \
cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} \
-DUSE_STACK_TRACE_LOGGER=ON \
.. && \
make -j${NUM_THREADS}
WORKDIR /stella_vslam_examples/build/
ENTRYPOINT ["/bin/bash"]