-
-
Notifications
You must be signed in to change notification settings - Fork 873
Expand file tree
/
Copy pathDockerfile_ubuntu_deps
More file actions
135 lines (116 loc) · 4.94 KB
/
Dockerfile_ubuntu_deps
File metadata and controls
135 lines (116 loc) · 4.94 KB
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
ARG CUDA_VERSION
ARG UBUNTU_VERSION
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
LABEL maintainer="AliceVision Team alicevision-team@googlegroups.com"
# use CUDA_VERSION to select the image version to use
# see https://hub.docker.com/r/nvidia/cuda/
#
# AV_VERSION=2.2.8.develop
# CUDA_VERSION=11.0
# UBUNTU_VERSION=20.04
# docker build \
# --build-arg CUDA_VERSION=${CUDA_VERSION} \
# --build-arg UBUNTU_VERSION${UBUNTU_VERSION} \
# --tag alicevision/alicevision-deps:${AV_VERSION}-ubuntu${UBUNTU_VERSION}-cuda${CUDA_TAG} \
# -f Dockerfile_ubuntu_deps .
# OS/Version (FILE): cat /etc/issue.net
# Cuda version (ENV): $CUDA_VERSION
# Install all compilation tools
# The Kitware repo provides a recent cmake
RUN . ./etc/os-release && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
wget \
software-properties-common && \
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | gpg --dearmor - > /etc/apt/trusted.gpg.d/kitware.gpg && \
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $UBUNTU_CODENAME main" && \
apt-get clean && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
git \
unzip \
yasm \
pkg-config \
libtool \
libssl-dev \
nasm \
automake \
cmake \
clang-format \
libxerces-c-dev \
gcc-12 \
g++-12 \
cpp-12 \
gfortran-12 \
python3-dev \
python3-pip \
libpcre2-dev \
bison && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12 --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-12
# Install numpy
RUN python3 -m pip install numpy
ENV AV_DEV=/opt/AliceVision_git \
AV_BUILD=/tmp/AliceVision_build \
AV_INSTALL=/opt/AliceVision_install \
PATH="${PATH}:${AV_BUNDLE}"
COPY dl/vlfeat_K80L3.SIFT.tree ${AV_INSTALL}/share/aliceVision/
RUN echo "export ALICEVISION_VOCTREE=${AV_INSTALL}/share/aliceVision/vlfeat_K80L3.SIFT.tree" >> /etc/profile.d/alicevision.sh
COPY dl/sphereDetection_Mask-RCNN.onnx ${AV_INSTALL}/share/aliceVision/
RUN echo "export ALICEVISION_SPHERE_DETECTION_MODEL=${AV_INSTALL}/share/aliceVision/sphereDetection_Mask-RCNN.onnx" >> /etc/profile.d/alicevision.sh
COPY dl/fcn_resnet50.onnx ${AV_INSTALL}/share/aliceVision/
RUN echo "export ALICEVISION_SEMANTIC_SEGMENTATION_MODEL=${AV_INSTALL}/share/aliceVision/fcn_resnet50.onnx" >> /etc/profile.d/alicevision.sh
COPY dl/ColorchartDetectionModel ${AV_INSTALL}/share/aliceVision/ColorchartDetectionModel
RUN echo "export ALICEVISION_COLORCHARTDETECTION_MODEL_FOLDER=${AV_INSTALL}/share/aliceVision/ColorchartDetectionModel" >> /etc/profile.d/alicevision.sh
COPY docker/check-cpu.sh ${AV_DEV}/docker/check-cpu.sh
RUN export CPU_CORES=`${AV_DEV}/docker/check-cpu.sh` && echo "Build multithreading number of cores: ${CPU_CORES}"
COPY CMakeLists.txt ${AV_DEV}/
COPY src/cmake/Dependencies.cmake ${AV_DEV}/src/cmake/
COPY dl/deps ${AV_BUILD}/external/download/
WORKDIR "${AV_BUILD}"
RUN cmake "${AV_DEV}" \
-DCMAKE_BUILD_TYPE=Release \
-DALICEVISION_BUILD_DEPENDENCIES:BOOL=ON \
-DAV_BUILD_ZLIB:BOOL=ON \
-DAV_BUILD_ALICEVISION:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX="${AV_INSTALL}"
# Symlink lib64 to lib as qtOIIO expects to find OIIO in lib64
RUN mkdir -p "${AV_INSTALL}/lib" && \
ln -s lib "${AV_INSTALL}/lib64"
# Symlink to Python3 executable in case a call to "python" instead of "python3" is ever made
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN test -e /usr/local/cuda/lib64/libcublas.so || ln -s /usr/lib/x86_64-linux-gnu/libcublas.so /usr/local/cuda/lib64/libcublas.so
# RUN make -j ${CPU_CORES} lapack
# RUN make -j ${CPU_CORES} onnxruntime
# RUN make -j ${CPU_CORES} pcl
# RUN make -j ${CPU_CORES} turbojpeg
# RUN make -j ${CPU_CORES} boost
# RUN make -j ${CPU_CORES} openexr
# RUN make -j ${CPU_CORES} tbb
# RUN make -j ${CPU_CORES} assimp
# RUN make -j ${CPU_CORES} geogram
# RUN make -j ${CPU_CORES} eigen
# RUN make -j ${CPU_CORES} opengv
# RUN make -j ${CPU_CORES} suitesparse
# RUN make -j ${CPU_CORES} ceres
# RUN make -j ${CPU_CORES} tiff
# RUN make -j ${CPU_CORES} png
# RUN make -j ${CPU_CORES} libraw
# RUN make -j ${CPU_CORES} openimageio
# RUN make -j ${CPU_CORES} alembic
# RUN make -j ${CPU_CORES} ffmpeg
# RUN make -j ${CPU_CORES} opencv
# RUN make -j ${CPU_CORES} expat
# RUN make -j ${CPU_CORES} SWIG
# RUN make -j ${CPU_CORES} E57Format
# RUN make -j ${CPU_CORES} LEMON
# RUN make -j ${CPU_CORES} opengv
# RUN make -j ${CPU_CORES} OpenMesh
# RUN make -j ${CPU_CORES} flann
# RUN make -j ${CPU_CORES} clp
# RUN make -j ${CPU_CORES} popsift
# RUN make -j ${CPU_CORES} cctag
RUN cmake --build . -j ${CPU_CORES} && \
mv "${AV_INSTALL}/bin" "${AV_INSTALL}/bin-deps" && \
rm -rf "${AV_BUILD}"