Skip to content

Commit

Permalink
Fix build error (#979)
Browse files Browse the repository at this point in the history
Signed-off-by: Cai Yudong <[email protected]>
  • Loading branch information
cydrain authored Dec 10, 2024
1 parent 6931d0f commit 0c9f118
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cmake/libs/libfaiss.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()

0 comments on commit 0c9f118

Please sign in to comment.