1 Star 0 Fork 0

Ivanmax/llvm-tutor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dockerfile_ubuntu 1.77 KB
一键复制 编辑 原始数据 按行查看 历史
Andrzej Warzynski 提交于 2023-04-07 19:04 . Update to LLVM 16
# =============================================================================
# An Ubuntu docker file for llvm-tutor that builds LLVM from sources. Clones
# and builds llvm-tutor, runs all tests. It uses the precompiled LLVM packages
# from Ubuntu.
#
# USAGE:
# ```bash
# wget https://raw.githubusercontent.com/banach-space/llvm-tutor/main/Dockerfile_ubuntu
# docker build -t=llvm-tutor:llvm-16 .
# docker run --rm -it --hostname=llvm-tutor llvm-tutor:llvm-16 /bin/bash
# ```
# =============================================================================
FROM debian:buster
# 1. INSTALL DEPENDENCIES
RUN apt-get update && apt-get install -y \
git \
cmake \
ninja-build \
build-essential \
python3-minimal python3-pip\
&& rm -rf /var/lib/apt/lists/*
# 2. INSTALL LIT
RUN pip3 install lit
# 2. BUILD LLVM + Clang from sources
# Note that LIT tests depend on 'not' and 'FileCheck', LLVM utilities. For this
# reason, we need to add `-DLLVM_INSTALL_UTILS=ON` CMake flag when building
# LLVM.
ENV LLVM_DIR /opt/llvm
RUN git clone --branch release/16.x --depth 1 https://github.com/llvm/llvm-project \
&& mkdir -p $LLVM_DIR \
&& mkdir -p llvm-project/build \
&& cd llvm-project/build \
&& cmake -G Ninja \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_TARGETS_TO_BUILD=host \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$LLVM_DIR \
-DLLVM_INSTALL_UTILS=ON \
../llvm \
&& cmake --build . --target install \
&& rm -r /llvm-project
# 5. BUILD AND RUN LLVM-TUTOR
ENV TUTOR_DIR /llvm-tutor
RUN git clone https://github.com/banach-space/llvm-tutor $TUTOR_DIR \
&& 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

搜索帮助