-
Notifications
You must be signed in to change notification settings - Fork 260
137 lines (135 loc) · 5.69 KB
/
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
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
name: Linux build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
build:
runs-on: ubuntu-20.04
name: '${{ matrix.sys.compiler }} ${{ matrix.sys.version }} - ${{ matrix.sys.flags }}'
strategy:
matrix:
sys:
- { compiler: 'gcc', version: '7', flags: 'force_no_instr_set' }
- { compiler: 'gcc', version: '8', flags: 'enable_xtl_complex' }
- { compiler: 'gcc', version: '9', flags: 'avx' }
#- { compiler: 'gcc', version: '10', flags: 'avx512' } buggy
- { compiler: 'gcc', version: '11', flags: 'avx512' }
- { compiler: 'gcc', version: '11', flags: 'i386' }
- { compiler: 'gcc', version: '11', flags: 'avx512pf' }
- { compiler: 'gcc', version: '11', flags: 'avx512vbmi' }
- { compiler: 'gcc', version: '11', flags: 'avx512vnni' }
- { compiler: 'clang', version: '8', flags: 'force_no_instr_set' }
- { compiler: 'clang', version: '10', flags: 'enable_xtl_complex' }
- { compiler: 'clang', version: '12', flags: 'avx' }
- { compiler: 'clang', version: '13', flags: 'sse3' }
- { compiler: 'clang', version: '14', flags: 'avx512' }
steps:
- name: Setup compiler
if: ${{ matrix.sys.compiler == 'gcc' }}
run: |
GCC_VERSION=${{ matrix.sys.version }}
if [[ $GCC_VERSION == '6' || $GCC_VERSION == '7' || $GCC_VERSION == '8' ]]; then
#sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install g++-$GCC_VERSION
fi
if [[ '${{ matrix.sys.flags }}' -eq 'i386' ]]; then
sudo dpkg --add-architecture i386
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get --no-install-suggests --no-install-recommends install gcc-$GCC_VERSION-multilib g++-$GCC_VERSION-multilib linux-libc-dev:i386
fi
CC=gcc-$GCC_VERSION
echo "CC=$CC" >> $GITHUB_ENV
CXX=g++-$GCC_VERSION
echo "CXX=$CXX" >> $GITHUB_ENV
- name: Setup compiler
if: ${{ matrix.sys.compiler == 'clang' }}
run: |
LLVM_VERSION=${{ matrix.sys.version }}
#sudo add-apt-repository ppa:ubuntu-toolchain-r/test || exit 1
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
if [[ $LLVM_VERSION -ge 13 ]]; then
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || exit 1
else
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" || exit 1
fi || exit 1
sudo apt-get update || exit 1
sudo apt-get --no-install-suggests --no-install-recommends install clang-$LLVM_VERSION || exit 1
sudo apt-get --no-install-suggests --no-install-recommends install g++-9 g++-9-multilib || exit 1
sudo ln -s /usr/include/asm-generic /usr/include/asm
CC=clang-$LLVM_VERSION
echo "CC=$CC" >> $GITHUB_ENV
CXX=clang++-$LLVM_VERSION
echo "CXX=$CXX" >> $GITHUB_ENV
- name: Checkout xsimd
uses: actions/checkout@v3
- name: Install mamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
- name: Setup SDE
if: startswith(matrix.sys.flags, 'avx512')
run: sh install_sde.sh
- name: Configure build
env:
CC: ${{ env.CC }}
CXX: ${{ env.CXX }}
run: |
if [[ '${{ matrix.sys.flags }}' == 'enable_xtl_complex' ]]; then
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DENABLE_XTL_COMPLEX=ON"
fi
if [[ '${{ matrix.sys.flags }}' == 'avx' ]]; then
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DTARGET_ARCH=sandybridge"
fi
if [[ '${{ matrix.sys.flags }}' == 'sse3' ]]; then
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DTARGET_ARCH=nocona"
fi
if [[ '${{ matrix.sys.flags }}' == 'avx512' ]]; then
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DTARGET_ARCH=skylake-avx512"
fi
if [[ '${{ matrix.sys.flags }}' == 'avx512pf' ]]; then
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DTARGET_ARCH=knl"
fi
if [[ '${{ matrix.sys.flags }}' == 'avx512vbmi' ]]; then
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DTARGET_ARCH=cannonlake"
fi
if [[ '${{ matrix.sys.flags }}' == 'avx512vnni' ]]; then
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DTARGET_ARCH=knm"
fi
if [[ '${{ matrix.sys.flags }}' == 'i386' ]]; then
CXX_FLAGS="$CXX_FLAGS -m32"
fi
if [[ '${{ matrix.sys.flags }}' == 'force_no_instr_set' ]]; then
:
else
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DXSIMD_ENABLE_WERROR=ON"
fi
# Cheap way of spotting uninitialized read
CXX_FLAGS="$CXX_FLAGS -ftrivial-auto-var-init=pattern"
mkdir _build
cd _build
cmake .. -DBUILD_TESTS=ON \
-DBUILD_BENCHMARK=ON \
-DBUILD_EXAMPLES=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
$CMAKE_EXTRA_ARGS \
-DCMAKE_CXX_FLAGS='$CXX_FLAGS' \
-G Ninja
- name: Build
run: ninja -C _build
- name: Test
run: |
cd _build
cd test
if echo '${{ matrix.sys.flags }}' | grep -q 'avx512' ; then
../../sde-external-8.69.1-2021-07-18-lin/sde64 -skx -- ./test_xsimd
else
./test_xsimd
fi