Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
Fix mac build error (#98)
Browse files Browse the repository at this point in the history
Co-authored-by: CaiYudong <[email protected]>
  • Loading branch information
cydrain and CaiYudong authored Mar 18, 2022
1 parent 7e2d03f commit 51207f2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ut.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ jobs:
./scripts/install_deps.sh
- name: Run Unittest
run: |
./build.sh -t Release -u && output/unittest/faiss_test && output/unittest/test_knowhere
./build.sh -t Release -u
if [[ -f "output/unittest/faiss_test" ]]; then
./output/unittest/faiss_test
fi
./output/unittest/test_knowhere
2 changes: 1 addition & 1 deletion knowhere/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ if (MACOS)
)
endif ()

target_link_libraries(knowhere pthread)
target_link_libraries(knowhere pthread knowhere_utils)
set(KNOWHERE_INCLUDE_DIRS ${KNOWHERE_SOURCE_DIR})
endif()

Expand Down
2 changes: 1 addition & 1 deletion unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ set( ALL_INDEXING_SRCS
${UTIL_SRCS}
test_bruteforce.cpp
test_common.cpp
test_customized_index.cpp
test_structured_index_sort.cpp
test_structured_index_flat.cpp
)
Expand All @@ -139,6 +138,7 @@ if ( LINUX )
test_annoy.cpp
test_binaryidmap.cpp
test_binaryivf.cpp
test_customized_index.cpp
test_hnsw.cpp
test_idmap.cpp
test_instructionset.cpp
Expand Down
4 changes: 4 additions & 0 deletions unittest/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@

#include "knowhere/common/Dataset.h"
#include "knowhere/common/Log.h"
#ifdef __linux__
#include "faiss/FaissHook.h"
#endif

class DataGen {
public:
DataGen() {
std::string cpu_flag;
#ifdef __linux__
faiss::hook_init(cpu_flag);
#endif
}

protected:
Expand Down

0 comments on commit 51207f2

Please sign in to comment.