forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (125 loc) · 5.58 KB
/
hpxmp-tests.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
name: Run HPXMP Tests
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
container: stellargroup/hpxmp_build_env:latest
steps:
- name: Install dependencies
run: |
apt-get update
# apt-get install -y \
# libc++-12-dev \
# libc++abi-12-dev
- name: Set environment variables
run: |
echo "ROOT_DIR=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
echo "BUILD_TYPE=RelWithDebInfo" >> $GITHUB_ENV
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
echo "LDFLAGS=-stdlib=libc++" >> $GITHUB_ENV
- name: Build HPX
run: |
HPX_SRC_DIR=${ROOT_DIR}/hpx
HPX_BUILD_DIR=${HPX_SRC_DIR}/cmake-build-${BUILD_TYPE}
HPX_INSTALL_DIR=${HPX_SRC_DIR}/cmake-install-${BUILD_TYPE}
git clone --depth 1 https://github.com/STEllAR-GROUP/hpx ${HPX_SRC_DIR}
# Full build of HPX is needed to get the headers required by HPXC installed properly
cmake -G Ninja -S ${HPX_SRC_DIR} -B ${HPX_BUILD_DIR} \
-DHPX_WITH_FETCH_ASIO=ON \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=${HPX_INSTALL_DIR} \
-DHPX_WITH_DYNAMIC_HPX_MAIN=OFF \
-DHPX_WITH_EXAMPLES=OFF \
-DHPX_WITH_TESTS=OFF \
-DHPX_WITH_NETWORKING=OFF
cmake --build ${HPX_BUILD_DIR}
cmake --install ${HPX_BUILD_DIR}
echo "HPX_INSTALL_DIR=${HPX_SRC_DIR}/cmake-install-${BUILD_TYPE}" >> $GITHUB_ENV
- name: Build HPXC
run: |
HPXC_SRC_DIR=${ROOT_DIR}/hpxc
HPXC_BUILD_DIR=${HPXC_SRC_DIR}/cmake-build-${BUILD_TYPE}
HPXC_INSTALL_DIR=${HPXC_SRC_DIR}/cmake-install-${BUILD_TYPE}
git clone https://github.com/STEllAR-GROUP/hpxc ${HPXC_SRC_DIR}
cmake -G Ninja -S ${HPXC_SRC_DIR} -B ${HPXC_BUILD_DIR} \
-DHPX_DIR=${HPX_INSTALL_DIR}/lib/cmake/HPX \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_INSTALL_PREFIX=${HPXC_INSTALL_DIR} \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-D "HPXC_WITH_DYNAMIC_HPXC_MAIN=ON" \
-D "HPXC_WITH_SHARED_LIBS=ON"
cmake --build ${HPXC_BUILD_DIR}
cmake --install ${HPXC_BUILD_DIR}
echo "HPXC_INSTALL_DIR=${HPXC_SRC_DIR}/cmake-install-${BUILD_TYPE}" >> $GITHUB_ENV
- name: Fetch LLVM
run: |
LLVM_SRC_DIR=${ROOT_DIR}/llvm-project
# Needed to fetch PRs
git clone https://github.com/STEllAR-GROUP/llvm-project ${LLVM_SRC_DIR}
git -C ${LLVM_SRC_DIR} fetch origin +$GITHUB_SHA:refs/remotes/origin/pr
git -C ${LLVM_SRC_DIR} checkout $GITHUB_SHA
echo "LLVM_SRC_DIR=${LLVM_SRC_DIR}" >> $GITHUB_ENV
# OpenMP test suite requires `FileCheck`, `not` and `llvm-lit` binaries
- name: Build LLVM utils
run: |
LLVM_UTILS_SRC_DIR=${LLVM_SRC_DIR}/llvm
LLVM_UTILS_BUILD_DIR=${LLVM_UTILS_SRC_DIR}/cmake-build
cmake -G Ninja \
-S ${LLVM_UTILS_SRC_DIR} \
-B ${LLVM_UTILS_BUILD_DIR} \
-DLLVM_ENABLE_PROJECTS="clang;llvm" \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DLLVM_INCLUDE_TESTS=ON
cmake --build ${LLVM_UTILS_BUILD_DIR} --target not FileCheck
echo "LLVM_UTILS_BIN_DIR=${LLVM_UTILS_BUILD_DIR}/bin" >> $GITHUB_ENV
- name: Build OMP
run: |
OMP_SRC_DIR=${LLVM_SRC_DIR}/openmp
OMP_BUILD_DIR=${OMP_SRC_DIR}/cmake-build-omp-${BUILD_TYPE}
OMP_INSTALL_DIR=${OMP_SRC_DIR}/cmake-install-omp-${BUILD_TYPE}
cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX=${OMP_INSTALL_DIR} \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DOPENMP_ENABLE_LIBOMPTARGET=OFF \
-DLIBOMP_OMPD_SUPPORT=OFF \
-DLIBOMP_USE_ITT_NOTIFY=OFF \
-DOPENMP_LLVM_TOOLS_DIR=${LLVM_UTILS_BIN_DIR} \
-Wdev -S ${OMP_SRC_DIR} -B ${OMP_BUILD_DIR}
cmake --build ${OMP_BUILD_DIR}
cmake --install ${OMP_BUILD_DIR}
echo "OMP_BUILD_DIR=${OMP_BUILD_DIR}" >> $GITHUB_ENV
- name: Run OMP tests
run: |
cd ${OMP_BUILD_DIR}
# Ignore test failures for now
cmake --build . --target check-libomp || true
- name: Build HPXMP
run: |
HPXMP_SRC_DIR=${LLVM_SRC_DIR}/openmp
HPXMP_BUILD_DIR=${HPXMP_SRC_DIR}/cmake-build-hpxmp-${BUILD_TYPE}
HPXMP_INSTALL_DIR=${HPXMP_SRC_DIR}/cmake-install-hpxmp-${BUILD_TYPE}
cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX=${HPXMP_INSTALL_DIR} \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DHPX_DIR=${HPX_INSTALL_DIR}/lib/cmake/HPX \
-DHPXC_DIR=${HPXC_INSTALL_DIR} \
-DOPENMP_ENABLE_LIBOMPTARGET=OFF \
-DLIBOMP_OMPD_SUPPORT=OFF \
-DLIBOMP_USE_ITT_NOTIFY=OFF \
-DOPENMP_LLVM_TOOLS_DIR=${LLVM_UTILS_BIN_DIR} \
-DWITH_HPXC=ON \
-Wdev -S ${HPXMP_SRC_DIR} -B ${HPXMP_BUILD_DIR}
cmake --build ${HPXMP_BUILD_DIR}
cmake --install ${HPXMP_BUILD_DIR}
echo "HPXMP_BUILD_DIR=${HPXMP_BUILD_DIR}" >> $GITHUB_ENV
- name: Run HPXMP tests
run: |
cd ${HPXMP_BUILD_DIR}
cmake --build . --target check-libomp || true