Skip to content

Commit

Permalink
Prefer OpenBLAS over other non-handled vendors
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcars committed Nov 14, 2024
1 parent d4cd5c9 commit b888d6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions cmake/ExternalBLASLAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b888d6d

Please sign in to comment.