1 Star 0 Fork 0

Ivanmax/llvm-tutor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dockerfile_fedora 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
Kohei Asano 提交于 2023-06-13 15:27 . update: fedora version (#90)
# =============================================================================
# A Fedora 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_fedora
# docker build -t=llvm-tutor:llvm-15 .
# docker run --rm -it --hostname=llvm-tutor llvm-tutor:llvm-15 /bin/bash
# ```
# =============================================================================
FROM fedora:38
ENV LLVM_DIR /usr/
ENV TUTOR_DIR /llvm-tutor
# 1. INSTALL DEPENDENCIES
RUN dnf -y install \
git \
cmake \
ninja-build \
gcc \
gcc-c++ \
llvm-devel \
clang \
zlib-devel \
python3-pip
# 2. INSTALL LIT
RUN 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 -DLT_LLVM_INSTALL_DIR=$LLVM_DIR ../ \
&& make -j $(nproc --all) \
&& lit test/
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Ivanmax/llvm-tutor.git
git@gitee.com:Ivanmax/llvm-tutor.git
Ivanmax
llvm-tutor
llvm-tutor
main

搜索帮助