Skip to content

Commit 3cb0cc9

Browse files
sbryngelsonclaude
andauthored
Fix Docker build on ARM by pre-installing numpy (#1121)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b70292f commit 3cb0cc9

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ RUN apt-get update -y && \
1515
if [ "$TARGET" != "gpu" ]; then \
1616
apt-get install -y \
1717
build-essential git make cmake gcc g++ gfortran bc \
18-
python3.11 python3.11-venv python3-pip \
18+
python3.12 python3.12-venv python3-pip \
1919
openmpi-bin libopenmpi-dev libfftw3-dev \
2020
mpich libmpich-dev; \
2121
else \
2222
apt-get install -y \
2323
build-essential git make cmake bc \
24-
python3.11 python3.11-venv python3-pip \
24+
python3.12 python3.12-venv python3-pip \
2525
libfftw3-dev \
2626
openmpi-bin libopenmpi-dev; \
2727
fi && \
28-
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2 && \
28+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 && \
2929
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3030

3131
ENV OMPI_ALLOW_RUN_AS_ROOT=1
@@ -40,6 +40,13 @@ ENV FC=${FC_COMPILER}
4040
ENV PATH="${COMPILER_PATH}:$PATH"
4141
ENV LD_LIBRARY_PATH="${COMPILER_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH:-}"
4242

43+
# Pre-install numpy into the venv before mfc.sh runs, as it's required at
44+
# build time by several dependencies (pandas, cantera, matplotlib, etc.) that
45+
# may need to compile from source on architectures without pre-built wheels
46+
RUN python3.12 -m venv /opt/MFC/build/venv && \
47+
/opt/MFC/build/venv/bin/pip install --upgrade pip && \
48+
/opt/MFC/build/venv/bin/pip install numpy
49+
4350
RUN echo "TARGET=$TARGET CC=$CC_COMPILER FC=$FC_COMPILER" && \
4451
cd /opt/MFC && \
4552
if [ "$TARGET" = "gpu" ]; then \

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
TAG="${{ github.event.inputs.tag || github.ref_name }}"
5555
echo "tag=$TAG" >> $GITHUB_OUTPUT
5656
echo "TAG=$TAG" >> $GITHUB_ENV
57-
git clone --branch "$TAG" --depth 1 https://github.com/MFlowCode/MFC.git mfc
57+
git clone --branch "$TAG" --depth 1 ${{ github.server_url }}/${{ github.repository }}.git mfc
5858
5959
- name: Stage
6060
run: |

0 commit comments

Comments
 (0)