make : find include dir for OpenBLAS header file
This commit is contained in:
parent
4de0334f5c
commit
9a2f20362f
1 changed files with 20 additions and 0 deletions
|
@ -167,6 +167,26 @@ if (LLAMA_BLAS)
|
||||||
add_compile_definitions(GGML_USE_OPENBLAS)
|
add_compile_definitions(GGML_USE_OPENBLAS)
|
||||||
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ${BLAS_LIBRARIES})
|
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ${BLAS_LIBRARIES})
|
||||||
|
|
||||||
|
# check include dir
|
||||||
|
if (NOT BLAS_INCLUDE_DIRS)
|
||||||
|
# find header file
|
||||||
|
set(BLAS_INCLUDE_SEARCH_PATHS
|
||||||
|
/usr/include
|
||||||
|
/usr/include/openblas
|
||||||
|
/usr/include/openblas-base
|
||||||
|
/usr/local/include
|
||||||
|
/usr/local/include/openblas
|
||||||
|
/usr/local/include/openblas-base
|
||||||
|
/opt/OpenBLAS/include
|
||||||
|
$ENV{OpenBLAS_HOME}
|
||||||
|
$ENV{OpenBLAS_HOME}/include
|
||||||
|
)
|
||||||
|
find_path(BLAS_INC NAMES cblas.h PATHS ${BLAS_INCLUDE_SEARCH_PATHS})
|
||||||
|
add_compile_options(-I${BLAS_INC})
|
||||||
|
set(BLAS_INCLUDE_DIRS ${BLAS_INC})
|
||||||
|
message(STATUS "Found header file in ${BLAS_INC}")
|
||||||
|
endif()
|
||||||
|
|
||||||
message("${BLAS_LIBRARIES} ${BLAS_INCLUDE_DIRS}")
|
message("${BLAS_LIBRARIES} ${BLAS_INCLUDE_DIRS}")
|
||||||
include_directories(${BLAS_INCLUDE_DIRS})
|
include_directories(${BLAS_INCLUDE_DIRS})
|
||||||
else()
|
else()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue