-
Notifications
You must be signed in to change notification settings - Fork 105
106 lines (93 loc) · 3.76 KB
/
build.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Polygeist build and test
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: Build ${{ matrix.os }} ${{ matrix.compiler }} polymer=${{ matrix.polymer }} pluto ${{ matrix.pluto-build }} mlir ${{ matrix.mlir-build }} polygeist ${{ matrix.polygeist-build }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
pluto-build: ["Release"] # Only Release supported currently
mlir-build: ["Release"] #, "Debug"] # "RelWithDebInfo"
polygeist-build: ["Release", "Debug"] #, "Debug"] # "RelWithDebInfo"
polymer: ["0", "1"]
os: [ubuntu-22.04]
compiler: [gcc, clang]
cxxcompiler: [g++, clang++]
exclude:
- compiler: gcc
cxxcompiler: clang++
- compiler: clang
cxxcompiler: g++
timeout-minutes: 360
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
path: src
submodules: 'recursive'
- name: add dependencies
run: sudo apt-get install -y llvm-15-tools ninja-build libbison-dev libtool libgmp-dev #libflex-dev cmake binutils-gold binutils binutils-dev ${{ matrix.compiler }} ${{ matrix.linker-pkg }}
- name: Cache Pluto
id: cache-pluto
uses: actions/cache@v3
with:
path: pluto-build
key: ${{ matrix.pluto-build }}-${{ matrix.os }}-pluto-${{ matrix.polymer }}
- name: Pluto build
if: steps.cache-pluto.outputs.cache-hit != 'true' && matrix.polymer == '1'
run: |
mkdir -p pluto-build
PATH="/usr/lib/llvm-15/bin/:$PATH" src/tools/polymer/build_polymer_deps.sh $(pwd)/pluto-build
sleep 1s
- uses: actions/cache/save@v3
if: steps.cache-pluto.outputs.cache-hit != 'true'
with:
path: pluto-build
key: ${{ matrix.pluto-build }}-${{ matrix.os }}-pluto-${{ matrix.polymer }}
- name: Read LLVM commit
id: getversion
run: echo "version=$(cat src/.git/modules/llvm-project/HEAD)" >> $GITHUB_OUTPUT
- name: Cache MLIR
id: cache-mlir
uses: actions/cache@v3
with:
path: mlir-build
key: ${{ matrix.mlir-build }}-${{ matrix.os }}-mlir-${{ steps.getversion.outputs.version }}
- name: MLIR build
if: steps.cache-mlir.outputs.cache-hit != 'true'
run: |
mkdir mlir-build
cd mlir-build
CYMBL=OFF cmake ../src/llvm-project/llvm -GNinja -DLLVM_ENABLE_PROJECTS="llvm;clang;mlir" -DCMAKE_BUILD_TYPE=${{ matrix.mlir-build }} -DCMAKE_C_COMPILER=/bin/clang -DCMAKE_CXX_COMPILER=/bin/clang++ -DCMAKE_ASM_COMPILER=/bin/clang -DCMAKE_CXX_FLAGS="-Wno-c++11-narrowing"
#cymbld & disown
sleep 1
CYMBL=OFF ninja
- uses: actions/cache/save@v3
if: steps.cache-mlir.outputs.cache-hit != 'true'
with:
path: mlir-build
key: ${{ matrix.mlir-build }}-${{ matrix.os }}-mlir-${{ steps.getversion.outputs.version }}
- name: mkdir
run: mkdir build
- name: cmake
run: |
cd build
ls ../mlir-build/lib/cmake/clang
cmake ../src/ -GNinja -DMLIR_DIR=`pwd`/../mlir-build/lib/cmake/mlir -DLLVM_EXTERNAL_LIT=`pwd`/../mlir-build/bin/llvm-lit -DClang_DIR=`pwd`/../mlir-build/lib/cmake/clang -DCMAKE_BUILD_TYPE=${{ matrix.polygeist-build }} -DCMAKE_C_COMPILER=${{matrix.compiler}} -DCMAKE_CXX_COMPILER=${{matrix.cxxcompiler}} -DPOLYGEIST_ENABLE_POLYMER=${{ matrix.polymer }} -DPOLYMER_DEP_DIR=$(pwd)/../pluto-build/
- name: test cgeist
run: |
cd build
ninja -j1
ninja check-polygeist-opt
ninja check-cgeist
- name: test polymer
if: matrix.polymer == '1'
run: |
cd build
ninja
PATH="`pwd`/../mlir-build/bin:$PATH" LLVM_SYMBOLIZER_PATH="`pwd`/../mlir-build/bin/llvm-symbolizer" ninja check-polymer