Skip to content

Commit c9dd2e3

Browse files
Fix Dockerfile /usr/lib locations for aarch64 (parflow#722)
This PR replaces hardcoding `/usr/lib/x86_64-linux-gnu` library location with `dpkg-architecture -qDEB_HOST_MULTIARCH`. This allows the Docker image to be built on aarch64 (arm64) processors. * Determine /usr/lib/<arch> location using dpkg-architecture * Upgrade Silo to support AArch64 * Fix Docker build warnings --------- Co-authored-by: Steven Smith <smith84@llnl.gov>
1 parent 9e9ae2b commit c9dd2e3

3 files changed

Lines changed: 27 additions & 25 deletions

File tree

.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ jobs:
486486
CACHE_HIT: ${{steps.cache-parflow-dependencies.outputs.cache-hit}}
487487
run: |
488488
if [[ "$CACHE_HIT" != 'true' ]]; then
489-
URL=https://github.com/LLNL/Silo/archive/refs/tags/4.11.1.tar.gz
489+
URL=https://github.com/LLNL/Silo/archive/refs/tags/4.12.0.tar.gz
490490
mkdir silo
491491
cd silo
492492
curl -L $URL | tar --strip-components=1 -xz

.github/workflows/macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
CACHE_HIT: ${{steps.cache-parflow-dependencies.outputs.cache-hit}}
125125
run: |
126126
if [[ "$CACHE_HIT" != 'true' ]]; then
127-
URL=https://github.com/LLNL/Silo/archive/refs/tags/4.11.1.tar.gz
127+
URL=https://github.com/LLNL/Silo/archive/refs/tags/4.12.0.tar.gz
128128
mkdir silo
129129
cd silo
130130
curl -L $URL | tar --strip-components=1 -xz
@@ -137,7 +137,7 @@ jobs:
137137
CACHE_HIT: ${{steps.cache-parflow-dependencies.outputs.cache-hit}}
138138
run: |
139139
if [[ "$CACHE_HIT" != 'true' ]]; then
140-
URL=https://github.com/hypre-space/hypre/archive/v2.26.0.tar.gz
140+
URL=https://github.com/hypre-space/hypre/archive/v2.33.0.tar.gz
141141
mkdir hypre
142142
cd hypre
143143
curl -L $URL | tar --strip-components=1 -xz

Dockerfile

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# start by building the basic container
33
#-----------------------------------------------------------------------------
44
FROM ubuntu:22.04
5-
MAINTAINER Steven Smith <smith84@llnl.gov>
5+
LABEL org.opencontainers.image.authors="Steven Smith <smith84@llnl.gov>"
66

77
# Non interactive mode
8-
ENV DEBIAN_FRONTEND noninteractive
8+
ENV DEBIAN_FRONTEND=noninteractive
99

1010
RUN apt-get update && \
1111
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
@@ -38,9 +38,9 @@ RUN mkdir -p /home/parflow
3838
#-----------------------------------------------------------------------------
3939
# Set environment vars
4040
#-----------------------------------------------------------------------------
41-
ENV PARFLOW_DIR /usr/opt/parflow
42-
ENV PARFLOW_DEP_DIR /usr/opt/parflow
43-
ENV PATH $PATH:$PARFLOW_DIR/bin
41+
ENV PARFLOW_DIR=/usr/opt/parflow
42+
ENV PARFLOW_DEP_DIR=/usr/opt/parflow
43+
ENV PATH=$PATH:$PARFLOW_DIR/bin
4444

4545
#-----------------------------------------------------------------------------
4646
# Build libraries
@@ -52,7 +52,7 @@ ENV PATH $PATH:$PARFLOW_DIR/bin
5252
# https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.2/src/hdf5-1.12.2.tar.bz2
5353
#
5454
# WORKDIR /home/parflow
55-
# RUN wget -q https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.21/src/hdf5-1.8.21.tar.gz && \
55+
# RUN wget -q https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.21/src/hdf5-1.8.21.tar.gz && \
5656
# tar -xf hdf5-1.8.21.tar.gz && \
5757
# cd hdf5-1.8.21 && \
5858
# CC=mpicc ./configure \
@@ -64,12 +64,13 @@ ENV PATH $PATH:$PARFLOW_DIR/bin
6464

6565
#
6666
# NetCDF
67-
#
67+
#
6868
WORKDIR /home/parflow
69-
run wget -q https://github.com/Unidata/netcdf-c/archive/v4.9.0.tar.gz && \
69+
RUN wget -q https://github.com/Unidata/netcdf-c/archive/v4.9.0.tar.gz && \
7070
tar -xf v4.9.0.tar.gz && \
7171
cd netcdf-c-4.9.0 && \
72-
CC=mpicc CPPFLAGS=-I/usr/include/hdf5/openmpi LDFLAGS=-L/usr/lib/x86_64-linux-gnu/hdf5/openmpi ./configure --prefix=${PARFLOW_DIR} && \
72+
arch=$(dpkg-architecture -qDEB_HOST_MULTIARCH) && \
73+
CC=mpicc CPPFLAGS=-I/usr/include/hdf5/openmpi LDFLAGS=-L/usr/lib/$arch/hdf5/openmpi ./configure --prefix=${PARFLOW_DIR} && \
7374
make && \
7475
make install && \
7576
cd .. && \
@@ -79,7 +80,7 @@ run wget -q https://github.com/Unidata/netcdf-c/archive/v4.9.0.tar.gz && \
7980
# NetCDF Fortran
8081
#
8182
WORKDIR /home/parflow
82-
run wget -q https://github.com/Unidata/netcdf-fortran/archive/v4.5.4.tar.gz && \
83+
RUN wget -q https://github.com/Unidata/netcdf-fortran/archive/v4.5.4.tar.gz && \
8384
tar -xf v4.5.4.tar.gz && \
8485
cd netcdf-fortran-4.5.4 && \
8586
CC=mpicc FC=mpifort CPPFLAGS=-I${PARFLOW_DIR}/include LDFLAGS=-L${PARFLOW_DIR}/lib ./configure --prefix=${PARFLOW_DIR} && \
@@ -92,41 +93,42 @@ run wget -q https://github.com/Unidata/netcdf-fortran/archive/v4.5.4.tar.gz && \
9293
# SILO
9394
#
9495
WORKDIR /home/parflow
95-
RUN wget -q https://github.com/LLNL/Silo/archive/refs/tags/4.10.2.tar.gz && \
96-
tar -xf 4.10.2.tar.gz && \
97-
cd Silo-4.10.2 && \
98-
./configure --prefix=$PARFLOW_DIR --disable-silex --disable-hzip --disable-fpzip && \
96+
RUN wget -q https://github.com/LLNL/Silo/archive/refs/tags/4.12.0.tar.gz && \
97+
tar -xf 4.12.0.tar.gz && \
98+
cd Silo-4.12.0 && \
99+
./configure --disable-silex --disable-hzip --disable-fpzip --enable-shared=yes --prefix=$PARFLOW_DIR && \
99100
make install && \
100101
cd .. && \
101-
rm -fr Silo-4.10.2 4.10.2.tar.gz
102+
rm -fr Silo-4.12.0 4.12.0.tar.gz
102103

103104
#
104105
# Hypre
105106
#
106107
WORKDIR /home/parflow
107-
RUN wget -q https://github.com/hypre-space/hypre/archive/v2.26.0.tar.gz && \
108-
tar xf v2.26.0.tar.gz && \
109-
cd hypre-2.26.0/src && \
108+
RUN wget -q https://github.com/hypre-space/hypre/archive/v2.33.0.tar.gz && \
109+
tar xf v2.33.0.tar.gz && \
110+
cd hypre-2.33.0/src && \
110111
./configure --prefix=$PARFLOW_DIR && \
111112
make install && \
112113
cd ../.. && \
113-
rm -fr hypre-2.18.2 v2.18.2.tar.gz
114+
rm -fr hypre-2.33.0 v2.33.0.tar.gz
114115

115116
#-----------------------------------------------------------------------------
116117
# Parflow configure and build
117118
#-----------------------------------------------------------------------------
118119

119-
ENV PARFLOW_MPIEXEC_EXTRA_FLAGS "--mca mpi_yield_when_idle 1 --oversubscribe --allow-run-as-root"
120+
ENV PARFLOW_MPIEXEC_EXTRA_FLAGS="--mca mpi_yield_when_idle 1 --oversubscribe --allow-run-as-root"
120121

121122
# Disable HWLOC warnings from showing up, confusing messages, this has been fixed in later OpenMPI versions
122-
ENV HWLOC_HIDE_ERRORS "2"
123+
ENV HWLOC_HIDE_ERRORS="2"
123124

124125
WORKDIR /home/parflow
125126

126127
RUN git clone -b master --single-branch https://github.com/parflow/parflow.git parflow
127128

128129
RUN mkdir -p build && \
129130
cd build && \
131+
arch=$(dpkg-architecture -qDEB_HOST_MULTIARCH) && \
130132
cmake ../parflow \
131133
-DPARFLOW_AMPS_LAYER=mpi1 \
132134
-DPARFLOW_AMPS_SEQUENTIAL_IO=TRUE \
@@ -137,7 +139,7 @@ RUN mkdir -p build && \
137139
-DPARFLOW_ENABLE_TIMING=TRUE \
138140
-DPARFLOW_HAVE_CLM=TRUE \
139141
-DPARFLOW_ENABLE_PYTHON=TRUE \
140-
-DCURL_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurl.so.4 \
142+
-DCURL_LIBRARY=/usr/lib/$arch/libcurl.so.4 \
141143
-DCMAKE_INSTALL_PREFIX=$PARFLOW_DIR && \
142144
make install && \
143145
cd .. && \

0 commit comments

Comments
 (0)