forked from facebookresearch/projectaria_tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
72 lines (61 loc) · 2.66 KB
/
Dockerfile
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
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Start from an ubuntu container
FROM ubuntu:focal
# Ensure a SUDO command is available in the container
RUN if type sudo 2>/dev/null; then \
echo "The sudo command already exists... Skipping."; \
else \
echo "#!/bin/sh\n\${@}" > /usr/sbin/sudo; \
chmod +x /usr/sbin/sudo; \
fi
# Update & upgrade distribution repositories
RUN apt-get update --fix-missing && DEBIAN_FRONTEND="noninteractive" TZ="America/New_York" apt-get install -y tzdata --fix-missing; sudo apt upgrade -y --fix-missing
# Install build essentials
RUN sudo apt-get install -y cmake git build-essential;
# Install python pip essentials
RUN sudo apt-get install -y libpython3-dev python3-pip;
# Install VRS dependencies and compile/install VRS
# Note that we install cereal (header only) library to get last version
# On some system libcereal-dev can be enough
RUN sudo apt-get install -y \
libboost-chrono-dev \
libboost-date-time-dev \
libboost-filesystem-dev \
libboost-iostreams-dev \
libboost-system-dev \
libboost-thread-dev \
libfmt-dev \
libgmock-dev libgtest-dev \
liblz4-dev \
libpng-dev libturbojpeg-dev \
libxxhash-dev libzstd-dev; \
cd /tmp; git clone https://github.com/USCiLab/cereal.git -b v1.3.2 \
&& cd cereal \
&& cmake -DSKIP_PORTABILITY_TEST=1 -DJUST_INSTALL_CEREAL=ON .; sudo make -j2 install; rm -rf /tmp/cereal;
# Install pangolin
RUN sudo apt-get install -y libeigen3-dev libglew-dev libgl1-mesa-dev -y; \
cd /tmp; git clone https://github.com/stevenlovegrove/Pangolin.git \
&& mkdir Pangolin_Build && cd Pangolin_Build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TOOLS=OFF -DBUILD_PANGOLIN_PYTHON=OFF -DBUILD_EXAMPLES=OFF ../Pangolin \
&& sudo make -j2 install;
# Code
ADD ./ /opt/projectaria_tools
# Configure
RUN mkdir /opt/projectaria_tools_Build; cd /opt/projectaria_tools_Build; \
cmake /opt/projectaria_tools;
# Build & test
RUN cd /opt/projectaria_tools_Build; make -j2 ; ctest -j;
# Build python bindings
RUN cd /opt/projectaria_tools; pip3 install --global-option=build_ext --config-settings=compile-args="-j2" .;