From 0c9f1182f3b312e23d42984835a14bfa0313f6de Mon Sep 17 00:00:00 2001 From: Cai Yudong Date: Tue, 10 Dec 2024 17:02:35 +0800 Subject: [PATCH] Fix build error (#979) Signed-off-by: Cai Yudong --- cmake/libs/libfaiss.cmake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmake/libs/libfaiss.cmake b/cmake/libs/libfaiss.cmake index 18446f1de..1e99fc6ac 100644 --- a/cmake/libs/libfaiss.cmake +++ b/cmake/libs/libfaiss.cmake @@ -70,11 +70,13 @@ if(APPLE) endif() if(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64") - find_package(OpenBLAS REQUIRED) - set(BLAS_LIBRARIES OpenBLAS::OpenBLAS) + find_package(OpenBLAS REQUIRED) + set(BLAS_LIBRARIES OpenBLAS::OpenBLAS) else() - find_package(BLAS REQUIRED) + find_package(LAPACK REQUIRED) + find_package(BLAS REQUIRED) endif() + if(__X86_64) list(REMOVE_ITEM FAISS_SRCS ${FAISS_AVX2_SRCS}) @@ -113,7 +115,7 @@ if(__X86_64) -Wno-unused-function -Wno-strict-aliasing>) target_link_libraries( - faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} + faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} faiss_avx2 faiss_avx512 knowhere_utils) target_compile_definitions(faiss PRIVATE FINTEGER=int) endif() @@ -135,7 +137,7 @@ if(__AARCH64) -Wno-strict-aliasing>) add_dependencies(faiss knowhere_utils) - target_link_libraries(faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} + target_link_libraries(faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} knowhere_utils) target_compile_definitions(faiss PRIVATE FINTEGER=int) endif() @@ -162,7 +164,7 @@ if(__PPC64) -Wno-strict-aliasing>) add_dependencies(faiss knowhere_utils) - target_link_libraries(faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} + target_link_libraries(faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} knowhere_utils) target_compile_definitions(faiss PRIVATE FINTEGER=int) endif()