Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 45 additions & 27 deletions docker/Dockerfile_mac.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM --platform=linux/arm64 ubuntu:latest
LABEL maintainer="vera.oberhauser@ukaea.uk"
LABEL version="1.2.1"
LABEL description="Docker container for ReMKiT1D CI"
LABEL version="1.3.0"
LABEL description="Docker container for ReMKiT1D for ARM64"

# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive
Expand All @@ -15,17 +15,15 @@ RUN apt update \
&& apt install -y \
gfortran-11 \
g++-11 \
python3 \
python3-dev \
pip \
libblas-dev \
libhdf5-dev \
liblapack-dev \
m4 \
wget \
git \
gcovr \
gcovr \
gcc-arm-linux-gnueabihf \
python3 \
python3-dev \
build-essential \
pkg-config

Expand Down Expand Up @@ -57,7 +55,10 @@ RUN mkdir mpich-install
WORKDIR /home/mpich-3.4.2

# ReMKiT1D Requires gfortran-11, gcc-11 and g++-11. CMake Installs the Package to the mpich-install Folder
RUN ./configure CC=gcc-11 CXX=g++-11 FC=gfortran-11 --prefix=/home/mpich-install FFLAGS=-fallow-argument-mismatch --with-device=ch3
RUN ./configure CC=gcc-11 CXX=g++-11 FC=gfortran-11 \
--prefix=/home/mpich-install \
FFLAGS="-fallow-argument-mismatch" \
--with-device=ch3

RUN make
RUN make install
Expand All @@ -69,19 +70,27 @@ ENV PATH=/home/mpich-install/bin:$PATH
# PETSc-3.17 is the Newest Release that has been Tested on ReMKiT1D (3.18 not Compatible)
RUN git clone -b release-3.17 https://gitlab.com/petsc/petsc.git petsc

WORKDIR petsc/
WORKDIR /home/petsc

#PETSc Requires MPI and PETSc is Told Where MPI (mpich-4.2.2) is Installed
RUN ./configure --with-mpi-dir=/home/mpich-install --download-hypre=1 --download-fblaslapack=1 --with-debugging=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3
# ARM64 optimization flags for Apple Silicon
RUN ./configure \
--with-mpi-dir=/home/mpich-install \
--download-hypre=1 \
--download-fblaslapack=1 \
--with-debugging=0 \
COPTFLAGS="-O3 -mcpu=native" \
CXXOPTFLAGS="-O3 -mcpu=native" \
FOPTFLAGS="-O3 -mcpu=native"
RUN make PETSC_DIR=/home/petsc PETSC_ARCH=arch-linux-c-opt all check

WORKDIR /home

# pFUnit-4.2.2 is Installed for the use of Unit Testing
RUN git clone -b v4.2.2 https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git
WORKDIR pFUnit
RUN mkdir build
WORKDIR build
WORKDIR /home/pFUnit
RUN mkdir -p /home/pFUnit/build
WORKDIR /home/pFUnit/build

# ReMKiT1D Requires gfortran-11, gcc-11 and g++-11. CMake Installs the Package to the 'installs' Folder
RUN cmake .. -DSKIP_OPENMP=yes -DCMAKE_Fortran_COMPILER=gfortran-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_INSTALL_PREFIX=/home/installs/pFUnit
Expand All @@ -91,9 +100,9 @@ WORKDIR /home
# ReMKiT1D is Currently using json-fortran-8.2.5
RUN git clone -b 8.2.5 https://github.com/jacobwilliams/json-fortran.git

WORKDIR json-fortran
RUN mkdir build
WORKDIR build
WORKDIR /home/json-fortran
RUN mkdir -p /home/json-fortran/build
WORKDIR /home/json-fortran/build

# ReMKiT1D Requires gfortran-11, gcc-11 and g++-11. CMake Installs the Package to the 'installs' Folder
RUN cmake .. -DCMAKE_Fortran_COMPILER=gfortran-11 -DCMAKE_INSTALL_PREFIX=/home/installs/json-fortran -DSKIP_DOC_GEN=TRUE
Expand All @@ -102,23 +111,31 @@ RUN make install
WORKDIR /home

# HDF5 is Required and HDF5-1.13.0 is used within the main.yml Workflow Script
RUN git clone -b hdf5-1_13_0 https://github.com/HDFGroup/hdf5.git

WORKDIR hdf5
RUN mkdir build
WORKDIR build
# Use a shallow clone and configure git to be more tolerant of curl/TLS issues
# This reduces the data transferred and avoids common fetch-pack disconnects
RUN git config --global http.version HTTP/1.1 && \
git config --global http.postBuffer 524288000 && \
git clone --depth 1 --branch hdf5-1_13_0 --single-branch https://github.com/HDFGroup/hdf5.git || \
(echo "git clone failed, attempting to download hdf5 release tarball" && \
wget -O hdf5.tar.gz https://github.com/HDFGroup/hdf5/archive/refs/heads/hdf5-1_13_0.tar.gz && \
mkdir hdf5 && tar -xzf hdf5.tar.gz --strip-components=1 -C hdf5)

WORKDIR /home/hdf5
RUN mkdir -p /home/hdf5/build
WORKDIR /home/hdf5/build

# ReMKiT1D Requires gfortran-11, gcc-11 and g++-11. CMake Installs the Package to the 'installs' Folder
RUN cmake .. -DCMAKE_Fortran_COMPILER=gfortran-11 -DCMAKE_C_COMPILER=gcc-11 -DCMAKE_CXX_COMPILER=g++-11 -DHDF5_BUILD_FORTRAN=ON -DCMAKE_INSTALL_PREFIX=/home/installs/hdf5

RUN make install
WORKDIR /home


# ReMKiT1D v1.2.0+ requires sundials
RUN git clone -b v7.2.1 https://github.com/LLNL/sundials.git
WORKDIR sundials
RUN mkdir build
WORKDIR build
WORKDIR /home/sundials
RUN mkdir -p /home/sundials/build
WORKDIR /home/sundials/build

RUN cmake .. -DENABLE_MPI=ON -DCMAKE_INSTALL_PREFIX=/home/installs/sundials -DENABLE_LAPACK=ON -DBUILD_FORTRAN_MODULE_INTERFACE=ON -DCMAKE_C_COMPILER=gcc-11
RUN make
Expand All @@ -127,16 +144,17 @@ RUN make install
WORKDIR /home

RUN echo LD_LIBRARY_PATH=/home/mpich-install/lib:$LD_LIBRARY_PATH
RUN echo LD_LIBRARY_PATH=/home/sundials/lib:$LD_LIBRARY_PATH
Comment on lines 129 to +147
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These RUN echo commands only print the variable values but don't actually set them. The LD_LIBRARY_PATH environment variable is not being configured. Either remove these lines if they're debugging statements, or replace them with ENV LD_LIBRARY_PATH=/home/mpich-install/lib:/home/sundials/lib:$LD_LIBRARY_PATH to properly set the variable.

Suggested change
RUN echo LD_LIBRARY_PATH=/home/mpich-install/lib:$LD_LIBRARY_PATH
RUN echo LD_LIBRARY_PATH=/home/sundials/lib:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/home/mpich-install/lib:/home/sundials/lib:$LD_LIBRARY_PATH

Copilot uses AI. Check for mistakes.


# Add the PATH to assist CMake and Make Find the Required Compilation Files
ENV PFUNIT_DIR=/home/installs/pFUnit
ENV PETSC_DIR=/home/petsc
ENV PETSC_ARCH=arch-linux-c-opt
ENV PATH=$PATH:/home/installs
ENV PATH=$PATH:/home/installs/petsc
ENV PATH=$PATH:/home/installs/hdf5
ENV PATH=$PATH:/home/installs/json-fortran/jsonfortran-gnu-8.2.5
ENV PATH=$PATH:/home/mpich-install/bin:$PATH
Copy link

Copilot AI Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PATH is appended with :$PATH at the end, which creates a redundant reference. This line adds /home/mpich-install/bin to PATH and then appends the entire PATH again. It should be ENV PATH=$PATH:/home/mpich-install/bin or ENV PATH=/home/mpich-install/bin:$PATH.

Suggested change
ENV PATH=$PATH:/home/mpich-install/bin:$PATH
ENV PATH=$PATH:/home/mpich-install/bin

Copilot uses AI. Check for mistakes.
ENV PATH=$PATH:/home/installs/sundials
ENV LD_LIBRARY_PATH=/home/mpich-install/lib:$LD_LIBRARY_PATH
ENV LD_LIBRARY_PATH=/home/sundials/lib:$LD_LIBRARY_PATH
ENV SUNDIALS_DIR=/home/installs/sundials/lib/cmake/sundials
ENV SUNDIALS_DIR=/home/installs/sundials/lib/cmake/sundials
Loading