代码拉取完成,页面将自动刷新
# =============================================================================
# An Arch Linux docker file for llvm-tutor. Clones and builds llvm-tutor, runs
# all tests. It uses the precompiled LLVM packages from Fedora.
#
# USAGE:
# ```bash
# wget https://raw.githubusercontent.com/banach-space/llvm-tutor/main/Dockerfile_archlinux
# docker build -t=llvm-tutor:llvm-14 .
# docker run --rm -it --hostname=llvm-tutor llvm-tutor:llvm-14 /bin/bash
# ```
# =============================================================================
FROM archlinux
ENV LLVM_DIR /usr/
ENV TUTOR_DIR /llvm-tutor
ENV VENV_DIR /venv
# 1. INSTALL DEPENDENCIES
RUN pacman -Syu --noconfirm \
git \
cmake \
ninja \
gcc \
llvm \
clang \
python-pip
# 2. INSTALL LIT
RUN python3 -m venv $VENV_DIR
RUN $VENV_DIR/bin/pip3 install lit
# 3. CLONE LLVM-TUTOR
RUN git clone https://github.com/banach-space/llvm-tutor $TUTOR_DIR
# 4. BUILD AND RUN HELLO-WORLD
RUN mkdir -p $TUTOR_DIR/hello-world-build \
&& cd $TUTOR_DIR/hello-world-build \
&& cmake -G Ninja -DLT_LLVM_INSTALL_DIR=$LLVM_DIR ../HelloWorld \
&& ninja
RUN cd $TUTOR_DIR/hello-world-build && $LLVM_DIR/bin/clang -S -O1 -emit-llvm ../inputs/input_for_hello.c -o input_for_hello.ll
RUN cd $TUTOR_DIR/hello-world-build && $LLVM_DIR/bin/opt -load-pass-plugin ./libHelloWorld.so -passes=hello-world -disable-output input_for_hello.ll 2>&1 | grep "(llvm-tutor) Hello from: foo"
# 5. BUILD AND RUN LLVM-TUTOR
RUN mkdir -p $TUTOR_DIR/build \
&& cd $TUTOR_DIR/build \
&& cmake -G Ninja -DLT_LLVM_INSTALL_DIR=$LLVM_DIR ../ \
&& ninja \
&& $VENV_DIR/bin/lit test/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。