-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (44 loc) · 1.65 KB
/
Dockerfile
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
FROM ubuntu:22.04
# do not prompt in apt
# https://github.com/moby/moby/issues/4032#issuecomment-163689851
ARG DEBIAN_FRONTEND=noninteractive
ARG DEBCONF_NONINTERACTIVE_SEEN=true
# set timezone
ENV TZ="America/Chicago"
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone
RUN apt update --yes \
&& apt install --yes \
build-essential \
cmake \
gnupg \
libdrm-dev \
libpython3-dev \
lsb-release \
pkg-config \
pkg-config \
python3-pip \
software-properties-common \
wget \
&& apt clean \
&& rm -rf /var/cache/apt/ /var/lib/apt/lists/*
# install clang
RUN TEMPDIR=$(mktemp -d) \
&& cd $TEMPDIR \
&& wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh \
&& ./llvm.sh 16 \
&& update-alternatives --install /usr/bin/clang clang $(which clang-16) 91 --slave /usr/bin/clang++ clang++ $(which clang++-16) \
&& python3 -m pip install --no-cache-dir clang==16.0.1 ctypeslib2==2.3.4 -U \
&& rm -rf $TEMPDIR
# install cmake
RUN TEMPDIR=$(mktemp -d) \
&& cd $TEMPDIR \
&& wget https://github.com/Kitware/CMake/releases/download/v3.29.2/cmake-3.29.2-linux-x86_64.sh && chmod +x cmake*.sh \
&& ./cmake*.sh --skip-license --prefix=/usr \
&& rm -rf $TEMPDIR
WORKDIR /src
CMD cp -r /src /tmp/src \
&& cd /tmp/src \
&& rm -rf build .cache \
&& cmake -B build -DBUILD_WRAPPER=ON \
&& make -C build -j $(nproc) \
&& cp /tmp/src/py-interface/amdsmi_wrapper.py /src/py-interface/amdsmi_wrapper.py