Skip to content

Commit

Permalink
CI: Disable building with OpenMP on Apple Silicon
Browse files Browse the repository at this point in the history
Building with OpenMP causes some test failures for macOS on Apple
Silicon, see:
ElmerCSC#634 (comment)
The affected tests currently are: `H1BasisEvaluation` and
`SD_H1BasisEvaluation`.

For the time being, disable building with OpenMP on Apple Silicon in CI.

OpenMP is needed as a transitional build dependency of the SuiteSparse
package from Homebrew. So, also disable building with CHOLMOD.

Note that the tests with OpenMP fail for optimization level `-O3` but
succeed with `-O2`.
  • Loading branch information
mmuetzel committed Jan 27, 2025
1 parent 67e23c6 commit 608008c
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/build-macos-homebrew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,28 @@ jobs:

runs-on: ${{ matrix.os }}

name: ${{ matrix.os }} (${{ matrix.openmp }} OpenMP)

strategy:
# Allow other runners in the matrix to continue if some fail
fail-fast: false

matrix:
os: [macos-14, macos-13]
os: [macos-14]
openmp: [without]
# Building with OpenMP causes some test failures on macOS on Apple
# Silicon.
# The affected tests currently are: H1BasisEvaluation and
# SD_H1BasisEvaluation.
# For the time being, disable building with OpenMP in CI on Apple
# Silicon.
# OpenMP is also needed as a transitional build dependency of the
# SuiteSparse package from Homebrew.
# FIXME: Consider building with OpenMP again when this (potentially
# upstream) issue has been fixed.
include:
- os: macos-13
openmp: with

steps:
- name: get CPU information
Expand All @@ -49,13 +65,14 @@ jobs:
brew install --overwrite python@3.12 python@3.13
brew reinstall gcc
brew install \
cmake libomp openblas open-mpi suitesparse \
cmake openblas open-mpi \
${{ matrix.openmp == 'with' && 'libomp suitesparse' || '' }} \
qwt vtk opencascade
echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
- name: configure
env:
LDFLAGS: -L${{ env.HOMEBREW_PREFIX }}/opt/libomp/lib -lomp
LDFLAGS: ${{ matrix.openmp == 'with' && '-L${{ env.HOMEBREW_PREFIX }}/opt/libomp/lib -lomp' || '' }}
run: |
mkdir ${GITHUB_WORKSPACE}/build
cd ${GITHUB_WORKSPACE}/build
Expand All @@ -66,17 +83,19 @@ jobs:
-DCMAKE_Fortran_COMPILER=gfortran \
-DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}/usr" \
-DBLA_VENDOR="OpenBLAS" \
-DCMAKE_PREFIX_PATH="${HOMEBREW_PREFIX}/opt/libomp;${HOMEBREW_PREFIX}/opt/openblas;${HOMEBREW_PREFIX}/opt/qt;${HOMEBREW_PREFIX}/opt/qwt" \
-DWITH_OpenMP=ON \
-DOpenMP_C_FLAGS="-Xclang -fopenmp -I${HOMEBREW_PREFIX}/opt/libomp/include" \
-DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I${HOMEBREW_PREFIX}/opt/libomp/include" \
-DOpenMP_Fortran_FLAGS="-fopenmp -I${HOMEBREW_PREFIX}/opt/libomp/include" \
-DCMAKE_PREFIX_PATH="$( [ "${{ matrix.openmp }}" == "with" ] && echo "${HOMEBREW_PREFIX}/opt/libomp;")${HOMEBREW_PREFIX}/opt/openblas;${HOMEBREW_PREFIX}/opt/qt;${HOMEBREW_PREFIX}/opt/qwt" \
${{ matrix.openmp == 'with' \
&& '-DWITH_OpenMP=ON \
-DOpenMP_C_FLAGS="-Xclang -fopenmp -I${HOMEBREW_PREFIX}/opt/libomp/include" \
-DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I${HOMEBREW_PREFIX}/opt/libomp/include" \
-DOpenMP_Fortran_FLAGS="-fopenmp -I${HOMEBREW_PREFIX}/opt/libomp/include"' \
|| '-DWITH_OpenMP=OFF' }} \
-DWITH_LUA=ON \
-DWITH_MPI=ON \
-DMPI_TEST_MAXPROC=2 \
-DWITH_Zoltan=OFF \
-DWITH_Mumps=OFF \
-DWITH_CHOLMOD=ON \
$([ "${{ matrix.openmp }}" == "with" ] && echo "-DWITH_CHOLMOD=ON" || echo "-DWITH_CHOLMOD=OFF") \
-DWITH_ElmerIce=ON \
-DWITH_ELMERGUI=ON \
-DWITH_QT6=ON \
Expand Down

0 comments on commit 608008c

Please sign in to comment.