@@ -7,8 +7,6 @@ ARG CXX_COMPILER
77ARG FC_COMPILER
88ARG COMPILER_PATH
99ARG COMPILER_LD_LIBRARY_PATH
10- ARG AFAR_VERSION
11- ARG OLCF_AFAR_ROOT=""
1210
1311ENV DEBIAN_FRONTEND=noninteractive
1412ENV TZ=UTC
@@ -29,47 +27,10 @@ RUN apt-get update -y && \
2927 python3.12 python3.12-venv python3-pip \
3028 libfftw3-dev \
3129 openmpi-bin libopenmpi-dev; \
32- elif [ "$TARGET" = "amd" ]; then \
33- apt-get install -y \
34- build-essential git make gcc g++ gfortran bc \
35- python3.12 python3.12-venv python3-pip \
36- libfftw3-dev libnuma1 libdrm2 libdrm-amdgpu1; \
3730 fi && \
3831 update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 && \
3932 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
4033
41- # AMD: download AFAR, install cmake 3.28 (Ubuntu 22.04 ships 3.22 which doesn't
42- # recognize amdflang as LLVMFlang), then build MPICH with amdflang so the
43- # generated mpi.mod is compiler-compatible.
44- RUN if [ "$TARGET" = "amd" ] && [ -n "$AFAR_VERSION" ]; then \
45- OLCF_AFAR_ROOT="/opt/${AFAR_VERSION}" && \
46- wget -q "https://repo.radeon.com/rocm/misc/flang/${AFAR_VERSION}-ubuntu.tar.bz2" -O /tmp/afar.tar.bz2 && \
47- tar -xjf /tmp/afar.tar.bz2 -C /opt/ && \
48- rm /tmp/afar.tar.bz2 && \
49- CMAKE_VER=3.28.6 && \
50- wget -q "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-linux-x86_64.sh" \
51- -O /tmp/cmake-install.sh && \
52- chmod +x /tmp/cmake-install.sh && \
53- /tmp/cmake-install.sh --prefix=/usr/local --skip-license --exclude-subdir && \
54- rm /tmp/cmake-install.sh && \
55- printf '#!/bin/bash\n args=()\n while [ "$#" -gt 0 ]; do\n if [ "$1" = "-soname" ]; then\n args+=("-Wl,-soname,$2"); shift 2\n else\n args+=("$1"); shift\n fi\n done\n exec ' "${OLCF_AFAR_ROOT}" '/bin/amdflang "${args[@]}"\n ' \
56- > /usr/local/bin/amdflang-ld-wrap && \
57- chmod +x /usr/local/bin/amdflang-ld-wrap && \
58- MPICH_VER=3.4.3 && \
59- wget -q "https://www.mpich.org/static/downloads/${MPICH_VER}/mpich-${MPICH_VER}.tar.gz" \
60- -O /tmp/mpich.tar.gz && \
61- mkdir -p /tmp/mpich-src && \
62- tar -xzf /tmp/mpich.tar.gz -C /tmp/mpich-src --strip-components=1 && \
63- cd /tmp/mpich-src && \
64- FC=/usr/local/bin/amdflang-ld-wrap CC=gcc CXX=g++ \
65- ./configure --prefix=/opt/mpich --enable-shared --disable-static \
66- --with-device=ch3 2>&1 && \
67- make -j$(nproc) 2>&1 && \
68- make install 2>&1 && \
69- cd / && \
70- rm -rf /tmp/mpich-src /tmp/mpich.tar.gz; \
71- fi
72-
7334ENV OMPI_ALLOW_RUN_AS_ROOT=1
7435ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
7536ENV HYDRA_LAUNCHER=fork
@@ -80,7 +41,6 @@ COPY ../ /opt/MFC
8041ENV CC=${CC_COMPILER}
8142ENV CXX=${CXX_COMPILER}
8243ENV FC=${FC_COMPILER}
83- ENV OLCF_AFAR_ROOT=${OLCF_AFAR_ROOT}
8444ENV PATH="${COMPILER_PATH}:/opt/mpich/bin:$PATH"
8545ENV LD_LIBRARY_PATH="${COMPILER_LD_LIBRARY_PATH}:/opt/mpich/lib:${LD_LIBRARY_PATH:-}"
8646
@@ -95,17 +55,13 @@ RUN echo "TARGET=$TARGET CC=$CC_COMPILER FC=$FC_COMPILER" && \
9555 cd /opt/MFC && \
9656 if [ "$TARGET" = "gpu" ]; then \
9757 ./mfc.sh build --gpu acc -j $(nproc); \
98- elif [ "$TARGET" = "amd" ]; then \
99- ./mfc.sh build --gpu mp -j $(nproc); \
10058 else \
10159 ./mfc.sh build -j $(nproc); \
10260 fi
10361
10462RUN cd /opt/MFC && \
10563 if [ "$TARGET" = "gpu" ]; then \
10664 ./mfc.sh test -a --dry-run --gpu acc -j $(nproc); \
107- elif [ "$TARGET" = "amd" ]; then \
108- ./mfc.sh test -a --dry-run --gpu mp -j $(nproc); \
10965 else \
11066 ./mfc.sh test -a --dry-run -j $(nproc); \
11167 fi
0 commit comments