Skip to content

Commit 84622f7

Browse files
committed
Restore scalar code and improve portability
- Reintroduce scalar code and add tests for vectorization - Ensure xsimd compiles on unsupported platforms - Add PPC support and dedicated workflow
1 parent 10391c2 commit 84622f7

File tree

17 files changed

+1094
-407
lines changed

17 files changed

+1094
-407
lines changed

.github/workflows/powerpc.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: PowerPC cross-compilation build
2+
3+
on:
4+
# Weekly schedule (Sunday 00:00 UTC)
5+
schedule:
6+
- cron: "0 0 * * 0"
7+
8+
# On tag push
9+
push:
10+
tags:
11+
- 'v*'
12+
# Manual trigger (with an optional deploy toggle)
13+
workflow_dispatch:
14+
inputs:
15+
deploy:
16+
description: "Deploy after build?"
17+
type: boolean
18+
required: false
19+
default: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
name: '${{ matrix.target.arch }}, ${{ matrix.sys.compiler }} ${{ matrix.sys.version }}'
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
target:
29+
- { platform: 'ppc64le', arch: 'ppc64le', dir: 'powerpc64le-linux-gnu', flags: '-maltivec -mvsx -mcpu=power10' }
30+
- { platform: 'ppc64', arch: 'ppc64', dir: 'powerpc64-linux-gnu', flags: '-maltivec -mvsx -mcpu=power10' }
31+
sys:
32+
- { compiler: 'gcc', version: '12' }
33+
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
38+
- name: Apt setup (cross toolchains, qemu, ninja)
39+
run: |
40+
sudo apt-get update
41+
sudo apt-get --no-install-suggests --no-install-recommends install \
42+
g++-${{ matrix.sys.version }}-${{ matrix.target.dir }} \
43+
g++-${{ matrix.sys.version }}-multilib \
44+
qemu-user \
45+
ninja-build
46+
sudo update-alternatives --remove-all ${{ matrix.target.dir }}-gcc || true
47+
sudo update-alternatives --remove-all ${{ matrix.target.dir }}-g++ || true
48+
sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-gcc ${{ matrix.target.dir }}-gcc /usr/bin/${{ matrix.target.dir }}-gcc-${{ matrix.sys.version }} 20
49+
sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-g++ ${{ matrix.target.dir }}-g++ /usr/bin/${{ matrix.target.dir }}-g++-${{ matrix.sys.version }} 20
50+
51+
- name: Configure (RelWithDebInfo, DUCC0 + examples + tests, no Fortran)
52+
shell: bash
53+
env:
54+
CC: ${{ matrix.target.dir }}-gcc
55+
CXX: ${{ matrix.target.dir }}-g++
56+
run: |
57+
cmake -S . -B build -G Ninja \
58+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
59+
-DCMAKE_C_COMPILER="${CC}" \
60+
-DCMAKE_CXX_COMPILER="${CXX}" \
61+
-DCMAKE_C_FLAGS="${{ matrix.target.flags }}" \
62+
-DCMAKE_CXX_FLAGS="${{ matrix.target.flags }}" \
63+
-DCMAKE_SYSTEM_NAME=Linux \
64+
-DCMAKE_SYSTEM_PROCESSOR=${{ matrix.target.arch }} \
65+
-DCMAKE_CROSSCOMPILING_EMULATOR="qemu-${{ matrix.target.platform }};-cpu;power10;-L;/usr/${{ matrix.target.dir }}/" \
66+
-DFINUFFT_USE_DUCC0=ON \
67+
-DFINUFFT_BUILD_EXAMPLES=ON \
68+
-DFINUFFT_BUILD_TESTS=ON \
69+
-DFINUFFT_ARCH_FLAGS=
70+
71+
- name: Build
72+
shell: bash
73+
run: cmake --build build --config RelWithDebInfo --parallel
74+
75+
- name: Test
76+
shell: bash
77+
# With CMAKE_CROSSCOMPILING_EMULATOR set, tests run via QEMU automatically.
78+
run: ctest --test-dir build --output-on-failure

0 commit comments

Comments
 (0)