-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.openmpi
109 lines (98 loc) · 4.6 KB
/
Dockerfile.openmpi
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
################################################################################################################
# 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 ssh && \
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.
#
ARG MPI_VERSION_MAJOR=4.1
ARG MPI_VERSION_MINOR=2
ARG MPI_VERSION=${MPI_VERSION_MAJOR}.${MPI_VERSION_MINOR}
RUN echo "Building openmpi version ${MPI_VERSION}" && \
mkdir /tmp/sources && \
cd /tmp/sources && \
wget -q https://download.open-mpi.org/release/open-mpi/v${MPI_VERSION_MAJOR}/openmpi-${MPI_VERSION}.tar.gz && \
tar zxf openmpi-${MPI_VERSION}.tar.gz && \
cd openmpi-${MPI_VERSION} && \
./configure --prefix=/usr/local && \
make -j 2 install && \
rm -rf /tmp/sources
# Next, let's install HDF5, NetCDF and PNetCDF - 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.
ENV PATH "/usr/local/bin:${PATH}"
ENV LDFLAGS -L/usr/local/lib
ENV LD_LIBRARY_PATH /usr/local/lib
ENV CC mpicc
ENV FC mpif90
ARG HDF5_VERSION_MAJOR=1.12
ARG HDF5_VERSION_MINOR=1
ARG HDF5_VERSION=${HDF5_VERSION_MAJOR}.${HDF5_VERSION_MINOR}
RUN mkdir /tmp/sources && \
cd /tmp/sources && \
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 --enable-parallel && \
test $? -eq 0 && echo "Success" || cat config.log && \
ls /usr/local/lib && \
make -j 2 install && \
cd /tmp/sources
ENV LDFLAGS -L/usr/local/lib
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 && \
test $? -eq 0 && echo "configure worked" || cat config.log && \
make -j 2 install && \
ldconfig && \
cd /tmp/sources
ENV LDFLAGS -L/usr/local/lib
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 && \
test $? -eq 0 && echo "configure worked" || cat config.log && \
make -j 2 install && \
ldconfig && \
cd /tmp/sources
ENV CFLAGS -fPIC
ENV LDFLAGS "-fPIC -L/usr/local/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 && \
make -j 2 install && \
ldconfig && \
cd && \
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"]