Skip to content

Commit 89fb14a

Browse files
authored
More complete Rocky (Redhat) image (#3817)
* Add SLEPc to Redhat image * Use packages * Adjust package * Remove openblas package * Update * Paths * Update * Fix path * Update * Update * Small fix * Updates * Simplify
1 parent 209b149 commit 89fb14a

File tree

2 files changed

+23
-34
lines changed

2 files changed

+23
-34
lines changed

docker/Dockerfile.redhat

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ FROM rockylinux/rockylinux:10
77

88
ARG BUILD_NP=4
99

10-
ARG HDF5_VERSION=1.14.6
1110
ARG PETSC_VERSION=3.23.4
12-
ARG MPICH_VERSION=4.2.3
11+
ARG SLEPC_VERSION=3.23.2
1312

1413
WORKDIR /tmp
1514

@@ -25,46 +24,33 @@ RUN dnf -y update && \
2524
gcc \
2625
gcc-c++ \
2726
gcc-gfortran \
27+
hdf5-mpich-devel \
28+
mpich-devel \
2829
pugixml-devel \
2930
python3 \
3031
python3-devel \
3132
python3-pip \
3233
spdlog-devel \
33-
# Required for PETSc build
3434
diffutils \
3535
findutils \
3636
flex \
37-
# Utility
3837
git \
39-
# Only in crb set
4038
ninja-build \
4139
openblas-devel && \
4240
dnf -y clean all && \
4341
rm -rf /var/cache
4442

43+
ENV PATH=/usr/lib64/mpich/bin:$PATH LD_LIBRARY_PATH=/usr/lib64/mpich/lib
44+
4545
# Broaden default minimal dynamic library path lookup to /usr/local/lib (PETSc
4646
# issue #1154) and /usr/local/lib64
4747
RUN echo "/usr/local/lib/" > /etc/ld.so.conf.d/usr-local-lib.conf && \
4848
echo "/usr/local/lib64" > /etc/ld.so.conf.d/usr-local-lib64.conf
4949

50-
# Build MPICH (see https://github.com/pmodels/mpich/issues/5811)
51-
RUN curl -L -O https://www.mpich.org/static/downloads/${MPICH_VERSION}/mpich-${MPICH_VERSION}.tar.gz && \
52-
tar -xf mpich-${MPICH_VERSION}.tar.gz && \
53-
cd mpich-${MPICH_VERSION} && \
54-
FCFLAGS=-fallow-argument-mismatch FFLAGS=-fallow-argument-mismatch ./configure --with-device=ch4:ofi --enable-shared --prefix=/usr/local --libdir=/usr/local/lib64 && \
55-
make -j${BUILD_NP} install && \
56-
rm -rf /tmp/*
57-
58-
# Build HDF5
59-
RUN curl -L -O https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5_${HDF5_VERSION}.tar.gz && \
60-
tar -xf hdf5_${HDF5_VERSION}.tar.gz && \
61-
cd hdf5-hdf5_${HDF5_VERSION} && \
62-
./configure --prefix=/usr/local --libdir=/usr/local/lib64 --enable-parallel --enable-shared --enable-static=no && \
63-
make -j${BUILD_NP} install && \
64-
rm -rf /tmp/*
50+
RUN python3 -m pip -v install --no-cache-dir cython mpi4py numba numpy patchelf pyproject setuptools wheel
6551

66-
# Build PETSc
67-
RUN git clone -b v${PETSC_VERSION} https://gitlab.com/petsc/petsc.git && \
52+
# Build PETSc
53+
RUN git clone --depth=1 -b v${PETSC_VERSION} https://gitlab.com/petsc/petsc.git && \
6854
cd petsc && \
6955
python3 ./configure \
7056
--with-shared-libraries \
@@ -78,19 +64,24 @@ RUN git clone -b v${PETSC_VERSION} https://gitlab.com/petsc/petsc.git && \
7864
--download-mumps \
7965
--download-scalapack \
8066
--download-superlu_dist \
81-
--prefix=/usr/local \
82-
--libdir=/usr/local/lib64 \
67+
--prefix=/usr/local/petsc \
8368
--with-make-np=${BUILD_NP} && \
8469
make all && \
8570
make install && \
8671
cd src/binding/petsc4py && \
87-
PETSC_DIR=/usr/local python3 -m pip install --no-cache-dir . && \
88-
rm -rf /tmp/* && \
89-
ldconfig
72+
PETSC_DIR=/usr/local/petsc python3 -m pip -v install --no-cache-dir --no-build-isolation . && \
73+
rm -rf /tmp/*
74+
75+
ENV PETSC_DIR=/usr/local/petsc
9076

91-
ENV PETSC_DIR=/usr/local
77+
# Install SLEPc
78+
RUN git clone --depth=1 -b v${SLEPC_VERSION} https://gitlab.com/slepc/slepc.git && \
79+
cd slepc && \
80+
./configure --prefix=/usr/local/slepc && \
81+
make SLEPC_DIR=/tmp/slepc && \
82+
make SLEPC_DIR=/tmp/slepc install && \
83+
cd src/binding/slepc4py && \
84+
SLEPC_DIR=/usr/local/slepc python3 -m pip -v install --no-cache-dir --no-build-isolation . && \
85+
rm -rf /tmp/*
9286

93-
# RHEL pkgconfig does not look here by default. Setting this probably
94-
# better than forcing install into 'system path' or hacking in DOLFINx
95-
# pkgconfig.py code.
96-
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
87+
ENV SLEPC_DIR=/usr/local/slepc

python/demo/demo_half_loaded_waveguide.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@
7272
except ImportError:
7373
print("VTXWriter not available, solution will not be saved.")
7474
has_vtx = False
75-
76-
7775
# -
7876

7977
# ## Analytical solutions for the half-loaded waveguide

0 commit comments

Comments
 (0)