-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.impi
93 lines (83 loc) · 3.96 KB
/
Dockerfile.impi
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
################################################################################################################
# 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 intel/oneapi-hpckit
# 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 doxygen wget git sudo vim \
m4 curl libjpeg-dev libz-dev \
libtool autotools-dev autoconf ssh && \
rm -fr /var/lib/apt/lists/* && \
apt clean
# 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:${LD_LIBRARY_PATH}"
ENV CC mpicc
ENV FC mpifc
ENV I_MPI_CC=icc
ENV I_MPI_FC=ifort
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 && \
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 && \
rm -rf /tmp/sources
RUN groupadd ziggy && \
useradd -d /home/ziggy -g ziggy -m -s /bin/bash ziggy -u 1001 && \
echo 'export USER=$(whoami)' >> /etc/profile.d/ziggy.sh && \
echo 'ziggy ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/ziggy && \
su ziggy && \
echo 'source /opt/intel/oneapi/setvars.sh && conda activate' > /home/ziggy/.bash_profile
#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"]