-
Notifications
You must be signed in to change notification settings - Fork 69
83 lines (73 loc) · 3.17 KB
/
cmake.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
name: CMake
on: [push, pull_request]
env:
BUILD_TYPE: RelWithDebInfo
jobs:
build-mdspan:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler_driver: [g++-9, g++-10, clang++, icpx]
stdcxx: [14, 17, 20, 23]
include:
- compiler_driver: g++-9
compiler_prefix: /usr/bin
- compiler_driver: g++-10
compiler_prefix: /usr/bin
- compiler_driver: clang++
compiler_prefix: /usr/bin
cxx_flags_extra: "-stdlib=libc++"
- compiler_driver: icpx
compiler_prefix: /opt/intel/oneapi/compiler/latest/linux/bin
# To get new URL, look here:
# https://www.intel.com/content/www/us/en/developer/articles/tool/oneapi-standalone-components.html#inpage-nav-6-undefined
compiler_url: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ebf5d9aa-17a7-46a4-b5df-ace004227c0e/l_dpcpp-cpp-compiler_p_2023.2.1.8_offline.sh
- enable_benchmark: ON
- stdcxx: 23
enable_benchmark: OFF
exclude:
- compiler_driver: g++-9
stdcxx: 23
- compiler_driver: g++-10
stdcxx: 23
name: ${{ matrix.compiler_driver }} C++${{ matrix.stdcxx }}
steps:
- name: Cache icpx install
if: ${{ matrix.compiler_driver == 'icpx' }}
id: cache-icpx
uses: actions/cache@v2
with:
path: /opt/intel/oneapi
key: oneapi-${{ matrix.compiler_url}}
- name: Install icpx
if: ${{ matrix.compiler_driver == 'icpx' && steps.cache-icpx.outputs.cache-hit != 'true' }}
run: |
curl --url ${{ matrix.compiler_url }} --output download.sh
sudo sh -x download.sh -s -a -s --action install --eula accept
- name: Install gtest manually
run: |
sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake CMakeLists.txt && sudo make && sudo cp lib/*.a /usr/lib && sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a && sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a
sudo apt install libbenchmark1 libbenchmark-dev
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/mdspan-build
- name: Check Out
uses: actions/checkout@v2
with:
path: ${{github.workspace}}/mdspan-src
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/mdspan-build
run: CXX=${{ matrix.compiler_prefix}}/${{ matrix.compiler_driver }} cmake $GITHUB_WORKSPACE/mdspan-src -DMDSPAN_CXX_STANDARD=${{ matrix.stdcxx }} -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/mdspan-install -DMDSPAN_ENABLE_TESTS=ON -DMDSPAN_ENABLE_EXAMPLES=ON -DMDSPAN_ENABLE_BENCHMARKS=${{matrix.enable_benchmark}} -DMDSPAN_ENABLE_COMP_BENCH=ON -DCMAKE_CXX_FLAGS=${{matrix.cxx_flags_extra}}
- name: Build
shell: bash
working-directory: ${{github.workspace}}/mdspan-build
run: make -j
- name: Test
working-directory: ${{github.workspace}}/mdspan-build
shell: bash
run: ctest --output-on-failure
- name: Install
shell: bash
working-directory: ${{github.workspace}}/mdspan-build
run: make install