Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add findBLAS support to CMakeLists.txt #844

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Parallel CI construction to reduce CI time
  • Loading branch information
zoziha committed Jul 12, 2024
commit 0534325d683e5ef3cab4c62a1f58e57d21cb45c1
45 changes: 36 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -33,9 +33,6 @@ jobs:
build: cmake-inline
toolchain:
- {compiler: gcc, version: 10}
APT_PACKAGES: >-
intel-oneapi-mkl-2024.1.0
intel-oneapi-mkl-devel-2024.1.0
exclude:
- os: macos-12
toolchain: {compiler: intel, version: '2024.1'}
@@ -62,7 +59,8 @@ jobs:
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: >-
@@ -94,9 +92,41 @@ jobs:
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'}
include:
- APT_PACKAGES: >-
intel-oneapi-mkl-2024.1.0
intel-oneapi-mkl-devel-2024.1.0
build: [cmake]
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/setup-fortran@v1.6.1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

# Build and test with external BLAS and LAPACK (MKL on Ubuntu with Intel compilers)
- name: Configure with CMake and MKL
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
run: >-
cmake -Wdev -G Ninja
-DCMAKE_BUILD_TYPE=Release
@@ -107,15 +137,13 @@ jobs:
-S . -B build_mkl

- name: Build and compile with MKL
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
run: cmake --build build_mkl --parallel

- name: catch build fail with MKL
if: ${{ failure() && contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
if: failure()
run: cmake --build build_mkl --verbose --parallel 1

- name: test with MKL
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
run: >-
ctest
--test-dir build_mkl
@@ -124,5 +152,4 @@ jobs:
--no-tests=error

- name: Install project with MKL
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
run: cmake --install build_mkl
61 changes: 52 additions & 9 deletions .github/workflows/ci_windows.yml
Original file line number Diff line number Diff line change
@@ -38,7 +38,6 @@ jobs:
mingw-w64-${{ matrix.arch }}-python-setuptools
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-ninja
mingw-w64-${{ matrix.arch }}-openblas

- name: Setup msys POSIX environment
uses: msys2/setup-msys2@v2
@@ -57,8 +56,8 @@ jobs:

- name: Install fypp
run: pip install fypp

# Build and test with build-in BLAS and LAPACK
# Build and test with built-in BLAS and LAPACK
- run: >-
PATH=$PATH:/mingw64/bin/ cmake
-Wdev
@@ -92,9 +91,56 @@ jobs:
- name: Install project
run: PATH=$PATH:/mingw64/bin/ cmake --install build

msys2-build-with-OpenBLAS:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include: [
{ msystem: MINGW64, arch: x86_64 }
]
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v2

- name: Setup MinGW native environment
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: false
install: >-
git
mingw-w64-${{ matrix.arch }}-gcc
mingw-w64-${{ matrix.arch }}-gcc-fortran
mingw-w64-${{ matrix.arch }}-python
mingw-w64-${{ matrix.arch }}-python-pip
mingw-w64-${{ matrix.arch }}-python-setuptools
mingw-w64-${{ matrix.arch }}-cmake
mingw-w64-${{ matrix.arch }}-ninja
mingw-w64-${{ matrix.arch }}-openblas

- name: Setup msys POSIX environment
uses: msys2/setup-msys2@v2
if: contains(matrix.msystem, 'MSYS')
with:
msystem: MSYS
update: false
install: >-
git
mingw-w64-x86_64-gcc
mingw-w64-x86_64-gcc-fortran
python
python-pip
cmake
ninja

- name: Install fypp
run: pip install fypp

# Build and test with external BLAS and LAPACK (OpenBLAS on MINGW64)
- name: Configure with CMake and OpenBLAS
if: contains(matrix.msystem, 'MINGW64')
run: >-
PATH=$PATH:/mingw64/bin/ cmake
-Wdev
@@ -110,23 +156,20 @@ jobs:
CXX: g++

- name: CMake build with OpenBLAS
if: contains(matrix.msystem, 'MINGW64')
run: PATH=$PATH:/mingw64/bin/ cmake --build build_openblas --parallel

- name: catch build fail
if: contains(matrix.msystem, 'MINGW64') && failure()
if: failure()
run: PATH=$PATH:/mingw64/bin/ cmake --build build_openblas --verbose --parallel 1

- name: CTest with OpenBLAS
if: contains(matrix.msystem, 'MINGW64')
run: PATH=$PATH:/mingw64/bin/ ctest --test-dir build_openblas --output-on-failure --parallel -V -LE quadruple_precision

- uses: actions/upload-artifact@v1
if: contains(matrix.msystem, 'MINGW64') && failure()
if: failure()
with:
name: WindowsCMakeTestlog_openblas
path: build_openblas/Testing/Temporary/LastTest.log

- name: Install project with OpenBLAS
if: contains(matrix.msystem, 'MINGW64')
run: PATH=$PATH:/mingw64/bin/ cmake --install build_openblas