forked from devitocodes/devito
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxdsl_llvm.docker
41 lines (34 loc) · 1.29 KB
/
xdsl_llvm.docker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM ubuntu:22.04 as build
ARG mlirhash=98e674c9f16d677d95c67bc130e267fae331e43c
# base requirements
RUN apt-get update \
&& apt-get install --yes --no-install-recommends git cmake build-essential \
&& apt-get install --yes ca-certificates ninja-build clang lld python3 python3-dev python3-pip python3-venv pip \
&& apt-get install --yes libstdc++-12-dev binutils-dev
WORKDIR /xdsl-sc
# mlir
RUN git init llvm-project \
&& cd llvm-project \
&& git remote add origin https://github.com/llvm/llvm-project.git \
&& git config --local gc.auto 0 \
&& git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin $mlirhash \
&& git checkout --progress --force FETCH_HEAD \
&& mkdir build \
&& cd build \
&& cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS="mlir;clang;openmp;lld" \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DLLVM_ENABLE_LLD=ON \
-DLLVM_BINUTILS_INCDIR=/usr/include \
&& ninja install \
&& cd ../../ \
&& rm -rf llvm-project
# Build dockerfile
# Example name: <gbisbas/llvm-xdsl:0.4>
# docker build --network=host --file xdsl_llvm.docker --tag <name> .
# docker push <name>