-
Notifications
You must be signed in to change notification settings - Fork 3
144 lines (124 loc) · 3.9 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Build
on:
push:
pull_request:
workflow_dispatch:
jobs:
build-llvm-9:
runs-on: ubuntu-20.04
outputs:
cache-key: llvm-9.0.1-${{ runner.os }}
steps:
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: |
llvm-install
key: llvm-9.0.1-${{ runner.os }}
- name: Checkout LLVM
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: llvm/llvm-project
ref: refs/tags/llvmorg-9.0.1
submodules: false
fetch-depth: 1 # shallow
path: llvm-project
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt-get update && sudo apt-get install -y build-essential cmake ninja-build binutils-dev
- name: Build LLVM
if: steps.cache.outputs.cache-hit != 'true'
run: |
mkdir build
cd build
cmake -G Ninja ../llvm-project/llvm -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-DCMAKE_INSTALL_PREFIX=../llvm-install \
-DCMAKE_CXX_STANDARD="17"
ninja
ninja install
build-noelle:
needs: build-llvm-9
runs-on: ubuntu-20.04
outputs:
cache-key: noelle-${{ runner.os }}
steps:
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: |
noelle-install
key: noelle-${{ runner.os }}
- name: Restore cache from LLVM
if: steps.cache.outputs.cache-hit != 'true'
id: cache-llvm
uses: actions/cache@v3
with:
path: llvm-install
key: ${{ needs.build-llvm-9.outputs.cache-key }}
restore-keys: |
${{ needs.build-llvm-9.outputs.cache-key }}
- name: Checkout Noelle
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: arcana-lab/noelle
path: noelle
- name: Build Noelle
if: steps.cache.outputs.cache-hit != 'true'
run: |
LLVM_INSTALL=$(realpath llvm-install)
mkdir -p noelle-install
NOELLE_INSTALL=$(realpath noelle-install)
PATH=${LLVM_INSTALL}/bin/:${PATH} \
LLVM_CMAKE_DIR=${LLVM_INSTALL}/lib/cmake/llvm \
PDG_INSTALL_DIR=${NOELLE_INSTALL} \
make -C noelle all
build-prompt:
needs: [build-llvm-9]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
path: PROMPT
- name: Restore cache from LLVM
id: cache-llvm
uses: actions/cache@v3
with:
path: llvm-install
key: ${{ needs.build-llvm-9.outputs.cache-key }}
restore-keys: |
${{ needs.build-llvm-9.outputs.cache-key }}
- name: Install system dependences
run: |
sudo apt-get install -y build-essential libboost-all-dev libunwind-dev binutils-dev
- name: Set up Python 3.x
uses: actions/setup-python@v3
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install argparse pyyaml
- name: Build
run: |
llvm_install=$(realpath llvm-install)
cd PROMPT
cd src/runtime/frontend
cd ../../..
export PATH=${llvm_install}/bin:$PATH
export CC=clang
export CXX=clang++
make build
make install
- name: Cache PROMPT/install directory
uses: actions/cache@v3
with:
path: PROMPT/install
key: ${{ runner.os }}-prompt-install-${{ github.sha }}