forked from Xilinx/mlir-air
-
Notifications
You must be signed in to change notification settings - Fork 1
151 lines (134 loc) · 5.3 KB
/
buildAndTestNoRuntime.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
145
146
147
148
149
150
151
# Copyright (C) 2022, Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
name: Build and Test Compiler Only
on:
push:
branches:
- main
pull_request:
types: [assigned, opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
jobs:
build-repo:
name: Build and Test
runs-on: ubuntu-20.04
steps:
- name: Configure Environment
run: echo "$GITHUB_WORKSPACE/llvm/install/bin" >> $GITHUB_PATH
# Clone the repo and its submodules. Do shallow clone to save clone
# time.
- name: Get repo
uses: actions/checkout@v3
with:
fetch-depth: 2
submodules: "true"
- name: Install libboost
run: sudo apt-get install -y libboost-all-dev
- name: Install pip packages
run: sudo pip install psutil pybind11 numpy launchpadlib
- name: Install Ninja
uses: llvm/actions/install-ninja@55d844821959226fab4911f96f37071c1d4c3268
- name: Get Submodule Hash
id: get-submodule-hash
run: echo "::set-output name=hash::$(md5sum $(echo utils/clone-llvm.sh))"
shell: bash
- name: Ccache for C++ compilation
uses: hendrikmuhs/ccache-action@4687d037e4d7cf725512d9b819137a3af34d39b3
with:
key: ${{ runner.os }}-clangreleaseasserts-${{ steps.get-submodule-hash.outputs.hash }}
max-size: 1G
- name: Get cmakeModules
id: clone-cmakeModules
run: |
git clone https://github.com/Xilinx/cmakeModules.git
pushd cmakeModules
git checkout -b air 2c3885644ea115d1d61bbf102abbd41be8ba8427
popd
shell: bash
- name: Get LLVM
id: clone-llvm
run: utils/clone-llvm.sh
shell: bash
- name: Rebuild and Install LLVM
run: utils/github-build-llvm.sh
- name: Rebuild and Install libxaie
run: utils/github-clone-build-libxaie.sh
- name: Get mlir-aie
id: clone-mlir-aie
run: utils/clone-mlir-aie.sh
shell: bash
- name: Rebuild and Install mlir-aie
run: |
mkdir -p mlir-aie/build
mkdir -p mlir-aie/install
pushd mlir-aie/build
cmake .. \
-GNinja \
-DCMAKE_BUILD_TYPE=Debug \
-DAIE_COMPILER=NONE \
-DAIE_LINKER=NONE \
-DHOST_COMPILER=NONE \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_MODULE_PATH=`pwd`/../cmake/modulesXilinx \
-DMLIR_DIR=`pwd`/../../llvm/install/lib/cmake/mlir/ \
-DLLVM_DIR=`pwd`/../../llvm/install/lib/cmake/llvm/ \
-DCMAKE_LINKER=lld \
-DCMAKE_C_COMPILER=clang-12 \
-DCMAKE_CXX_COMPILER=clang++-12 \
-DLLVM_EXTERNAL_LIT=`pwd`/../../llvm/build/bin/llvm-lit \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DLibXAIE_x86_64_DIR=`pwd`/../../aienginev2/install/lib \
-DCMAKE_INSTALL_PREFIX=`pwd`/../install
ninja install
popd
# Build the repo test target in debug mode to build and test.
- name: Build and test (Assert)
run: |
mkdir build_assert
pushd build_assert
cmake .. \
-GNinja \
-DCMAKE_TOOLCHAIN_FILE=`pwd`/../cmake/modules/toolchain_x86_64.cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_MODULE_PATH=`pwd`/../cmakeModules \
-DMLIR_DIR=../llvm/install/lib/cmake/mlir/ \
-DLLVM_DIR=../llvm/install/lib/cmake/llvm/ \
-DAIE_DIR=`pwd`/../mlir-aie/install/lib/cmake/aie/ \
-DLibXAIE_ROOT=`pwd`/../aienginev2/install \
-DAIR_RUNTIME_TARGETS:STRING="x86_64" \
-Dx86_64_TOOLCHAIN_FILE=`pwd`/../cmake/modules/toolchain_x86_64.cmake \
-DLLVM_EXTERNAL_LIT=`pwd`/../llvm/build/bin/llvm-lit \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_INSTALL_PREFIX=install
ninja
ninja check-air-cpp
ninja check-air-mlir
ninja check-air-python
popd
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/aienginev2/install/lib
# Build the repo test target in release mode to build and test.
- name: Build and test (Release)
run: |
mkdir build_release
pushd build_release
cmake .. \
-DCMAKE_TOOLCHAIN_FILE=`pwd`/../cmake/modules/toolchain_x86_64.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DCMAKE_MODULE_PATH=`pwd`/../cmakeModules \
-DMLIR_DIR=../llvm/install/lib/cmake/mlir/ \
-DLLVM_DIR=../llvm/install/lib/cmake/llvm/ \
-DAIE_DIR=`pwd`/../mlir-aie/install/lib/cmake/aie/ \
-DLibXAIE_ROOT=`pwd`/../aienginev2/install \
-DAIR_RUNTIME_TARGETS:STRING="x86_64" \
-Dx86_64_TOOLCHAIN_FILE=`pwd`/../cmake/modules/toolchain_x86_64.cmake \
-DLLVM_EXTERNAL_LIT=`pwd`/../llvm/build/bin/llvm-lit \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_INSTALL_PREFIX=install
make -j$(nproc)
make check-air-cpp check-air-mlir check-air-python
popd
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/aienginev2/install/lib