代码拉取完成,页面将自动刷新
# =============================================================================
# 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/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。