Skip to content

Commit 054c437

Browse files
authored
add dockerfile for manylinux (#3651)
1 parent 7ac3794 commit 054c437

1 file changed

Lines changed: 101 additions & 0 deletions

File tree

Dockerfile.manylinux

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
FROM ghcr.io/rocm/therock_build_manylinux_x86_64:latest
2+
ARG DEBIAN_FRONTEND=noninteractive
3+
ARG ROCMVERSION=7.2
4+
ARG compiler_version=""
5+
ARG compiler_commit=""
6+
ARG CK_SCCACHE=""
7+
ARG DEB_ROCM_REPO=http://repo.radeon.com/rocm/apt/.apt_$ROCMVERSION/
8+
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
9+
ENV DEBIAN_FRONTEND=noninteractive
10+
11+
USER root
12+
13+
# Add rocm repository
14+
RUN dnf clean all && dnf update -y && dnf -v install wget gnupg2 curl -y
15+
16+
RUN wget https://repo.radeon.com/amdgpu-install/7.2/rhel/8.10/amdgpu-install-7.2.70200-1.el8.noarch.rpm && \
17+
dnf install ./amdgpu-install-7.2.70200-1.el8.noarch.rpm -y && \
18+
dnf update -y && \
19+
dnf install python3-setuptools python3-wheel -y && \
20+
dnf install rocm-dev -y
21+
22+
## Sccache binary built from source for ROCm, only install if CK_SCCACHE is defined
23+
ARG SCCACHE_REPO_URL=http://compute-artifactory.amd.com/artifactory/rocm-generic-experimental/rocm-sccache
24+
ENV SCCACHE_INSTALL_LOCATION=/usr/local/.cargo/bin
25+
ENV PATH=$PATH:${SCCACHE_INSTALL_LOCATION}
26+
ENV CK_SCCACHE=$CK_SCCACHE
27+
RUN if [ "$CK_SCCACHE" != "" ]; then \
28+
mkdir -p ${SCCACHE_INSTALL_LOCATION} && \
29+
curl ${SCCACHE_REPO_URL}/portable/0.2.16/sccache-0.2.16-alpha.1-rocm --output ${SCCACHE_INSTALL_LOCATION}/sccache && \
30+
chmod +x ${SCCACHE_INSTALL_LOCATION}/sccache; \
31+
fi
32+
33+
# Install dependencies
34+
RUN dnf update -y && DEBIAN_FRONTEND=noninteractive dnf install -y \
35+
cmake \
36+
clang-tools-extra \
37+
gcc-c++ \
38+
libstdc++ \
39+
libstdc++-devel \
40+
libstdc++-static \
41+
git \
42+
hip-rocclr \
43+
jq \
44+
mpich \
45+
net-tools \
46+
pkg-config \
47+
redis \
48+
sshpass \
49+
stunnel \
50+
vim \
51+
nano \
52+
zip \
53+
openssh-server \
54+
kmod && \
55+
dnf clean all && \
56+
rm -rf /var/lib/apt/lists/* && \
57+
rm -rf amdgpu-install* && \
58+
#Install latest ccache
59+
git clone https://github.com/ccache/ccache.git && \
60+
cd ccache && mkdir build && cd build && cmake .. && make install && \
61+
#Install ClangBuildAnalyzer
62+
git clone https://github.com/aras-p/ClangBuildAnalyzer.git && \
63+
cd ClangBuildAnalyzer/ && \
64+
make -f projects/make/Makefile && \
65+
cd / && \
66+
#Install latest cppcheck
67+
git clone https://github.com/danmar/cppcheck.git && \
68+
cd cppcheck && mkdir build && cd build && cmake .. && cmake --build . && \
69+
cd / && \
70+
# Install packages for processing the performance results
71+
pip3 install --break-system-packages --upgrade pytest pymysql pandas==2.2.3 sqlalchemy==2.0.3 setuptools-rust setuptools sshtunnel==0.4.0 && \
72+
# Add render group
73+
groupadd -f render && \
74+
# Install the new rocm-cmake version
75+
git clone -b master https://github.com/ROCm/rocm-cmake.git && \
76+
cd rocm-cmake && mkdir build && cd build && \
77+
cmake .. && cmake --build . && cmake --build . --target install
78+
79+
WORKDIR /
80+
# Add alternative compilers, if necessary
81+
ENV compiler_version=$compiler_version
82+
ENV compiler_commit=$compiler_commit
83+
RUN sh -c "echo compiler version = '$compiler_version'" && \
84+
sh -c "echo compiler commit = '$compiler_commit'"
85+
86+
RUN if ( [ "$compiler_version" = "amd-staging" ] || [ "$compiler_version" = "amd-mainline" ] ) && [ "$compiler_commit" = "" ]; then \
87+
git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
88+
cd llvm-project && mkdir build && cd build && \
89+
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_ENABLE_RUNTIMES="compiler-rt" ../llvm && \
90+
make -j 8 ; \
91+
else echo "using the release compiler"; \
92+
fi
93+
94+
RUN if ( [ "$compiler_version" = "amd-staging" ] || [ "$compiler_version" = "amd-mainline" ] ) && [ "$compiler_commit" != "" ]; then \
95+
git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \
96+
cd llvm-project && git checkout "$compiler_commit" && echo "checking out commit $compiler_commit" && mkdir build && cd build && \
97+
cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_ENABLE_RUNTIMES="compiler-rt" ../llvm && \
98+
make -j 8 ; \
99+
else echo "using the release compiler"; \
100+
fi
101+

0 commit comments

Comments
 (0)