Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for android #959

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ find_package(prometheus-cpp REQUIRED)
if(NOT WITH_RAFT)
find_package(fmt REQUIRED)
endif()
find_package(opentelemetry-cpp REQUIRED)

if(NOT WITH_LIGHT)
find_package(opentelemetry-cpp REQUIRED)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to wrap all prometheus usage in Knowhere code?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Milvus Lite maintains a patch to remove the related code.

endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_OSX_DEPLOYMENT_TARGET
"10.15"
Expand Down
15 changes: 9 additions & 6 deletions cmake/libs/libfaiss.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ if(__PPC64)
target_link_libraries(knowhere_utils PUBLIC glog::glog)
endif()

find_package(LAPACK REQUIRED)

if(LINUX)
set(BLA_VENDOR OpenBLAS)
Expand All @@ -70,8 +69,12 @@ if(APPLE)
set(BLA_VENDOR Apple)
endif()

find_package(BLAS REQUIRED)

if(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
find_package(OpenBLAS REQUIRED)
set(BLAS_LIBRARIES OpenBLAS::OpenBLAS)
else()
find_package(BLAS REQUIRED)
endif()
if(__X86_64)
list(REMOVE_ITEM FAISS_SRCS ${FAISS_AVX2_SRCS})

Expand Down Expand Up @@ -110,7 +113,7 @@ if(__X86_64)
-Wno-unused-function
-Wno-strict-aliasing>)
target_link_libraries(
faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES}
faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES}
faiss_avx2 faiss_avx512 knowhere_utils)
target_compile_definitions(faiss PRIVATE FINTEGER=int)
endif()
Expand All @@ -133,7 +136,7 @@ if(__AARCH64)

add_dependencies(faiss knowhere_utils)
target_link_libraries(faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES}
${LAPACK_LIBRARIES} knowhere_utils)
knowhere_utils)
target_compile_definitions(faiss PRIVATE FINTEGER=int)
endif()

Expand All @@ -160,6 +163,6 @@ if(__PPC64)

add_dependencies(faiss knowhere_utils)
target_link_libraries(faiss PUBLIC OpenMP::OpenMP_CXX ${BLAS_LIBRARIES}
${LAPACK_LIBRARIES} knowhere_utils)
knowhere_utils)
target_compile_definitions(faiss PRIVATE FINTEGER=int)
endif()
7 changes: 6 additions & 1 deletion cmake/utils/platform_check.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ macro(detect_target_arch)
endif()
endmacro()

detect_target_arch()

if(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(__AARCH64 1)
else()
detect_target_arch()
endif()
Loading