-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.mpich
129 lines (116 loc) · 5.56 KB
/
Dockerfile.mpich
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
################################################################################################################
# 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 - we're doing this by hand because the default packages install into non-standard locations, and
# we want our image as simple as possible. We're also going to use MPICH, though any of the MPICH ABI-compatible libraries
# will work. This is for future compatibility with offloading to cloud.
ARG MPI_VERSION=3.4.3
RUN echo "Building mpich version ${MPI_VERSION}" && \
mkdir /tmp/sources && \
cd /tmp/sources && \
wget -q http://www.mpich.org/static/downloads/${MPI_VERSION}/mpich-${MPI_VERSION}.tar.gz && \
tar zxf mpich-${MPI_VERSION}.tar.gz && \
cd mpich-${MPI_VERSION} && \
./configure --with-device=ch3 --prefix=/usr/local/parallel && \
make -j 2 install && \
ldconfig && \
cd /tmp/sources && \
rm -rf /tmp/sources/mpich-${MPI_VERSION}
# Next, let's install HDF5, NetCDF and PNetCDF - we'll do this by hand
# this lets us control their location (eg, put in /usr/local).
# We build serial versions of hdf and netcdf c library only in /usr/local/serial
# then build parallel versions in /usr/local/parallel
#
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/serial --disable-parallel --disable-fortran && \
make -j 2 install && \
ldconfig && \
cd /tmp/sources/ && \
rm -fr /tmp/sources/hdf5-${HDF5_VERSION}
ARG HDF5_VERSION=${HDF5_VERSION_MAJOR}.${HDF5_VERSION_MINOR}
# Set this path to find the mpich build
ENV PATH "/usr/local/parallel/bin:$PATH"
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/parallel --enable-parallel --disable-fortran && \
make -j 2 install && \
ldconfig && \
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} && \
CPPFLAGS="-I /usr/local/serial/include" \
LDFLAGS="-L/usr/local/serial/lib " \
LD_LIBRARY_PATH="/usr/local/serial/lib " \
./configure --prefix=/usr/local/serial --disable-dap && \
make -j 2 install && \
ldconfig && \
cd /tmp/sources
ENV PATH "/usr/local/parallel/bin:$PATH"
ENV LD_LIBRARY_PATH /usr/local/parallel/lib
ENV CPPFLAGS -I/usr/local/parallel/include
RUN cd netcdf-c-${NETCDF_C_VERSION} && \
make clean && \
CPPFLAGS="-I /usr/local/parallel/include" \
LDFLAGS="-L/usr/local/parallel/lib " \
LD_LIBRARY_PATH="/usr/local/parallel/lib " \
./configure --prefix=/usr/local/parallel --disable-dap && \
make -j 2 install && \
ldconfig && \
cd /tmp/sources
ENV 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} && \
CPPFLAGS="-I /usr/local/parallel/include" \
LDFLAGS="-L/usr/local/parallel/lib " \
LD_LIBRARY_PATH="/usr/local/parallel/lib " \
./configure --prefix=/usr/local/parallel && \
make -j 2 install && \
ldconfig && \
cd /tmp/sources
ENV CFLAGS -fPIC
ENV LDFLAGS "-fPIC -L/usr/local/parallel/lib"
ARG PNETCDF_VERSION=1.12.3
RUN wget -q https://parallel-netcdf.github.io/Release/pnetcdf-${PNETCDF_VERSION}.tar.gz && \
tar zxf pnetcdf-${PNETCDF_VERSION}.tar.gz && \
cd pnetcdf-${PNETCDF_VERSION} && \
./configure --prefix=/usr/local/parallel && \
make -j 2 install && \
ldconfig && \
rm -rf /tmp/sources
#RUN groupadd escomp && \
# useradd -c 'ESCOMP User' -d /home/user -g escomp -m -s /bin/bash user && \
# echo 'export USER=$(whoami)' >> /etc/profile.d/escomp.sh && \
# echo 'export PS1="[\u@escomp \W]\$ "' >> /etc/profile.d/escomp.sh && \
# echo 'user ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/escomp
#
#ENV SHELL=/bin/bash \
# LANG=C.UTF-8 \
# LC_ALL=C.UTF-8
#USER user
#WORKDIR /home/user
#CMD ["/bin/bash", "-l"]
#ENTRYPOINT ["/bin/bash", "-l"]