Skip to content

Commit 685b016

Browse files
committed
macos doesn't need openblas
1 parent 4c6bd33 commit 685b016

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ endif()
148148

149149
option(HIPO "Build HIPO" OFF)
150150
message(STATUS "Build HIPO: ${HIPO}")
151+
option(BUILD_OPENBLAS "Build OpenBLAS" ON)
152+
message(STATUS "Build OpenBLAS: ${BUILD_OPENBLAS}")
151153
if (HIPO AND CSHARP)
152154
message(ERROR "HIPO is only available in C++. Not yet supported in C#.")
153155
endif()

cmake/FindHipoDeps.cmake

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
# BLAS
1+
# Fetch OpenBLAS
2+
if (BUILD_OPENBLAS)
3+
include(FetchContent)
4+
set(FETCHCONTENT_QUIET OFF)
5+
set(FETCHCONTENT_UPDATES_DISCONNECTED ON)
6+
set(BUILD_SHARED_LIBS ON)
7+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
8+
set(BUILD_TESTING OFF)
9+
set(CMAKE_Fortran_COMPILER OFF)
10+
11+
message(CHECK_START "Fetching OpenBLAS")
12+
list(APPEND CMAKE_MESSAGE_INDENT " ")
13+
FetchContent_Declare(
14+
openblas
15+
GIT_REPOSITORY "https://github.com/OpenMathLib/OpenBLAS.git"
16+
GIT_TAG "v0.3.30"
17+
GIT_SHALLOW TRUE
18+
UPDATE_COMMAND git reset --hard
19+
)
20+
FetchContent_MakeAvailable(openblas)
21+
list(POP_BACK CMAKE_MESSAGE_INDENT)
22+
message(CHECK_PASS "fetched")
23+
endif()
24+
25+
# Find BLAS
226
set(BLAS_ROOT "" CACHE STRING "Root directory of BLAS or OpenBLAS")
327
if (NOT BLAS_ROOT STREQUAL "")
428
message(STATUS "BLAS_ROOT is " ${BLAS_ROOT})

0 commit comments

Comments
 (0)