1- FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
1+ FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 AS llvm-builder
22
33RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
44 build-essential \
5- curl \
65 clang \
6+ curl \
7+ libffi-dev \
8+ libedit-dev \
9+ libncurses5-dev \
710 libssl-dev \
811 libtinfo-dev \
12+ libxml2-dev \
13+ cmake \
14+ ninja-build \
915 pkg-config \
16+ python3 \
1017 xz-utils \
1118 zlib1g-dev && \
1219 rm -rf /var/lib/apt/lists/*
1320
14- # Needed to build `path_tracer`, `optix/ex03_window` example
15- RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
16- cmake \
17- libfontconfig-dev \
18- libx11-xcb-dev \
19- libxcursor-dev \
20- libxi-dev \
21- libxinerama-dev \
22- libxrandr-dev && \
23- rm -rf /var/lib/apt/lists/*
24-
25- # Get LLVM 7
2621WORKDIR /data/llvm7
2722
28- # Install dependencies for building LLVM
29- RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
30- libffi-dev \
31- libedit-dev \
32- libncurses5-dev \
33- libxml2-dev \
34- python3 \
35- ninja-build && \
36- rm -rf /var/lib/apt/lists/*
37-
38- # Download and build LLVM 7.1.0 for all architectures
23+ # Download and build LLVM 7.1.0 for all architectures.
3924RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4025 tar -xf llvm-7.1.0.src.tar.xz && \
4126 cd llvm-7.1.0.src && \
@@ -58,16 +43,39 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5843 -DLLVM_INCLUDE_BENCHMARKS=OFF \
5944 -DLLVM_ENABLE_ZLIB=ON \
6045 -DLLVM_ENABLE_TERMINFO=ON \
61- -DCMAKE_INSTALL_PREFIX=/usr \
46+ -DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6247 .. && \
6348 ninja -j$(nproc) && \
6449 ninja install && \
6550 cd ../.. && \
66- rm -rf llvm-7.1.0.src* && \
67- ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7
51+ rm -rf llvm-7.1.0.src*
52+
53+ FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
54+
55+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
56+ build-essential \
57+ clang \
58+ curl \
59+ libssl-dev \
60+ libtinfo-dev \
61+ pkg-config \
62+ xz-utils \
63+ zlib1g-dev \
64+ cmake \
65+ libfontconfig-dev \
66+ libx11-xcb-dev \
67+ libxcursor-dev \
68+ libxi-dev \
69+ libxinerama-dev \
70+ libxrandr-dev && \
71+ rm -rf /var/lib/apt/lists/*
72+
73+ COPY --from=llvm-builder /opt/llvm-7 /opt/llvm-7
74+ RUN ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config && \
75+ ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config-7
6876
69- # Get Rust
70- RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y
77+ # Get Rust (install rustup; toolchain installed from rust-toolchain.toml below)
78+ RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y --profile minimal --default-toolchain none
7179ENV PATH="/root/.cargo/bin:${PATH}"
7280
7381# Setup the workspace
@@ -79,4 +87,3 @@ RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/rust-cuda/rust-too
7987ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}"
8088ENV LLVM_LINK_STATIC=1
8189ENV RUST_LOG=info
82-
0 commit comments