-
Notifications
You must be signed in to change notification settings - Fork 36
95 lines (84 loc) · 3.62 KB
/
build_and_cache_Kokkos_linux.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
name: Build and Cache Kokkos
env:
GCC_VERSION: 11
on:
workflow_call:
inputs:
os:
required: true
type: string
runs_on:
description: |
The runner that should run the jobs. If left blank, the value from inputs.os is used.
This is useful if you want the jobs to run in a specific runner group, while not using that group name as part
of the cache key.
required: false
type: string
default: ''
kokkos_version:
required: false
type: string
default: 4.3.01
outputs:
exec_model:
description: "The execution model for Kokkos."
value: ${{ jobs.linux-set-builder-matrix.outputs.exec_model }}
kokkos_version:
description: "Kokkos version"
value: ${{ jobs.linux-set-builder-matrix.outputs.kokkos_version }}
jobs:
linux-set-builder-matrix:
name: Set Kokkos builder matrix
runs-on: ubuntu-22.04
steps:
- name: Kokkos execution strategy
id: exec_model
run: echo "exec_model=[\"OPENMP\"]" >> $GITHUB_OUTPUT
- name: Kokkos version
id: kokkos_version
run: echo "kokkos_version=[\"${{ inputs.kokkos_version }}\"]" >> $GITHUB_OUTPUT
outputs:
exec_model: ${{ steps.exec_model.outputs.exec_model }}
kokkos_version: ${{ steps.kokkos_version.outputs.kokkos_version }}
build_dependencies:
needs: [linux-set-builder-matrix]
strategy:
matrix:
exec_model: ${{ fromJson(needs.linux-set-builder-matrix.outputs.exec_model) }}
kokkos_version: ${{ fromJson(needs.linux-set-builder-matrix.outputs.kokkos_version) }}
timeout-minutes: 30
name: Kokkos core (${{ matrix.exec_model }})
runs-on: ${{ inputs.runs_on || inputs.os }}
steps:
- name: Cache installation directories
id: kokkos-cache
uses: actions/cache@v4
with:
path: ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}
key: ${{ inputs.os }}-kokkos${{ matrix.kokkos_version }}-${{ matrix.exec_model }}
- name: Clone Kokkos repository
if: steps.kokkos-cache.outputs.cache-hit != 'true'
run: |
git clone --branch ${{ matrix.kokkos_version }} https://github.com/kokkos/kokkos.git
pushd . &> /dev/null
- name: Install dependencies (Ubuntu)
if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }}
run: |
sudo apt-get update && sudo apt-get -y -q install cmake gcc-$GCC_VERSION g++-$GCC_VERSION ninja-build git
- name: Build Kokkos core library (Ubuntu)
if: ${{ (((inputs.os == 'ubuntu-latest') || (inputs.os == 'ubuntu-20.04') || (inputs.os == 'ubuntu-22.04')) && (steps.kokkos-cache.outputs.cache-hit != 'true')) }}
run: |
mkdir -p ${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }}
cd kokkos
cmake -BBuild . -DCMAKE_INSTALL_PREFIX=${{ github.workspace}}/Kokkos_install/${{ matrix.exec_model }} \
-DKokkos_ENABLE_COMPLEX_ALIGN=OFF \
-DKokkos_ENABLE_SERIAL=ON \
-DKokkos_ENABLE_${{ matrix.exec_model }}=ON \
-DKokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
-DCMAKE_CXX_COMPILER="$(which g++-$GCC_VERSION)" \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-G Ninja
cmake --build ./Build --verbose
cmake --install ./Build
cd -