-
Notifications
You must be signed in to change notification settings - Fork 627
/
Copy pathDockerfile.deps
78 lines (67 loc) · 4.84 KB
/
Dockerfile.deps
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
#########################################################################################
## Build DALI dependencies on top of manylinux2014
## DALI is based on "manylinux2014", official page https://github.com/pypa/manylinux
#########################################################################################
ARG FROM_IMAGE_NAME=quay.io/pypa/manylinux2014_x86_64
ARG BUILDER_EXTRA_DEPS=scratch
FROM ${BUILDER_EXTRA_DEPS} as extra_deps
FROM ${FROM_IMAGE_NAME}
# Install yum Dependencies
RUN yum install -y wget doxygen graphviz gettext xz openssl autogen zip \
devtoolset-10-libasan-devel devtoolset-10-liblsan-devel \
devtoolset-10-libtsan-devel devtoolset-10-libubsan-devel \
perl perl-IPC-Cmd
ENV ACLOCAL_PATH=/usr/share/aclocal/:/usr/local/share/aclocal
# Don't want the short-unicode version for Python 2.7
RUN rm -f /opt/python/cp27-cp27m
RUN CMAKE_VERSION=3.20.1 && CMAKE_ARCH=$(uname -m) && \
wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.sh && \
test -e /bin/sh || ln -s /usr/bin/sh /bin/sh && \
chmod +x cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.sh && \
./cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.sh --prefix=/usr/local --skip-license && \
rm -rf cmake-${CMAKE_VERSION}-linux-${CMAKE_ARCH}.sh
# We need newer NASM than manylinux2014 offers
RUN cd /tmp && \
curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2 && \
tar xjvf nasm-2.15.05.tar.bz2 && \
cd nasm-2.15.05 && \
./autogen.sh && \
./configure && \
make && \
make install
# Clang, build it before deps as deps changes more frequently
RUN CLANG_VERSION=15.0.2 && \
cd /tmp && \
wget https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${CLANG_VERSION}.tar.gz && \
tar -xf llvmorg-*.tar.gz && \
rm -rf llvmorg-*.tar.gz && \
cd llvm-* && \
mkdir build && \
cd build && \
cmake -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm && \
make -j"$(grep ^processor /proc/cpuinfo | wc -l)" install && \
cd /tmp && \
rm -rf llvm-* && \
sed -i 's/#if __cplusplus >= 201103L \&\& CUDA_VERSION >= 9000/\#if __cplusplus >= 201103L \&\& CUDA_VERSION >= 9000 \&\& CUDA_VERSION < 12000/g' \
/usr/local/lib/clang/${CLANG_VERSION}/include/__clang_cuda_runtime_wrapper.h && \
sed -i -z 's/#if CUDA_VERSION >= 9000\n\/\/ Provide a hint that texture support needs C++11./#if CUDA_VERSION >= 9000 \&\& CUDA_VERSION < 12000\n\/\/ Provide a hint that texture support needs C++11./g' \
/usr/local/lib/clang/${CLANG_VERSION}/include/__clang_cuda_runtime_wrapper.h && \
sed -i 's/#include "crt\/device_functions.hpp"/#include "crt\/device_functions.h"/g' \
/usr/local/lib/clang/${CLANG_VERSION}/include/__clang_cuda_runtime_wrapper.h
COPY DALI_DEPS_VERSION /tmp
ARG DALI_DEPS_REPO
ENV DALI_DEPS_REPO=${DALI_DEPS_REPO:-https://github.com/NVIDIA/DALI_deps}
ARG DALI_DEPS_VERSION_SHA
ENV DALI_DEPS_VERSION_SHA=${DALI_DEPS_VERSION_SHA}
# run in /bin/bash to have more advanced features supported like list
RUN /bin/bash -c 'DALI_DEPS_VERSION_SHA=${DALI_DEPS_VERSION_SHA:-$(cat /tmp/DALI_DEPS_VERSION)} && \
git clone ${DALI_DEPS_REPO} /tmp/dali_deps && \
cd /tmp/dali_deps && \
git checkout ${DALI_DEPS_VERSION_SHA} && \
git submodule init && \
git submodule update --depth 1 --init --recursive && \
export CC_COMP=${CC} && \
export CXX_COMP=${CXX} && \
/tmp/dali_deps/build_scripts/build_deps.sh && rm -rf /tmp/dali_deps && rm -rf /tmp/DALI_DEPS_VERSION'
# extra deps
COPY --from=extra_deps / /