Skip to content

Commit 106faaf

Browse files
authored
cmake : add finding the OpenBLAS header file (#992)
1 parent c85e03d commit 106faaf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,21 @@ if (LLAMA_OPENBLAS)
120120
add_compile_definitions(GGML_USE_OPENBLAS)
121121
add_link_options(${BLAS_LIBRARIES})
122122
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} openblas)
123+
124+
# find header file
125+
set(OPENBLAS_INCLUDE_SEARCH_PATHS
126+
/usr/include
127+
/usr/include/openblas
128+
/usr/include/openblas-base
129+
/usr/local/include
130+
/usr/local/include/openblas
131+
/usr/local/include/openblas-base
132+
/opt/OpenBLAS/include
133+
$ENV{OpenBLAS_HOME}
134+
$ENV{OpenBLAS_HOME}/include
135+
)
136+
find_path(OPENBLAS_INC NAMES cblas.h PATHS ${OPENBLAS_INCLUDE_SEARCH_PATHS})
137+
add_compile_options(-I${OPENBLAS_INC})
123138
else()
124139
message(WARNING "OpenBLAS not found")
125140
endif()

0 commit comments

Comments
 (0)