Debian Codegraph @

docker/Dockerfile_ubuntu_deps

raw
1 ARG CUDA_VERSION
2 ARG UBUNTU_VERSION
3 FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
4 LABEL maintainer="AliceVision Team [email protected]"
5
6 # use CUDA_VERSION to select the image version to use
7 # see https://hub.docker.com/r/nvidia/cuda/
8 #
9 # AV_VERSION=2.2.8.develop
10 # CUDA_VERSION=11.0
11 # UBUNTU_VERSION=20.04
12 # docker build \
13 # --build-arg CUDA_VERSION=${CUDA_VERSION} \
14 # --build-arg UBUNTU_VERSION${UBUNTU_VERSION} \
15 # --tag alicevision/alicevision-deps:${AV_VERSION}-ubuntu${UBUNTU_VERSION}-cuda${CUDA_TAG} \
16 # -f Dockerfile_ubuntu_deps .
17
18 # OS/Version (FILE): cat /etc/issue.net
19 # Cuda version (ENV): $CUDA_VERSION
20
21 # Install all compilation tools
22 # The Kitware repo provides a recent cmake
23 RUN . ./etc/os-release && \
24 apt-get update && \
25 DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
26 ca-certificates \
27 wget \
28 software-properties-common && \
29 DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
30 build-essential \
31 git \
32 unzip \
33 yasm \
34 libyaml-cpp-dev \
35 pkg-config \
36 libtool \
37 libssl-dev \
38 nasm \
39 automake \
40 cmake \
41 clang-format \
42 libxerces-c-dev \
43 gcc-12 \
44 g++-12 \
45 cpp-12 \
46 gfortran-12 \
47 libpcre2-dev \
48 bison && \
49 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
50
51 RUN add-apt-repository ppa:deadsnakes/ppa && apt-get update && \
52 DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3.11 python3.11-dev python3.11-distutils curl && \
53 curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
54
55 # Install numpy
56 RUN python3.11 -m pip install numpy==1.*
57
58 ENV AV_DEV=/opt/AliceVision_git \
59 AV_BUILD=/tmp/AliceVision_build \
60 AV_INSTALL=/opt/AliceVision_install \
61 PATH="${PATH}:${AV_BUNDLE}"
62
63 COPY dl/vlfeat_K80L3.SIFT.tree ${AV_INSTALL}/share/aliceVision/
64 RUN echo "export ALICEVISION_VOCTREE=${AV_INSTALL}/share/aliceVision/vlfeat_K80L3.SIFT.tree" >> /etc/profile.d/alicevision.sh
65
66 COPY dl/sphereDetection_Mask-RCNN.onnx ${AV_INSTALL}/share/aliceVision/
67 RUN echo "export ALICEVISION_SPHERE_DETECTION_MODEL=${AV_INSTALL}/share/aliceVision/sphereDetection_Mask-RCNN.onnx" >> /etc/profile.d/alicevision.sh
68
69 COPY dl/fcn_resnet50.onnx ${AV_INSTALL}/share/aliceVision/
70 RUN echo "export ALICEVISION_SEMANTIC_SEGMENTATION_MODEL=${AV_INSTALL}/share/aliceVision/fcn_resnet50.onnx" >> /etc/profile.d/alicevision.sh
71
72 COPY dl/ColorChartDetectionModel ${AV_INSTALL}/share/aliceVision/ColorChartDetectionModel
73 RUN echo "export ALICEVISION_COLORCHARTDETECTION_MODEL_FOLDER=${AV_INSTALL}/share/aliceVision/ColorChartDetectionModel" >> /etc/profile.d/alicevision.sh
74
75 COPY docker/check-cpu.sh ${AV_DEV}/docker/check-cpu.sh
76 RUN export CPU_CORES=`${AV_DEV}/docker/check-cpu.sh` && echo "Build multithreading number of cores: ${CPU_CORES}"
77
78 COPY CMakeLists.txt ${AV_DEV}/
79 COPY src/cmake/Dependencies.cmake ${AV_DEV}/src/cmake/
80
81 COPY dl/deps ${AV_BUILD}/external/download/
82
83 WORKDIR "${AV_BUILD}"
84 RUN cmake "${AV_DEV}" \
85 -DCMAKE_BUILD_TYPE=Release \
86 -DALICEVISION_BUILD_DEPENDENCIES:BOOL=ON \
87 -DAV_BUILD_ZLIB:BOOL=ON \
88 -DAV_BUILD_PYBIND11:BOOL=ON \
89 -DAV_BUILD_ALICEVISION:BOOL=OFF \
90 -DPython_EXECUTABLE=/usr/bin/python3.11 \
91 -DCMAKE_INSTALL_PREFIX="${AV_INSTALL}"
92
93 # Symlink lib64 to lib as qtOIIO expects to find OIIO in lib64
94 RUN mkdir -p "${AV_INSTALL}/lib" && \
95 ln -s lib "${AV_INSTALL}/lib64"
96
97 # Symlink to Python3 executable in case a call to "python" instead of "python3" is ever made
98 RUN ln -s /usr/bin/python3.11 /usr/bin/python
99
100 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
101
102 # RUN make -j ${CPU_CORES} lapack
103 # RUN make -j ${CPU_CORES} onnxruntime
104 # RUN make -j ${CPU_CORES} pcl
105 # RUN make -j ${CPU_CORES} turbojpeg
106 # RUN make -j ${CPU_CORES} boost
107 # RUN make -j ${CPU_CORES} openexr
108 # RUN make -j ${CPU_CORES} tbb
109 # RUN make -j ${CPU_CORES} assimp
110 # RUN make -j ${CPU_CORES} geogram
111 # RUN make -j ${CPU_CORES} eigen
112 # RUN make -j ${CPU_CORES} suitesparse
113 # RUN make -j ${CPU_CORES} ceres
114 # RUN make -j ${CPU_CORES} tiff
115 # RUN make -j ${CPU_CORES} png
116 # RUN make -j ${CPU_CORES} libraw
117 # RUN make -j ${CPU_CORES} openimageio
118 # RUN make -j ${CPU_CORES} alembic
119 # RUN make -j ${CPU_CORES} ffmpeg
120 # RUN make -j ${CPU_CORES} opencv
121 # RUN make -j ${CPU_CORES} expat
122 # RUN make -j ${CPU_CORES} SWIG
123 # RUN make -j ${CPU_CORES} E57Format
124 # RUN make -j ${CPU_CORES} LEMON
125 # RUN make -j ${CPU_CORES} OpenMesh
126 # RUN make -j ${CPU_CORES} flann
127 # RUN make -j ${CPU_CORES} clp
128
129 # RUN make -j ${CPU_CORES} popsift
130 # RUN make -j ${CPU_CORES} cctag
131
132 RUN cmake --build . -j ${CPU_CORES} && \
133 mv "${AV_INSTALL}/bin" "${AV_INSTALL}/bin-deps" && \
134 rm -rf "${AV_BUILD}"