-
Notifications
You must be signed in to change notification settings - Fork 254
62 lines (62 loc) · 3.36 KB
/
cross.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
name: Arm cross-compilation build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-20.04
name: '${{ matrix.target.arch }}, ${{ matrix.sys.compiler }} ${{ matrix.sys.version }}'
strategy:
matrix:
target:
- { platform: 'arm', arch: 'armv7-a', dir: 'arm-linux-gnueabihf', flags: '-mfpu=neon' }
- { platform: 'aarch64', arch: 'armv8-a', dir: 'aarch64-linux-gnu', flags: '' }
sys:
- { compiler: 'gcc', version: '8' }
- { compiler: 'clang', version: 'latest' }
steps:
- name: Setup compiler
if: ${{ matrix.sys.compiler == 'clang' }}
run: |
LLVM_VERSION=${{ matrix.sys.version }}
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
if [[ $LLVM_VERSION -eq 'latest' ]]; then
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" || exit 1
else
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || exit 1
fi
sudo apt-get update || exit 1
if [[ $LLVM_VERSION -eq 'latest' ]]; then
sudo apt-get --no-install-suggests --no-install-recommends install clang || exit 1
else
sudo apt-get --no-install-suggests --no-install-recommends install clang-$LLVM_VERSION || exit 1
fi
sudo apt-get --no-install-suggests --no-install-recommends install g++-9-${{ matrix.target.dir }} g++-9-multilib || exit 1
- name: Setup compiler
if: ${{ matrix.sys.compiler == 'gcc' }}
run: |
sudo apt-get update || exit 1
sudo apt-get --no-install-suggests --no-install-recommends install g++-${{ matrix.sys.version }}-${{ matrix.target.dir }} g++-${{ matrix.sys.version }}-multilib || exit 1
sudo update-alternatives --remove-all ${{ matrix.target.dir }}-gcc || true
sudo update-alternatives --remove-all ${{ matrix.target.dir }}-g++ || true
sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-gcc ${{ matrix.target.dir }}-gcc /usr/bin/${{ matrix.target.dir }}-gcc-${{ matrix.sys.version }} 20
sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-g++ ${{ matrix.target.dir }}-g++ /usr/bin/${{ matrix.target.dir }}-g++-${{ matrix.sys.version }} 20
- name: Setup QEMU
run: |
sudo apt-get --no-install-suggests --no-install-recommends install qemu-user
- name: Setup Ninja
run: |
sudo apt-get install ninja-build
- name: Checkout xsimd
uses: actions/checkout@v3
- name: Setup
run: |
mkdir _build
cd _build && cmake .. -DBUILD_TESTS=ON -DDOWNLOAD_DOCTEST=ON -DBUILD_BENCHMARK=ON -DBUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DTARGET_ARCH=generic -DCMAKE_C_FLAGS="-march=${{ matrix.target.arch }} ${{ matrix.target.flags }}" -DCMAKE_CXX_FLAGS="-march=${{ matrix.target.arch }} ${{ matrix.target.flags }}" -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/${{ matrix.sys.compiler }}-${{ matrix.target.dir }}.cmake
- name: Build
run: cmake --build _build
- name: Testing xsimd
run: |
qemu-${{ matrix.target.platform }} -L /usr/${{ matrix.target.dir}}/ ./test/test_xsimd
working-directory: ${{ github.workspace }}/_build