Debian Codegraph @

docker/Dockerfile_rocky_deps

raw
1 ARG CUDA_VERSION
2 ARG ROCKY_VERSION
3 FROM nvidia/cuda:${CUDA_VERSION}-devel-rockylinux${ROCKY_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 # ROCKY_VERSION=20.04
12 # docker build \
13 # --build-arg CUDA_VERSION=${CUDA_VERSION} \
14 # --build-arg ROCKY_VERSION=${ROCKY_VERSION} \
15 # --tag alicevision/alicevision-deps:${AV_VERSION}-rocky${ROCKY_VERSION}-cuda${CUDA_TAG} \
16 # -f Dockerfile_rocky_deps .
17
18 # OS/Version (FILE): cat /etc/issue.net
19 # Cuda version (ENV): $CUDA_VERSION
20
21 RUN dnf install -y 'dnf-command(config-manager)'
22 RUN dnf config-manager --set-enabled devel
23 RUN dnf install -y epel-release
24 RUN dnf install -y gcc-toolset-12-gcc-c++
25 # RUN dnf remove -y gcc-g++ gcc
26 RUN update-alternatives --install /usr/bin/gcc gcc /opt/rh/gcc-toolset-12/root/usr/bin/gcc 60
27 RUN update-alternatives --install /usr/bin/g++ g++ /opt/rh/gcc-toolset-12/root/usr/bin/g++ 60
28 RUN update-alternatives --install /usr/bin/cpp cpp /opt/rh/gcc-toolset-12/root/usr/bin/cpp 60
29 RUN dnf install -y ca-certificates wget cmake git unzip pcre2-devel xerces-c-devel
30 RUN dnf install -y python3.11-devel python3.11-pip python3.11-pybind11-devel bison diffutils which file yasm
31 RUN dnf install -y gcc-toolset-12-gcc-gfortran libasan libubsan yaml-cpp
32 RUN dnf update -y
33
34 # RUN scl enable gcc-toolset-12 bash
35
36 # Set it permanently
37 ENV PATH="/opt/rh/gcc-toolset-12/root/usr/bin:$PATH"
38 ENV CC="/opt/rh/gcc-toolset-12/root/usr/bin/gcc"
39 ENV CXX="/opt/rh/gcc-toolset-12/root/usr/bin/g++"
40 ENV FC="/opt/rh/gcc-toolset-12/root/usr/bin/gfortran"
41
42 RUN gcc --version
43 RUN g++ --version
44 RUN gfortran --version
45
46 RUN python3.11 -m pip install numpy==1.*
47
48 ENV AV_DEV=/opt/AliceVision_git \
49 AV_BUILD=/tmp/AliceVision_build \
50 AV_INSTALL=/opt/AliceVision_install \
51 PATH="${PATH}:${AV_BUNDLE}"
52
53 COPY dl/vlfeat_K80L3.SIFT.tree ${AV_INSTALL}/share/aliceVision/
54 RUN echo "export ALICEVISION_VOCTREE=${AV_INSTALL}/share/aliceVision/vlfeat_K80L3.SIFT.tree" >> /etc/profile.d/alicevision.sh
55
56 COPY dl/sphereDetection_Mask-RCNN.onnx ${AV_INSTALL}/share/aliceVision/
57 RUN echo "export ALICEVISION_SPHERE_DETECTION_MODEL=${AV_INSTALL}/share/aliceVision/sphereDetection_Mask-RCNN.onnx" >> /etc/profile.d/alicevision.sh
58
59 COPY dl/fcn_resnet50.onnx ${AV_INSTALL}/share/aliceVision/
60 RUN echo "export ALICEVISION_SEMANTIC_SEGMENTATION_MODEL=${AV_INSTALL}/share/aliceVision/fcn_resnet50.onnx" >> /etc/profile.d/alicevision.sh
61
62 COPY dl/ColorChartDetectionModel ${AV_INSTALL}/share/aliceVision/ColorChartDetectionModel
63 RUN echo "export ALICEVISION_COLORCHARTDETECTION_MODEL_FOLDER=${AV_INSTALL}/share/aliceVision/ColorChartDetectionModel" >> /etc/profile.d/alicevision.sh
64
65 COPY docker/check-cpu.sh ${AV_DEV}/docker/check-cpu.sh
66 RUN export CPU_CORES=`${AV_DEV}/docker/check-cpu.sh` && echo "Build multithreading number of cores: ${CPU_CORES}"
67
68 COPY CMakeLists.txt ${AV_DEV}/
69 COPY src/cmake/Dependencies.cmake ${AV_DEV}/src/cmake/
70
71 COPY dl/deps ${AV_BUILD}/external/download/
72
73 # Symlink to Python3 executable in case a call to "python" instead of "python3" is ever made
74 RUN ln -s /usr/bin/python3.11 /usr/bin/python
75
76 WORKDIR "${AV_BUILD}"
77 RUN cmake "${AV_DEV}" \
78 -DCMAKE_BUILD_TYPE=Release \
79 -DALICEVISION_BUILD_DEPENDENCIES:BOOL=ON \
80 -DAV_BUILD_ZLIB:BOOL=ON \
81 -DAV_BUILD_ALICEVISION:BOOL=OFF \
82 -DAV_BUILD_CCTAG:BOOL=ON \
83 -DCMAKE_INSTALL_PREFIX="${AV_INSTALL}"
84
85 # Symlink lib64 to lib as qtOIIO expects to find OIIO in lib64
86 RUN mkdir -p "${AV_INSTALL}/lib" && \
87 ln -s lib "${AV_INSTALL}/lib64"
88
89 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
90
91
92 # # RUN make -j ${CPU_CORES} cuda
93 # RUN make -j ${CPU_CORES} boost
94 # RUN make -j ${CPU_CORES} openexr
95 # RUN make -j ${CPU_CORES} opencv
96 # RUN make -j ${CPU_CORES} eigen
97 # RUN make -j ${CPU_CORES} tbb
98 # RUN make -j ${CPU_CORES} cctag
99 # RUN make -j ${CPU_CORES} popsift
100 # RUN make -j ${CPU_CORES} onnxruntime
101 # RUN make -j ${CPU_CORES} turbojpeg
102 # RUN make -j ${CPU_CORES} assimp
103 # RUN make -j ${CPU_CORES} geogram
104 # RUN make -j ${CPU_CORES} lapack
105 # RUN make -j ${CPU_CORES} suitesparse
106 # RUN make -j ${CPU_CORES} ceres
107 # RUN make -j ${CPU_CORES} libraw
108 # RUN make -j ${CPU_CORES} ffmpeg
109 # RUN make -j ${CPU_CORES} openimageio
110 # RUN make -j ${CPU_CORES} alembic
111 # RUN make -j ${CPU_CORES} ffmpeg
112 # RUN make -j ${CPU_CORES} expat
113 # RUN make -j ${CPU_CORES} SWIG
114 # RUN make -j ${CPU_CORES} E57Format
115
116
117 RUN cmake --build . -j ${CPU_CORES} && \
118 mv "${AV_INSTALL}/bin" "${AV_INSTALL}/bin-deps" && \
119 rm -rf "${AV_BUILD}"