This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
36 lines (29 loc) · 1.79 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
# ROCm + Rust nightly toolchain
FROM rocm/rocm-terminal:2.0
ENV RUSTUP_HOME=/home/rocm-user/.rustup \
CARGO_HOME=/home/rocm-user/.cargo \
PATH=/home/rocm-user/.cargo/bin:$PATH
RUN sudo apt-get update \
&& sudo apt-get install -y wget \
&& sudo rm -rf /var/lib/apt/lists/* \
&& wget "https://static.rust-lang.org/rustup/archive/1.16.0/x86_64-unknown-linux-gnu/rustup-init" \
&& chmod +x rustup-init \
&& ./rustup-init -y --no-modify-path --default-toolchain nightly \
&& rm rustup-init \
&& chmod -R a+w $RUSTUP_HOME $CARGO_HOME \
&& rustup --version && cargo --version && rustc --version
# hexdump (bsdmainutils) is required by cloc.sh to produce disassembled listings
RUN sudo sh -c "echo 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 maindeb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main' > /etc/apt/sources.list.d/llvm.list" \
&& sudo sh -c "echo 'deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main' >> /etc/apt/sources.list.d/llvm.list" \
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - \
&& sudo apt-get update \
&& sudo apt-get install -y bsdmainutils zlib1g-dev lld-7 llvm-7 clang-format-7 \
&& sudo rm -rf /var/lib/apt/lists/*
# Required by bin/ scripts
RUN wget https://raw.githubusercontent.com/ryanmjacobs/c/master/c \
&& sudo install -m 755 c /usr/bin/c \
&& rm ./c \
&& sudo wget https://raw.githubusercontent.com/llvm-mirror/llvm/993ef0ca960f8ffd107c33bfbf1fd603bcf5c66c/lib/Target/AMDGPU/AMDKernelCodeT.h -P /usr/local/include/ \
&& sudo sed '/#include "llvm/d;s/cstddef/stddef.h/;s/cstdint/stdint.h/' -i /usr/local/include/AMDKernelCodeT.h
RUN sudo update-alternatives --install /usr/bin/ld ld /usr/bin/lld-7 30
ENV PATH="/src/bin:${PATH}" LIBRARY_PATH=/opt/rocm/lib:/opt/rocm/hsa/lib:/opt/rocm/hip/lib:/opt/rocm/hcc/lib