diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 85e4a45ba..4a6dd07e2 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -84,7 +84,7 @@ jobs: export FC=gfortran-12 fi if [[ "${{ matrix.math-libs }}" == 'openblas' ]]; then - export OPENBLAS_DIR=/usr/local/opt/openblas + export OPENBLAS_DIR=/opt/homebrew/opt/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..1d8ed7fc4 100644 --- a/cmake/ExternalBLASLAPACK.cmake +++ b/cmake/ExternalBLASLAPACK.cmake @@ -163,6 +163,13 @@ else() else() set(OPENBLAS_DIR) 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)