-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.Ubuntu20.04
More file actions
121 lines (98 loc) · 5.41 KB
/
Dockerfile.Ubuntu20.04
File metadata and controls
121 lines (98 loc) · 5.41 KB
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
# Part of the examples from the Parallel and High Performance Computing
# Robey and Zamora, Manning Publications
# https://github.com/EssentialsofParallelComputing/Chapter6
#
# The built image can be found at:
#
# https://hub.docker.com/r/essentialsofparallelcomputing/chapter6
#
# Author:
# Bob Robey <brobey@earthlink.net>
FROM ubuntu:20.04 AS builder
LABEL maintainer Bob Robey <brobey@earthlink.net>
ARG DOCKER_LANG=en_US
ARG DOCKER_TIMEZONE=America/Denver
WORKDIR /tmp
RUN apt-get -qq update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -qq install -y locales tzdata && \
apt-get clean && rm -rf /var/lib/apt/lists/*
ENV LANG=$DOCKER_LANG.UTF-8 \
LANGUAGE=$DOCKER_LANG:UTF-8
RUN ln -fs /usr/share/zoneinfo/$DOCKER_TIMEZONE /etc/localtime && \
locale-gen $LANG && update-locale LANG=$LANG && \
dpkg-reconfigure -f noninteractive locales tzdata
ENV LC_ALL=$DOCKER_LANG.UTF-8
RUN apt-get -qq update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -qq install -y cmake make git vim gcc g++ gfortran software-properties-common wget gnupg-agent gnupg2 \
xterm x11-apps && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# likwid installed manually in container because msr is not accessible
# Installing latest GCC compiler (version 10)
RUN apt-get -qq update && \
apt-get -qq install -y gcc-10 g++-10 gfortran-10 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-9 80 \
--slave /usr/bin/g++ g++ /usr/bin/g++-9 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-9 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-9 && \
update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-10 90 \
--slave /usr/bin/g++ g++ /usr/bin/g++-10 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-10 \
--slave /usr/bin/gcov gcov /usr/bin/gcov-10 && \
chmod u+s /usr/bin/update-alternatives
# Installing Intel compilers since they give the best vectorization among compiler vendors
# Also installing Intel Advisor to look at vectorization performance
RUN wget -q https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
RUN apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
RUN rm -f GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
RUN echo "deb https://apt.repos.intel.com/oneapi all main" >> /etc/apt/sources.list.d/oneAPI.list
RUN echo "deb [trusted=yes arch=amd64] https://repositories.intel.com/graphics/ubuntu bionic main" >> /etc/apt/sources.list.d/intel-graphics.list
RUN apt-get -qq update && \
apt-get -qq install -y \
intel-hpckit-getting-started \
intel-oneapi-common-vars \
intel-oneapi-common-licensing \
intel-oneapi-dev-utilities \
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \
intel-oneapi-ifort \
intel-oneapi-advisor && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Needed libraries for Intel Advisor graphics user interface
RUN apt-get -qq update && \
apt-get -qq install -y libgtk2.0-0 libxxf86vm1 libsm6 libnss3 libnss3 libx11-xcb1 libxtst6 \
libasound2 libatk-bridge2.0-0 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Changing config to install in /usr and to use perf events instead of access daemons to
# try and get around permission limitations in a Docker container
RUN update-alternatives --set gcc /usr/bin/gcc-9
RUN wget --no-verbose http://ftp.fau.de/pub/likwid/likwid-5.0.1.tar.gz && tar -xzf likwid-5.0.1.tar.gz && \
cd likwid-5.0.1 && sed -i -e '/ACCESSMODE/s!accessdaemon!perf_event!' \
-e '/PREFIX/s!/usr/local!/usr!' -e '/BUILDFREQ/s/true/false/' config.mk && \
make && make install && cd .. && rm -rf likwid-5.0.1
RUN update-alternatives --set gcc /usr/bin/gcc-10
SHELL ["/bin/bash", "-c"]
RUN groupadd chapter6 && useradd -m -s /bin/bash -g chapter6 chapter6
RUN usermod -a -G video chapter6
WORKDIR /home/chapter6
RUN chown -R chapter6:chapter6 /home/chapter6
USER chapter6
ENV LANG='en_US.UTF-8'
ENV DISPLAY :0
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES display,graphics,utility
# You may want to "source /opt/intel/oneapi/setvars.sh" to get the full set of environment variables
ENV MANPATH=/opt/intel/oneapi/compiler/latest/documentation/en/man/common:${MAN_PATH}
ENV LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/latest/linux/lib:/opt/intel/oneapi/compiler/latest/linux/lib/x64:/opt/intel/oneapi/compiler/latest/linux/lib/emu:/opt/intel/oneapi/compiler/latest/linux/lib/oclfpga/linux64/lib:/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin:/opt/intel/oneapi/compiler/latest/linux/compiler/lib:${LD_LIBRARY_PATH}
ENV PATH=/opt/intel/oneapi/compiler/latest/linux/bin/intel64:/opt/intel/oneapi/compiler/latest/linux/bin:/opt/intel/oneapi/compiler/latest/linux/ioc/bin:/opt/intel/oneapi/dev-utilities/latest/bin:/opt/intel/oneapi/advisor/latest/bin64:${PATH}
ENV ADVISOR_2021_DIR=/opt/intel/oneapi/advisor/2021.1-beta10
ENV PKG_CONFIG_PATH=/opt/intel/oneapi/advisor/2021.1-beta10/include/pkgconfig/lib64:${PKG_CONFIG_PATH}
ENV APM=/opt/intel/oneapi/advisor/2021.1-beta10/perfmodels
ENV PYTHONPATH=/opt/intel/oneapi/advisor/2021.1-beta10/pythonapi:${PYTHONPATH}
RUN git clone --recursive https://github.com/essentialsofparallelcomputing/Chapter6.git
WORKDIR /home/chapter6/Chapter6
#RUN make
ENTRYPOINT ["bash"]