Skip to content

Commit

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

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

The flags that are necessary to build with OpenMP using Homebrew on macOS
are left intact. So, it should be easy to enable runners with OpenMP in
case this issue will be fixed.

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 de25ea8
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/build-macos-homebrew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,24 @@ 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]
openmp: [without]
# Building with OpenMP causes some test failures on macOS.
# The affected tests currently are: H1BasisEvaluation,
# SD_H1BasisEvaluation, and pointload2.
# For the time being, disable building with OpenMP in CI.
# FIXME: Consider building with OpenMP when this (potentially
# upstrean) issue has been fixed.
# include:
# - os: macos-14
# openmp: with

steps:
- name: get CPU information
Expand All @@ -49,7 +61,9 @@ jobs:
brew install --overwrite python@3.12 python@3.13
brew reinstall gcc
brew install \
cmake libomp openblas open-mpi suitesparse \
cmake \
$([ "${{ matrix.openmp }}" == "with" ] && echo "libomp") \
openblas open-mpi suitesparse \
qwt vtk opencascade
echo "HOMEBREW_PREFIX=$(brew --prefix)" >> $GITHUB_ENV
Expand All @@ -66,11 +80,12 @@ 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" ] && \
echo "-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_LUA=ON \
-DWITH_MPI=ON \
-DMPI_TEST_MAXPROC=2 \
Expand Down

0 comments on commit de25ea8

Please sign in to comment.