Skip to content

Commit 5a05487

Browse files
committed
blas order
1 parent 55aab22 commit 5a05487

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

cmake/FindHipoDeps.cmake

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# BLAS
22
set(BLAS_ROOT "" CACHE STRING "Root directory of BLAS or OpenBLAS")
3-
message(STATUS "BLAS_ROOT is " ${BLAS_ROOT})
3+
if (NOT BLAS_ROOT STREQUAL "")
4+
message(STATUS "BLAS_ROOT is " ${BLAS_ROOT})
5+
endif()
46

57
set(USE_CMAKE_FIND_BLAS ON)
68

@@ -103,12 +105,39 @@ if (NOT USE_CMAKE_FIND_BLAS)
103105
endif()
104106
endif()
105107
else()
106-
find_package(BLAS REQUIRED)
107-
if (BLAS_FOUND)
108-
message(STATUS "Using BLAS library: ${BLAS_LIBRARIES}")
109-
message(STATUS "BLAS include dirs: ${BLAS_INCLUDE_DIRS}")
108+
109+
if (NOT BLA_VENDOR)
110+
if (APPLE)
111+
set (BLA_VENDOR Apple)
112+
elseif(LINUX)
113+
set (BLA_VENDOR OpenBLAS)
114+
elseif(WIN31)
115+
set (BLA_VENDOR OpenBLAS)
116+
endif()
117+
118+
find_package(BLAS QUIET)
119+
if (BLAS_FOUND)
120+
message(STATUS "Using BLAS library: ${BLAS_LIBRARIES}")
121+
if (BLAS_INCLUDE_DIRS)
122+
message(STATUS "BLAS include dirs: ${BLAS_INCLUDE_DIRS}")
123+
endif()
124+
else()
125+
unset(BLA_VENDOR)
126+
endif()
110127
else()
111-
message(FATAL_ERROR "No BLAS library found!")
128+
message(STATUS "Specified BLA_VENDOR: ${BLA_VENDOR}")
129+
endif()
130+
131+
if (NOT BLAS_FOUND)
132+
find_package(BLAS REQUIRED)
133+
if (BLAS_FOUND)
134+
message(STATUS "Using BLAS library: ${BLAS_LIBRARIES}")
135+
if (BLAS_INCLUDE_DIRS)
136+
message(STATUS "BLAS include dirs: ${BLAS_INCLUDE_DIRS}")
137+
endif()
138+
else()
139+
message(FATAL_ERROR "No BLAS library found!")
140+
endif()
112141
endif()
113142
endif()
114143

0 commit comments

Comments
 (0)