-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathubuntu
37 lines (33 loc) · 1.69 KB
/
ubuntu
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
ARG TAG=latest
FROM ubuntu:${TAG}
ARG INTEL
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
ccache clang clang-format clang-tidy cmake curl g++ gfortran git gnupg2 libgtest-dev libhwloc-dev libomp-dev llvm make ninja-build sudo vim wget zstd && \
if [ "$(uname -m)" = "x86_64" ]; then \
apt-get install -y gcc-multilib g++-multilib gfortran-multilib; \
fi && \
apt-get purge --autoremove -y && \
rm -rf /var/lib/apt/lists/*
# intel build happens on 22.04 LTS, which does not have flang, install flang unconditionally once intel gets bumped
RUN if [ "${INTEL}" = "yes" ]; then \
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list && \
apt-get update && \
apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-mkl-devel && \
apt-get clean; \
else \
apt-get update && \
apt-get install -y flang && \
apt-get purge --autoremove -y && \
apt-get clean; \
fi
RUN useradd -m -G sudo -u 1001 kokkos
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER kokkos
ENV PATH=${INTEL:+/opt/intel/oneapi/compiler/latest/linux/bin:/opt/intel/oneapi/compiler/latest/linux/bin/intel64}${PATH:+:}${PATH}
ENV LD_LIBRARY_PATH=${INTEL:+/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64:/opt/intel/oneapi/mkl/latest/lib/intel64}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}
ENV CCACHE_MAXSIZE=250M
WORKDIR /home/kokkos