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+ ninja-build \
914 pkg-config \
15+ python3 \
1016 xz-utils \
1117 zlib1g-dev && \
1218 rm -rf /var/lib/apt/lists/*
1319
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
2620WORKDIR /data/llvm7
2721
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
22+ # Download and build LLVM 7.1.0 for all architectures.
3923RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
4024 tar -xf llvm-7.1.0.src.tar.xz && \
4125 cd llvm-7.1.0.src && \
@@ -58,13 +42,36 @@ RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmo
5842 -DLLVM_INCLUDE_BENCHMARKS=OFF \
5943 -DLLVM_ENABLE_ZLIB=ON \
6044 -DLLVM_ENABLE_TERMINFO=ON \
61- -DCMAKE_INSTALL_PREFIX=/usr \
45+ -DCMAKE_INSTALL_PREFIX=/opt/llvm-7 \
6246 .. && \
6347 ninja -j$(nproc) && \
6448 ninja install && \
6549 cd ../.. && \
66- rm -rf llvm-7.1.0.src* && \
67- ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7
50+ rm -rf llvm-7.1.0.src*
51+
52+ FROM nvcr.io/nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
53+
54+ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
55+ build-essential \
56+ clang \
57+ curl \
58+ libssl-dev \
59+ libtinfo-dev \
60+ pkg-config \
61+ xz-utils \
62+ zlib1g-dev \
63+ cmake \
64+ libfontconfig-dev \
65+ libx11-xcb-dev \
66+ libxcursor-dev \
67+ libxi-dev \
68+ libxinerama-dev \
69+ libxrandr-dev && \
70+ rm -rf /var/lib/apt/lists/*
71+
72+ COPY --from=llvm-builder /opt/llvm-7 /opt/llvm-7
73+ RUN ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config && \
74+ ln -s /opt/llvm-7/bin/llvm-config /usr/bin/llvm-config-7
6875
6976# Get Rust
7077RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y
@@ -79,4 +86,3 @@ RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/rust-cuda/rust-too
7986ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}"
8087ENV LLVM_LINK_STATIC=1
8188ENV RUST_LOG=info
82-
0 commit comments