forked from boostorg/ublas
-
Notifications
You must be signed in to change notification settings - Fork 5
83 lines (69 loc) · 4.39 KB
/
sanitizer.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
# Copyright (c) 2020 Mohammad Ashar Khan
# Copyright (c) 2021 Cem Bassoy
# Distributed under Boost Software License, Version 1.0
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
name: "Clang Sanitizer"
on:
push:
paths-ignore:
- '**.md'
- 'doc/**'
pull_request:
paths-ignore:
- '**.md'
- 'doc/**'
jobs:
build:
name: "${{matrix.config.name}} with ${{matrix.config.description}} sanitizer with std=${{matrix.config.cxx}} and variant=${{matrix.config.variant}}"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
# If any compiler fails to compile, continue CI for next compiler in matrix instead of failing early
matrix:
config:
- { name: clang, description: address and leak, cc: clang-11, cxx: clang++-11, cxxstd: 20, variant: debug, opt: off , cxxflags: -fsanitize=address -fno-omit-frame-pointer, ldflags: -fsanitize=address }
- { name: clang, description: undefined behavior, cc: clang-11, cxx: clang++-11, cxxstd: 20, variant: debug, opt: off , cxxflags: -fsanitize=undefined, ldflags: -fsanitize=undefined }
- { name: clang, description: thread, cc: clang-11, cxx: clang++-11, cxxstd: 20, variant: debug, opt: off , cxxflags: -fsanitize=thread, ldflags: -fsanitize=thread }
- { name: gcc, description: address and leak, cc: gcc-10, cxx: g++-10, cxxstd: 20, variant: release, opt: speed, cxxflags: -fopenmp -fsanitize=address -fno-omit-frame-pointer, ldflags: -fsanitize=address -fopenmp}
# - { name: gcc, description: undefined behavior, cc: gcc-10, cxx: g++-10, cxxstd: 20, variant: release, opt: speed, cxxflags: -fopenmp -fsanitize=undefined, ldflags: -fsanitize=undefined -fopenmp}
# - { name: gcc, description: thread, cc: gcc-10, cxx: g++-10, cxxstd: 20, variant: release, opt: speed, cxxflags: -fopenmp -fsanitize=thread, ldflags: -fsanitize=thread -fopenmp}
steps:
- uses: actions/checkout@v2
- name: Install Clang 11
run: sudo apt-get update && sudo apt-get install -y clang-11 clang-tools-11
- name: Install GCC 10
run: sudo apt-get update && sudo apt-get install -y g++-10 libomp-dev
- name: Git Clone Boost.uBlas
run: |
cd ${GITHUB_WORKSPACE}
cd ..
git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
echo "BOOST_ROOT=${PWD}" >> ${GITHUB_ENV}
echo $BOOST_ROOT
git submodule update --init --depth=1 --jobs 8 tools/build
git submodule update --init --depth=1 --jobs 8 libs/config
git submodule update --init --depth=1 --jobs 8 tools/boostdep
mkdir -p libs/numeric/
cp -rp ${GITHUB_WORKSPACE}/. libs/numeric/ublas
python tools/boostdep/depinst/depinst.py -g " --depth=1" -I benchmarks numeric/ublas
- name: Bootstrap Boost and Compile Boost
run: |
cd $BOOST_ROOT
./bootstrap.sh
./b2 -j8 headers
echo "using ${{ matrix.config.name }} : : ${{ matrix.config.cxx }} ;" >> ~/user-config.jam;
export ASAN_OPTIONS=symbolize=1
export ASAN_OPTIONS=detect_leaks=1
- name: Run Tensor Examples with "${{matrix.config.description}}" sanitizer
run: |
cd $BOOST_ROOT/libs/numeric/ublas
ASAN_OPTIONS=detect_leaks=1
ASAN_OPTIONS=symbolize=1
$BOOST_ROOT/b2 -j8 examples/tensor toolset=${{matrix.config.name}} cxxstd=${{matrix.config.cxxstd}} variant=${{matrix.config.variant}} optimization=${{matrix.config.opt}} cxxflags="${{matrix.config.cxxflags}}" linkflags="${{matrix.config.ldflags}}"
- name: Run Tensor Tests with "${{matrix.config.description}}" sanitizer
run: |
cd $BOOST_ROOT/libs/numeric/ublas
ASAN_OPTIONS=detect_leaks=1
ASAN_OPTIONS=symbolize=1
$BOOST_ROOT/b2 -j8 test/tensor toolset=${{matrix.config.name}} cxxstd=${{matrix.config.cxxstd}} variant=${{matrix.config.variant}} optimization=${{matrix.config.opt}} cxxflags="${{matrix.config.cxxflags}}" linkflags="${{matrix.config.ldflags}}"