Skip to content

Commit 936a86d

Browse files
FractalFirLegNeato
authored andcommitted
Add a new devcontainer with enabled LLVM assertions
1 parent 5fb10d3 commit 936a86d

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FROM nvcr.io/nvidia/cuda:12.8.1-cudnn-devel-ubuntu24.04
2+
3+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -qq -y install \
4+
build-essential \
5+
clang \
6+
curl \
7+
libssl-dev \
8+
libtinfo-dev \
9+
pkg-config \
10+
xz-utils \
11+
zlib1g-dev && \
12+
rm -rf /var/lib/apt/lists/*
13+
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
26+
WORKDIR /data/llvm7
27+
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
39+
RUN curl -sSf -L -O https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/llvm-7.1.0.src.tar.xz && \
40+
tar -xf llvm-7.1.0.src.tar.xz && \
41+
cd llvm-7.1.0.src && \
42+
mkdir build && cd build && \
43+
ARCH=$(dpkg --print-architecture) && \
44+
if [ "$ARCH" = "amd64" ]; then \
45+
TARGETS="X86;NVPTX"; \
46+
else \
47+
TARGETS="AArch64;NVPTX"; \
48+
fi && \
49+
cmake -G Ninja \
50+
-DCMAKE_BUILD_TYPE=Debug \
51+
-DLLVM_TARGETS_TO_BUILD="$TARGETS" \
52+
-DLLVM_BUILD_LLVM_DYLIB=ON \
53+
-DLLVM_LINK_LLVM_DYLIB=ON \
54+
-DLLVM_ENABLE_ASSERTIONS=OFF \
55+
-DLLVM_ENABLE_BINDINGS=OFF \
56+
-DLLVM_INCLUDE_EXAMPLES=OFF \
57+
-DLLVM_INCLUDE_TESTS=OFF \
58+
-DLLVM_INCLUDE_BENCHMARKS=OFF \
59+
-DLLVM_ENABLE_ZLIB=ON \
60+
-DLLVM_ENABLE_TERMINFO=ON \
61+
-DCMAKE_INSTALL_PREFIX=/usr \
62+
.. && \
63+
ninja -j$(nproc) && \
64+
ninja install && \
65+
cd ../.. && \
66+
rm -rf llvm-7.1.0.src* && \
67+
ln -s /usr/bin/llvm-config /usr/bin/llvm-config-7
68+
69+
# Get Rust
70+
RUN curl -sSf -L https://sh.rustup.rs | bash -s -- -y
71+
ENV PATH="/root/.cargo/bin:${PATH}"
72+
73+
# Setup the workspace
74+
WORKDIR /data/Rust-CUDA
75+
RUN --mount=type=bind,source=rust-toolchain.toml,target=/data/Rust-CUDA/rust-toolchain.toml \
76+
rustup show
77+
78+
# Add nvvm to LD_LIBRARY_PATH.
79+
ENV LD_LIBRARY_PATH="/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH}"
80+
ENV LLVM_LINK_STATIC=1
81+
ENV RUST_LOG=info
82+

0 commit comments

Comments
 (0)