Add a meson build system #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: standalone | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: SPRAL-Meson/${{ matrix.os }}/${{ matrix.fc_cmd }}/${{ matrix.compiler_version }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
compiler_version: [12] | |
include: | |
- compiler: gnu | |
cc_cmd: gcc | |
fc_cmd: gfortran | |
cxx_cmd: g++ | |
# - os: ubuntu-latest | |
# compiler: intel-llvm | |
# compiler_version: 2023.2 | |
# cc_cmd: icx | |
# fc_cmd: ifort | |
# cxx_cmd: icpx | |
# allow_failure: true | |
# - os: ubuntu-latest | |
# compiler: intel-llvm | |
# compiler_version: 2023.2 | |
# cc_cmd: icx | |
# fc_cmd: ifx | |
# cxx_cmd: icpx | |
# allow_failure: true | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out SPRAL | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install Meson and Ninja | |
run: pip install meson ninja | |
- name: Install dependencies on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get install libhwloc-dev libmetis-dev libopenblas-dev | |
- name: Install dependencies on MacOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew install hwloc metis openblas | |
- name: Set environment variables for OpenMP | |
shell: bash | |
run: | | |
echo "OMP_CANCELLATION=TRUE" >> $GITHUB_ENV | |
echo "OMP_PROC_BIND=TRUE" >> $GITHUB_ENV | |
- name: Install GNU compilers | |
if: matrix.compiler == 'gnu' | |
uses: awvwgk/setup-fortran@main | |
with: | |
compiler: gcc | |
version: ${{ matrix.compiler_version }} | |
- name: Install classic Intel compilers | |
if: matrix.compiler == 'intel' | |
uses: awvwgk/setup-fortran@main | |
with: | |
compiler: intel-classic | |
version: ${{ matrix.compiler_version }} | |
- name: Install nextgen Intel compilers | |
if: matrix.compiler == 'intel-llvm' | |
uses: awvwgk/setup-fortran@main | |
with: | |
compiler: intel | |
version: ${{ matrix.compiler_version }} | |
- name: Setup SPRAL | |
shell: bash | |
run: | | |
meson setup builddir --prefix=$GITHUB_WORKSPACE/spral -Dexamples=true -Dtests=true | |
env: | |
CC: ${{ matrix.cc_cmd }} | |
FC: ${{ matrix.fc_cmd }} | |
CXX: ${{ matrix.cxx_cmd }} | |
- name: Build SPRAL | |
shell: bash | |
run: | | |
meson compile -C builddir | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: ${{ matrix.os }}_${{ matrix.fc_cmd }}_${{ matrix.compiler_version }}_meson-log.txt | |
path: builddir/meson-logs/meson-log.txt | |
- name: Install SPRAL | |
shell: bash | |
run: | | |
meson install -C builddir | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: ${{ matrix.os }}_${{ matrix.fc_cmd }}_${{ matrix.compiler_version }}_install-log.txt | |
path: builddir/meson-logs/install-log.txt | |
# Uncomment this section to obtain ssh access to VM | |
# - name: Setup tmate session | |
# if: matrix.os == 'windows-latest' | |
# uses: mxschmitt/action-tmate@v3 | |
- name: Test SPRAL | |
shell: bash | |
run: | | |
meson test -C builddir | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: ${{ matrix.os }}_${{ matrix.fc_cmd }}_${{ matrix.compiler_version }}_testlog.txt | |
path: builddir/meson-logs/testlog.txt |