Skip to content

Commit 389dd2d

Browse files
add ppc toolchain description
1 parent a8da651 commit 389dd2d

4 files changed

Lines changed: 49 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set(CMAKE_SYSTEM_PROCESSOR powerpc)
2+
set(triple powerpc-linux-gnu)
3+
4+
include(${CMAKE_CURRENT_LIST_DIR}/gcc.cmake)
5+
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
- { platform: 'arm', arch: 'armv7-a', dir: 'arm-linux-gnueabihf', flags: '-mfpu=neon', full: 'ON'}
1414
- { platform: 'arm', arch: 'armv7-a', dir: 'arm-linux-gnueabihf', flags: '-mfpu=vfpv3-d16', full: 'OFF' } # no neon
1515
- { platform: 'aarch64', arch: 'armv8-a', dir: 'aarch64-linux-gnu', flags: '', full: 'ON' }
16-
- { platform: 'ppc', arch: 'powerpc', dir: 'powerpc-linux-gnu', flags: '-maltivec', full: 'OFF' }
1716
sys:
1817
- { compiler: 'gcc', version: '10' }
1918
steps:

.github/workflows/cross-ppc.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: PowerPC cross-compilation build
2+
on: [push, pull_request]
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
name: '${{ matrix.target.arch }}, ${{ matrix.sys.compiler }} ${{ matrix.sys.version }}'
10+
strategy:
11+
matrix:
12+
target:
13+
- { platform: 'ppc', dir: 'powerpc-linux-gnu', flags: '-maltivec', full: 'OFF' }
14+
sys:
15+
- { compiler: 'gcc', version: '10' }
16+
steps:
17+
- name: Setup compiler
18+
if: ${{ matrix.sys.compiler == 'gcc' }}
19+
run: |
20+
sudo apt-get update || exit 1
21+
sudo apt-get --no-install-suggests --no-install-recommends install g++-${{ matrix.sys.version }}-${{ matrix.target.dir }} g++-${{ matrix.sys.version }}-multilib || exit 1
22+
sudo update-alternatives --remove-all ${{ matrix.target.dir }}-gcc || true
23+
sudo update-alternatives --remove-all ${{ matrix.target.dir }}-g++ || true
24+
sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-gcc ${{ matrix.target.dir }}-gcc /usr/bin/${{ matrix.target.dir }}-gcc-${{ matrix.sys.version }} 20
25+
sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-g++ ${{ matrix.target.dir }}-g++ /usr/bin/${{ matrix.target.dir }}-g++-${{ matrix.sys.version }} 20
26+
- name: Setup QEMU
27+
run: |
28+
sudo apt-get --no-install-suggests --no-install-recommends install qemu-user
29+
- name: Setup Ninja
30+
run: |
31+
sudo apt-get install ninja-build
32+
- name: Checkout xsimd
33+
uses: actions/checkout@v3
34+
- name: Setup
35+
run: |
36+
mkdir _build
37+
cd _build && cmake .. -DBUILD_TESTS=ON -DDOWNLOAD_DOCTEST=ON -DBUILD_BENCHMARK=${{ matrix.target.full }} -DBUILD_EXAMPLES=${{ matrix.target.full }} -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="${{ matrix.target.flags }}" -DCMAKE_CXX_FLAGS="${{ matrix.target.flags }}" -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/.github/toolchains/${{ matrix.sys.compiler }}-${{ matrix.target.dir }}.cmake
38+
- name: Build
39+
run: cmake --build _build
40+
- name: Testing xsimd
41+
run: |
42+
qemu-${{ matrix.target.platform }} -L /usr/${{ matrix.target.dir}}/ ./test/test_xsimd
43+
working-directory: ${{ github.workspace }}/_build

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"
103103
endif()
104104
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
105105
message(STATUS "CMAKE_CXX_LINK_EXECUTABLE: ${CMAKE_CXX_LINK_EXECUTABLE}")
106-
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^ppc64" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
106+
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^ppc(64)?" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
107107
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=${TARGET_ARCH} -mtune=${TARGET_ARCH}")
108108
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "riscv64")
109109
# Nothing specific

0 commit comments

Comments
 (0)