test #661
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: | |
CMAKE_BUILD_PARALLEL_LEVEL: "2" # 2 cores on each GHA VM, enable parallel builds | |
CTEST_OUTPUT_ON_FAILURE: "ON" # This way we don't need a flag to ctest | |
CTEST_PARALLEL_LEVEL: "2" | |
CTEST_TIME_TIMEOUT: "5" # some failures hang forever | |
HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker | |
HOMEBREW_NO_AUTO_UPDATE: "ON" | |
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON" | |
HOMEBREW_NO_GITHUB_API: "ON" | |
HOMEBREW_NO_INSTALL_CLEANUP: "ON" | |
jobs: | |
Build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-12] | |
toolchain: | |
- {compiler: gcc, version: 10} | |
- {compiler: gcc, version: 11} | |
- {compiler: gcc, version: 12} | |
- {compiler: gcc, version: 13} | |
- {compiler: intel, version: '2024.1'} | |
- {compiler: intel-classic, version: '2021.9'} | |
build: [cmake] | |
include: | |
- os: ubuntu-latest | |
build: cmake-inline | |
toolchain: | |
- {compiler: gcc, version: 10} | |
exclude: | |
- os: macos-12 | |
toolchain: {compiler: intel, version: '2024.1'} | |
- os: macos-12 | |
toolchain: {compiler: gcc, version: 13} | |
env: | |
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v5 # Use pip to install latest CMake, & FORD/Jin2For, etc. | |
with: | |
python-version: 3.x | |
- name: Install fypp | |
run: pip install --upgrade fypp ninja | |
- name: Setup Fortran compiler | |
uses: fortran-lang/[email protected] | |
id: setup-fortran | |
with: | |
compiler: ${{ matrix.toolchain.compiler }} | |
version: ${{ matrix.toolchain.version }} | |
# Build and test with built-in BLAS and LAPACK | |
- name: Configure with CMake | |
if: ${{ contains(matrix.build, 'cmake') }} | |
run: >- | |
cmake -Wdev -G Ninja | |
-DCMAKE_BUILD_TYPE=Release | |
-DCMAKE_MAXIMUM_RANK:String=4 | |
-DCMAKE_INSTALL_PREFIX=$PWD/_dist | |
-DFIND_BLAS:STRING=FALSE | |
-S . -B ${{ env.BUILD_DIR }} | |
- name: Build and compile | |
if: ${{ contains(matrix.build, 'cmake') }} | |
run: cmake --build ${{ env.BUILD_DIR }} --parallel | |
- name: catch build fail | |
if: ${{ failure() && contains(matrix.build, 'cmake') }} | |
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1 | |
- name: test | |
if: ${{ contains(matrix.build, 'cmake') }} | |
run: >- | |
ctest | |
--test-dir ${{ env.BUILD_DIR }} | |
--parallel | |
--output-on-failure | |
--no-tests=error | |
- name: Install project | |
if: ${{ contains(matrix.build, 'cmake') }} | |
run: cmake --install ${{ env.BUILD_DIR }} | |
Build-with-MKL: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: | |
- {compiler: intel, version: '2024.1'} | |
build: [cmake] | |
env: | |
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }} | |
APT_PACKAGES: >- | |
intel-oneapi-mkl | |
intel-oneapi-mkl-devel | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v5 # Use pip to install latest CMake, & FORD/Jin2For, etc. | |
with: | |
python-version: 3.x | |
- name: Install fypp | |
run: pip install --upgrade fypp ninja | |
- name: Setup Fortran compiler | |
uses: fortran-lang/[email protected] | |
id: setup-fortran | |
with: | |
compiler: ${{ matrix.toolchain.compiler }} | |
version: ${{ matrix.toolchain.version }} | |
- name: Install Intel oneAPI MKL | |
run: | | |
sudo apt-get install ${APT_PACKAGES} | |
source /opt/intel/oneapi/mkl/latest/env/vars.sh | |
printenv >> $GITHUB_ENV | |
# Build and test with external BLAS and LAPACK (MKL on Ubuntu with Intel compilers) | |
- name: Configure with CMake and MKL | |
run: >- | |
cmake -Wdev -G Ninja | |
-DCMAKE_BUILD_TYPE=Release | |
-DCMAKE_MAXIMUM_RANK:String=4 | |
-DCMAKE_INSTALL_PREFIX=$PWD/_dist | |
-DFIND_BLAS:STRING=TRUE | |
-S . -B build_mkl | |
# -DBLAS_LIBRARIES="/opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_rt.so" | |
# -DLAPACK_LIBRARIES="/opt/intel/oneapi/mkl/latest/lib/intel64/libmkl_rt.so" | |
- name: Build and compile with MKL | |
run: cmake --build build_mkl --parallel | |
- name: catch build fail with MKL | |
if: failure() | |
run: cmake --build build_mkl --verbose --parallel 1 | |
- name: test with MKL | |
run: >- | |
ctest | |
--test-dir build_mkl | |
--parallel | |
--output-on-failure | |
--no-tests=error | |
- name: Install project with MKL | |
run: cmake --install build_mkl |