-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.mpi-serial
70 lines (60 loc) · 3.18 KB
/
Dockerfile.mpi-serial
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
################################################################################################################
# ESMCI TestingTools/Dockerfile #
#--------------------------------------------------------------------------------------------------------------#
# A base stream9 install + MPI, HDF5, NetCDF and PNetCDF, as well as other core packages for escomp containers #
################################################################################################################
# Use latest Ubuntu:
FROM ubuntu:latest
# Disable prompt
ARG DEBIAN_FRONTEND=noninteractive
# First, we upate the default packages and install some other necessary ones - while this may give
# some people updated versions of packages vs. others, these differences should not be numerically
# important or affect run-time behavior (eg, a newer Bash version, or perl-XML-LibXML version).
RUN apt update
RUN apt install -y file build-essential gfortran doxygen wget \
m4 curl libjpeg-dev libz-dev cmake python3 \
libtool autotools-dev autoconf && \
rm -fr /var/lib/apt/lists/* && \
apt clean
# Second, let's install MPI-Serial
ARG MPI_VERSION=2.3.0
RUN echo "Building mpi-serial version ${MPI_VERSION}" && \
mkdir /tmp/sources && \
cd /tmp/sources && \
wget -q https://github.com/MCSclimate/mpi-serial/archive/refs/tags/MPIserial_${MPI_VERSION}.tar.gz && \
tar zxf MPIserial_${MPI_VERSION}.tar.gz && \
cd mpi-serial-MPIserial_${MPI_VERSION} && \
./configure --prefix=/usr/local && \
make -j 2 && \
cp libmpi-serial.a /usr/local/lib && \
cp mpi.h mpif.h mpi.mod /usr/local/include && \
cd /tmp/sources
# Next, let's install HDF5, and NetCDF - we'll do this by hand, since the packaged versions have
# lots of extra dependencies (at least, as of CentOS 7) and this also lets us control their location (eg, put in /usr/local).
# NOTE: We do want to change where we store the versions / download links, so it's easier to change, but that'll happen later.
ARG HDF5_VERSION_MAJOR=1.12
ARG HDF5_VERSION_MINOR=1
ARG HDF5_VERSION=${HDF5_VERSION_MAJOR}.${HDF5_VERSION_MINOR}
RUN wget -q https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-${HDF5_VERSION_MAJOR}/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz && \
tar zxf hdf5-${HDF5_VERSION}.tar.gz && \
cd hdf5-${HDF5_VERSION} && \
./configure --prefix=/usr/local --disable-dap && \
make -j 2 install && \
cd /tmp/sources
ARG NETCDF_C_VERSION=4.7.4
RUN wget -q https://github.com/Unidata/netcdf-c/archive/refs/tags/v${NETCDF_C_VERSION}.tar.gz && \
tar -xzf v${NETCDF_C_VERSION}.tar.gz && \
cd netcdf-c-${NETCDF_C_VERSION} && \
./configure --prefix=/usr/local --disable-dap && \
make -j 2 install && \
ldconfig && \
cd /tmp/sources
ARG NETCDF_F_VERSION=4.5.4
RUN wget -q https://github.com/Unidata/netcdf-fortran/archive/refs/tags/v${NETCDF_F_VERSION}.tar.gz && \
tar zxf v${NETCDF_F_VERSION}.tar.gz && \
cd netcdf-fortran-${NETCDF_F_VERSION} && \
./configure --prefix=/usr/local && \
make -j 2 install && \
ldconfig && \
cd && \
rm -rf /tmp/sources