FROM ghcr.io/rocm/therock_build_manylinux_x86_64:latest ARG DEBIAN_FRONTEND=noninteractive ARG ROCMVERSION=7.2 ARG compiler_version="" ARG compiler_commit="" ARG DEB_ROCM_REPO=http://repo.radeon.com/rocm/apt/.apt_$ROCMVERSION/ ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn ENV DEBIAN_FRONTEND=noninteractive USER root # Add rocm repository RUN dnf clean all && dnf update -y && dnf -v install wget gnupg2 curl -y RUN wget https://repo.radeon.com/amdgpu-install/7.2/rhel/8.10/amdgpu-install-7.2.70200-1.el8.noarch.rpm && \ dnf install ./amdgpu-install-7.2.70200-1.el8.noarch.rpm -y && \ dnf update -y && \ dnf install python3-setuptools python3-wheel -y && \ dnf install rocm-dev -y # Install SCCACHE ENV SCCACHE_VERSION="0.14.0" ENV SCCACHE_INSTALL_LOCATION=/usr/local/.cargo/bin ENV PATH=$PATH:${SCCACHE_INSTALL_LOCATION} RUN set -x && \ mkdir -p ${SCCACHE_INSTALL_LOCATION} && \ wget -qO sccache.tar.gz https://github.com/mozilla/sccache/releases/latest/download/sccache-v$SCCACHE_VERSION-x86_64-unknown-linux-musl.tar.gz && \ tar -xzf sccache.tar.gz --strip-components=1 -C ${SCCACHE_INSTALL_LOCATION} && \ chmod +x ${SCCACHE_INSTALL_LOCATION}/sccache # Install dependencies RUN dnf update -y && DEBIAN_FRONTEND=noninteractive dnf install -y \ cmake \ clang-tools-extra \ gcc-c++ \ libstdc++ \ libstdc++-devel \ libstdc++-static \ git \ hip-rocclr \ jq \ mpich \ net-tools \ pkg-config \ redis \ sshpass \ stunnel \ vim \ nano \ zip \ openssh-server \ kmod && \ dnf clean all && \ rm -rf /var/lib/apt/lists/* && \ rm -rf amdgpu-install* && \ #Install latest ccache git clone https://github.com/ccache/ccache.git && \ cd ccache && mkdir build && cd build && cmake .. && make install && \ #Install ClangBuildAnalyzer git clone https://github.com/aras-p/ClangBuildAnalyzer.git && \ cd ClangBuildAnalyzer/ && \ make -f projects/make/Makefile && \ cd / && \ #Install latest cppcheck git clone https://github.com/danmar/cppcheck.git && \ cd cppcheck && mkdir build && cd build && cmake .. && cmake --build . && \ cd / && \ # Install packages for processing the performance results pip3 install --break-system-packages --upgrade pytest pymysql pandas==2.2.3 sqlalchemy==2.0.3 setuptools-rust setuptools sshtunnel==0.4.0 && \ # Add render group groupadd -f render && \ # Install the new rocm-cmake version git clone -b master https://github.com/ROCm/rocm-cmake.git && \ cd rocm-cmake && mkdir build && cd build && \ cmake .. && cmake --build . && cmake --build . --target install WORKDIR / # Add alternative compilers, if necessary ENV compiler_version=$compiler_version ENV compiler_commit=$compiler_commit RUN sh -c "echo compiler version = '$compiler_version'" && \ sh -c "echo compiler commit = '$compiler_commit'" RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-staging" ] ) && [ "$compiler_commit" = "" ]; then \ git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \ cd llvm-project && mkdir build && cd build && \ cmake -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra;flang;mlir" \ -DLLVM_LIT_ARGS="-vv --show-unsupported --show-xfail -j 32" \ -DPACKAGE_VENDOR="AMD" \ -DCMAKE_INSTALL_PREFIX=/home/$USER/rocm/pure_llvm_1.0 \ -DLLVM_ENABLE_ASSERTIONS=ON \ -DLLVM_BUILD_DOCS=ON \ -DLLVM_TARGETS_TO_BUILD=all \ -DLIBOMPTARGET_ENABLE_DEBUG=ON \ -DOFFLOAD_ENABLE_EMISSARY_APIS=OFF \ -DCLANG_DEFAULT_LINKER=lld \ -DCLANG_DEFAULT_PIE_ON_LINUX=0 \ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;openmp;compiler-rt;libunwind;flang-rt" \ -DLIBCXX_ENABLE_SHARED=OFF \ -DLIBCXX_ENABLE_STATIC=ON \ -DLIBCXX_INSTALL_LIBRARY=OFF \ -DLIBCXX_INSTALL_HEADERS=OFF \ -DLIBCXXABI_ENABLE_SHARED=OFF \ -DLIBCXXABI_ENABLE_STATIC=ON \ -DLIBCXXABI_INSTALL_STATIC_LIBRARY=OFF \ -DLLVM_ENABLE_ASSERTIONS=1 \ -DLLVM_ENABLE_Z3_SOLVER=OFF \ -DLLVM_ENABLE_ZLIB=ON \ -DLLVM_LINK_LLVM_DYLIB=OFF \ -DCLANG_LINK_CLANG_DYLIB=OFF \ ../llvm && \ ninja -j16 ; \ else echo "using the release compiler"; \ fi RUN if ( [ "$compiler_version" = "develop" ] || [ "$compiler_version" = "amd-staging" ] ) && [ "$compiler_commit" != "" ]; then \ git clone -b "$compiler_version" https://github.com/ROCm/llvm-project.git && \ cd llvm-project && git checkout "$compiler_commit" && echo "checking out commit $compiler_commit" && mkdir build && cd build && \ cmake -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra;flang;mlir" \ -DLLVM_LIT_ARGS="-vv --show-unsupported --show-xfail -j 32" \ -DPACKAGE_VENDOR="AMD" \ -DCMAKE_INSTALL_PREFIX=/home/$USER/rocm/pure_llvm_1.0 \ -DLLVM_ENABLE_ASSERTIONS=ON \ -DLLVM_BUILD_DOCS=ON \ -DLLVM_TARGETS_TO_BUILD=all \ -DLIBOMPTARGET_ENABLE_DEBUG=ON \ -DOFFLOAD_ENABLE_EMISSARY_APIS=OFF \ -DCLANG_DEFAULT_LINKER=lld \ -DCLANG_DEFAULT_PIE_ON_LINUX=0 \ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;openmp;compiler-rt;libunwind;flang-rt" \ -DLIBCXX_ENABLE_SHARED=OFF \ -DLIBCXX_ENABLE_STATIC=ON \ -DLIBCXX_INSTALL_LIBRARY=OFF \ -DLIBCXX_INSTALL_HEADERS=OFF \ -DLIBCXXABI_ENABLE_SHARED=OFF \ -DLIBCXXABI_ENABLE_STATIC=ON \ -DLIBCXXABI_INSTALL_STATIC_LIBRARY=OFF \ -DLLVM_ENABLE_ASSERTIONS=1 \ -DLLVM_ENABLE_Z3_SOLVER=OFF \ -DLLVM_ENABLE_ZLIB=ON \ -DLLVM_LINK_LLVM_DYLIB=OFF \ -DCLANG_LINK_CLANG_DYLIB=OFF \ ../llvm && \ ninja -j16 ; \ else echo "using the release compiler"; \ fi