|
| 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: 'ppc64le', dir: 'powerpc64le-linux-gnu', flags: '-maltivec -mvsx -mcpu=power10', full: 'OFF' } |
| 14 | + - { platform: 'ppc64', dir: 'powerpc64-linux-gnu', flags: '-maltivec -mvsx -mcpu=power10', full: 'OFF' } |
| 15 | + sys: |
| 16 | + - { compiler: 'gcc', version: '12' } |
| 17 | + steps: |
| 18 | + - name: Setup compiler |
| 19 | + if: ${{ matrix.sys.compiler == 'gcc' }} |
| 20 | + run: | |
| 21 | + sudo apt-get update || exit 1 |
| 22 | + sudo apt-get --no-install-suggests --no-install-recommends install g++-${{ matrix.sys.version }}-${{ matrix.target.dir }} g++-${{ matrix.sys.version }}-multilib || exit 1 |
| 23 | + sudo update-alternatives --remove-all ${{ matrix.target.dir }}-gcc || true |
| 24 | + sudo update-alternatives --remove-all ${{ matrix.target.dir }}-g++ || true |
| 25 | + sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-gcc ${{ matrix.target.dir }}-gcc /usr/bin/${{ matrix.target.dir }}-gcc-${{ matrix.sys.version }} 20 |
| 26 | + sudo update-alternatives --install /usr/bin/${{ matrix.target.dir }}-g++ ${{ matrix.target.dir }}-g++ /usr/bin/${{ matrix.target.dir }}-g++-${{ matrix.sys.version }} 20 |
| 27 | + - name: Setup QEMU |
| 28 | + run: | |
| 29 | + sudo apt-get --no-install-suggests --no-install-recommends install qemu-user |
| 30 | + - name: Setup Ninja |
| 31 | + run: | |
| 32 | + sudo apt-get install ninja-build |
| 33 | + - name: Checkout xsimd |
| 34 | + uses: actions/checkout@v3 |
| 35 | + - name: Setup |
| 36 | + run: | |
| 37 | + mkdir _build |
| 38 | + 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 |
| 39 | + - name: Build |
| 40 | + run: cmake --build _build --verbose -j1 |
| 41 | + - name: Testing xsimd |
| 42 | + run: | |
| 43 | + qemu-${{ matrix.target.platform }} -cpu power10 -L /usr/${{ matrix.target.dir}}/ ./test/test_xsimd |
| 44 | + working-directory: ${{ github.workspace }}/_build |
0 commit comments