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 f7ac3a2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmake/ExternalBLASLAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,27 @@ else()
# Try to find OpenBLAS installation on the system
# Warning: This does NOT automatically configure for OpenMP support
if(DEFINED ENV{OPENBLAS_DIR})
message(STATUS "Found OPENBLAS_DIR")
set(OPENBLAS_DIR $ENV{OPENBLAS_DIR})
elseif(DEFINED ENV{OPENBLASROOT})
message(STATUS "Found OPENBLASROOT")
set(OPENBLAS_DIR $ENV{OPENBLASROOT})
elseif(DEFINED ENV{OPENBLAS_ROOT})
message(STATUS "Found OPENBLAS_ROOT")
set(OPENBLAS_DIR $ENV{OPENBLAS_ROOT})
else()
set(OPENBLAS_DIR)
endif()

if(NOT OPENBLAS_DIR STREQUAL "")
# If OpenBLAS was found, prefer it over other vendors
set(BLA_VENDOR "OpenBLAS")
message(STATUS "")
else()
message(STATUS "Found OPENBLAS_ROOT")
endif()

message(STATUS "BLA_VENDOR ${BLA_VENDOR}")
list(APPEND CMAKE_PREFIX_PATH ${OPENBLAS_DIR})
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
Expand Down

0 comments on commit f7ac3a2

Please sign in to comment.