66# USAGE:
77# ```bash
88# wget https://raw.githubusercontent.com/banach-space/llvm-tutor/main/Dockerfile_ubuntu_apt
9- # docker build -t=llvm-tutor:llvm-17 .
10- # docker run --rm -it --hostname=llvm-tutor llvm-tutor:llvm-17 /bin/bash
9+ # docker build -t=llvm-tutor:llvm-18 .
10+ # docker run --rm -it --hostname=llvm-tutor llvm-tutor:llvm-18 /bin/bash
1111# ```
1212# =============================================================================
1313
1414FROM ubuntu:22.04
1515
16- ENV LLVM_DIR /usr/lib/llvm-17 /
16+ ENV LLVM_DIR /usr/lib/llvm-18 /
1717ENV TUTOR_DIR /llvm-tutor
1818
1919# 1. INSTALL DEPENDENCIES
@@ -30,13 +30,14 @@ RUN apt-get update && apt-get install -y \
3030 build-essential \
3131 python3-minimal python3-pip\
3232 wget \
33+ libzstd-dev \
3334 software-properties-common \
3435 && rm -rf /var/lib/apt/lists/*
3536
3637RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
37- RUN apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main"
38+ RUN apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main"
3839RUN apt-get update
39- RUN apt-get install -y llvm-17 llvm-17 -dev llvm-17 -tools clang-17
40+ RUN apt-get install -y llvm-18 llvm-18 -dev llvm-18 -tools clang-18
4041RUN apt-get install -y python3-setuptools
4142
4243# 2. INSTALL LIT
@@ -50,8 +51,8 @@ RUN mkdir -p $TUTOR_DIR/hello-world-build \
5051 && cd $TUTOR_DIR/hello-world-build \
5152 && cmake -G Ninja -DLT_LLVM_INSTALL_DIR=$LLVM_DIR ../HelloWorld \
5253 && ninja
53- RUN cd $TUTOR_DIR/hello-world-build && /usr/bin/clang-17 -S -O1 -emit-llvm ../inputs/input_for_hello.c -o input_for_hello.ll
54- RUN cd $TUTOR_DIR/hello-world-build && /usr/bin/opt-17 -load-pass-plugin ./libHelloWorld.so -passes=hello-world -disable-output input_for_hello.ll 2>&1 | grep "(llvm-tutor) Hello from: foo"
54+ RUN cd $TUTOR_DIR/hello-world-build && /usr/bin/clang-18 -S -O1 -emit-llvm ../inputs/input_for_hello.c -o input_for_hello.ll
55+ RUN cd $TUTOR_DIR/hello-world-build && /usr/bin/opt-18 -load-pass-plugin ./libHelloWorld.so -passes=hello-world -disable-output input_for_hello.ll 2>&1 | grep "(llvm-tutor) Hello from: foo"
5556
5657# 5. BUILD AND RUN LLVM-TUTOR
5758RUN mkdir -p $TUTOR_DIR/build \
0 commit comments