Skip to content

Commit 23e499b

Browse files
committed
Merge branch 'hipo-tt' into hipo-tt-j
2 parents 20115bf + 1144add commit 23e499b

File tree

2 files changed

+29
-16
lines changed

2 files changed

+29
-16
lines changed

cmake/FindHipoDeps.cmake

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,30 @@ elseif(NOT APPLE)
1111
# If a BLAS install was specified try to use it first.
1212
if (NOT (BLAS_ROOT STREQUAL ""))
1313
message(STATUS "Looking for blas CMake targets file in " ${BLAS_ROOT})
14-
find_package(OpenBLAS CONFIG NO_DEFAULT_PATH)
15-
else()
16-
find_package(OpenBLAS CONFIG)
14+
15+
find_library(OPENBLAS_LIB
16+
NAMES openblas
17+
HINTS "${BLAS_ROOT}/lib"
18+
NO_DEFAULT_PATH)
19+
20+
if(OPENBLAS_LIB)
21+
message("Found OpenBLAS library at ${OPENBLAS_LIB}")
22+
else()
23+
find_library(BLAS_LIB
24+
NAMES blas
25+
HINTS "${BLAS_ROOT}/lib"
26+
NO_DEFAULT_PATH)
27+
28+
if(BLAS_LIB)
29+
message("Found BLAS library at ${BLAS_LIB}")
30+
else()
31+
message("Did not find blas library at ${BLAS_ROOT}")
32+
message("Attempting default locations search")
33+
endif()
34+
endif()
1735
endif()
36+
if ((BLAS_ROOT STREQUAL "") OR (NOT OPENBLAS_LIB AND NOT BLAS_LIB))
1837

19-
if(OpenBLAS_FOUND)
20-
message(STATUS "OpenBLAS CMake config path: ${OpenBLAS_DIR}")
21-
else()
2238
find_library(OPENBLAS_LIB
2339
NAMES openblas
2440
HINTS "${BLAS_ROOT}/lib")
@@ -27,8 +43,8 @@ elseif(NOT APPLE)
2743
message("Found OpenBLAS library at ${OPENBLAS_LIB}")
2844
else()
2945
find_library(BLAS_LIB
30-
NAMES blas HINTS
31-
"${BLAS_ROOT}/lib")
46+
NAMES blas
47+
HINTS "${BLAS_ROOT}/lib")
3248

3349
if(BLAS_LIB)
3450
message("Found BLAS library at ${BLAS_LIB}")

highs/CMakeLists.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,20 +192,17 @@ else()
192192
elseif(WIN32)
193193
target_link_libraries(highs OpenBLAS::OpenBLAS)
194194
target_compile_definitions(highs PRIVATE HIPO_USES_OPENBLAS)
195-
else()
195+
else()
196196
# LINUX
197-
if(OpenBLAS_FOUND)
198-
target_link_libraries(highs OpenBLAS::OpenBLAS)
199-
target_compile_definitions(highs PRIVATE HIPO_USES_OPENBLAS)
197+
if(BLAS_LIB)
198+
target_link_libraries(highs "${BLAS_LIB}")
200199
elseif(OPENBLAS_LIB)
201200
target_link_libraries(highs "${OPENBLAS_LIB}")
202201
target_compile_definitions(highs PRIVATE HIPO_USES_OPENBLAS)
203-
elseif(BLAS_LIB)
204-
target_link_libraries(highs "${BLAS_LIB}")
205202
else()
206203
message(FATAL_ERROR "No BLAS library available")
207-
endif()
208-
endif()
204+
endif(BLAS_LIB)
205+
endif(APPLE)
209206

210207
if(metis_FOUND)
211208
target_link_libraries(highs metis)

0 commit comments

Comments
 (0)