Configure meson.build #58
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: CI | |
on: [push, pull_request] | |
env: | |
BUILD_DIR: _build | |
jobs: | |
gcc-meson-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
fc: [gfortran-11] | |
cc: [gcc-11] | |
include: | |
- os: ubuntu-latest | |
fc: gfortran-9 | |
cc: gcc-9 | |
- os: ubuntu-latest | |
fc: gfortran-10 | |
cc: gcc-10 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.x | |
- name: Install OpenBLAS (OSX) | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: | | |
brew install openblas | |
echo "PKG_CONFIG_PATH=/usr/local/opt/openblas/lib/pkgconfig" >> $GITHUB_ENV | |
- name: Install meson | |
run: pip3 install meson==0.62.0 ninja cmake | |
- name: Configure build | |
run: >- | |
meson setup ${{ env.BUILD_DIR }} | |
--buildtype=release | |
${{ env.MESON_ARGS }} | |
env: | |
FC: ${{ matrix.fc }} | |
CC: ${{ matrix.cc }} | |
MESON_ARGS: ${{ contains(matrix.os, 'macos') && '-Dlapack=openblas' || '-Dlapack=netlib' }} | |
- name: Build project | |
run: meson compile -C ${{ env.BUILD_DIR }} | |
- name: Run unit tests | |
run: meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild -t 120 --suite cpx | |
intel-meson-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
fc: [ifort] | |
cc: [icc] | |
env: | |
FC: ${{ matrix.fc }} | |
CC: ${{ matrix.cc }} | |
APT_PACKAGES: >- | |
intel-oneapi-compiler-fortran | |
intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic | |
intel-oneapi-mkl | |
intel-oneapi-mkl-devel | |
asciidoctor | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.x | |
- run: pip3 install meson ninja --user | |
- name: Add Intel repository | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | |
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | |
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | |
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
sudo apt-get update | |
- name: Install Intel oneAPI compiler | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get install ${APT_PACKAGES} | |
source /opt/intel/oneapi/setvars.sh | |
source /opt/intel/oneapi/compiler/2024.0/env/vars.sh | |
printenv >> $GITHUB_ENV | |
- name: Configure meson build | |
run: >- | |
meson setup ${{ env.BUILD_DIR }} | |
--prefix=/ --libdir=lib | |
-Dfortran_link_args="-lifcoremt -static" | |
-Ddefault_library=static | |
-Dlapack=mkl | |
- name: Build project | |
run: ninja -C ${{ env.BUILD_DIR }} | |
- name: Run unit tests | |
run: >- | |
meson test -C ${{ env.BUILD_DIR }} | |
--print-errorlogs | |
--num-processes 1 | |
--no-rebuild | |
--suite cpx | |
-t 12 | |
gcc-cmake-build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
fc: [gfortran-10] | |
cc: [gcc-10] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install CMake | |
run: pip3 install ninja cmake==3.26.4 | |
- name: Configure build | |
run: cmake -B ${{ env.BUILD_DIR }} -G Ninja | |
env: | |
FC: ${{ matrix.fc }} | |
CC: ${{ matrix.cc }} | |
- name: Build project | |
run: cmake --build ${{ env.BUILD_DIR }} | |
- name: Run unit tests | |
run: ctest --parallel --output-on-failure -R cpcmx | |
working-directory: ${{ env.BUILD_DIR }} | |
env: | |
OMP_NUM_THREADS: 2,1 |