diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index b8b20af91..d0392e152 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -43,7 +43,7 @@ jobs: with-solver: strumpack with-eigensolver: slepc - runs-on: macos-latest-xl + runs-on: macos-latest-xlarge steps: - uses: actions/checkout@v4 with: @@ -53,6 +53,10 @@ jobs: run: | brew install pkg-config + - uses: julia-actions/setup-julia@v2 + with: + version: '1' + - name: Configure Open MPI if: matrix.mpi == 'openmpi' run: | @@ -84,7 +88,7 @@ jobs: export FC=gfortran-12 fi if [[ "${{ matrix.math-libs }}" == 'openblas' ]]; then - export OPENBLAS_DIR=/usr/local/opt/openblas + export OPENBLAS_DIR=$(brew --prefix openblas) fi export NUM_PROC_BUILD=$(nproc 2> /dev/null || sysctl -n hw.ncpu) if [[ "$NUM_PROC_BUILD" -gt "$NUM_PROC_BUILD_MAX" ]]; then diff --git a/cmake/ExternalBLASLAPACK.cmake b/cmake/ExternalBLASLAPACK.cmake index 3860f95b2..6c190e565 100644 --- a/cmake/ExternalBLASLAPACK.cmake +++ b/cmake/ExternalBLASLAPACK.cmake @@ -162,7 +162,15 @@ else() set(OPENBLAS_DIR $ENV{OPENBLAS_ROOT}) else() set(OPENBLAS_DIR) + message(STATUS "Using BLAS/LAPACK located by CMake") endif() + + if(NOT OPENBLAS_DIR STREQUAL "") + # If OpenBLAS was found set the vendor to avoid conflict with Accelerate on Darwin + set(BLA_VENDOR "OpenBLAS") + message(STATUS "Using BLAS/LAPACK from OpenBLAS") + endif() + list(APPEND CMAKE_PREFIX_PATH ${OPENBLAS_DIR}) find_package(BLAS REQUIRED) find_package(LAPACK REQUIRED) @@ -181,7 +189,6 @@ else() PATH_SUFFIXES include include/openblas REQUIRED ) - message(STATUS "Using BLAS/LAPACK located by CMake") endif() # Save variables to cache diff --git a/cmake/ExternalHYPRE.cmake b/cmake/ExternalHYPRE.cmake index 1e2d74090..58fa47d55 100644 --- a/cmake/ExternalHYPRE.cmake +++ b/cmake/ExternalHYPRE.cmake @@ -44,7 +44,7 @@ if(NOT CMAKE_C_COMPILER STREQUAL MPI_C_COMPILER) set(HYPRE_CXXFLAGS "${HYPRE_CXXFLAGS} -I${INCLUDE_DIR}") endforeach() string(REPLACE ";" " " HYPRE_MPI_LIBRARIES "${MPI_C_LIBRARIES}") - set(HYPRE_LDFLAGS "${HYPRE_LDFLAGS} ${HYPRE_MPI_LIBRARIES}") + set(HYPRE_LDFLAGS "${HYPRE_LDFLAGS} ${HYPRE_MPI_LIBRARIES} -lm") endif() # Use Autotools build instead of CMake for HIP support