fix: add c++ example to macos/linux ci (#86)
This commit is contained in:
parent
2bfeac5034
commit
efc6f3f7ce
|
|
@ -137,3 +137,10 @@ jobs:
|
|||
cd "$CLEAN_WORKSPACE/build"
|
||||
make unittest -j$(nproc)
|
||||
shell: bash
|
||||
|
||||
- name: Run Cpp Examples
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE/examples/c++"
|
||||
mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
make -j 16 && ./db-example && ./core-example && ./ailego-example
|
||||
shell: bash
|
||||
|
|
|
|||
|
|
@ -104,3 +104,10 @@ jobs:
|
|||
cd "$CLEAN_WORKSPACE/build"
|
||||
make unittest -j 16
|
||||
shell: bash
|
||||
|
||||
- name: Run Cpp Examples
|
||||
run: |
|
||||
cd "$CLEAN_WORKSPACE/examples/c++"
|
||||
mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
make -j 16 && ./db-example && ./core-example && ./ailego-example
|
||||
shell: bash
|
||||
|
|
|
|||
|
|
@ -27,10 +27,14 @@ else()
|
|||
endif()
|
||||
|
||||
# --- Dependency groups ---
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
set(zvec_ailego_deps
|
||||
arrow
|
||||
parquet
|
||||
arrow_bundled_dependencies
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${CMAKE_DL_LIBS}
|
||||
)
|
||||
|
||||
set(zvec_core_deps
|
||||
|
|
@ -66,13 +70,17 @@ target_link_libraries(zvec-ailego INTERFACE
|
|||
add_library(zvec-core INTERFACE)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
target_link_libraries(zvec-core INTERFACE
|
||||
"-Wl,--whole-archive,${ZVEC_LIB_DIR}/libzvec_core.a,-Wl,--no-whole-archive"
|
||||
-Wl,--whole-archive
|
||||
zvec_core
|
||||
-Wl,--no-whole-archive
|
||||
-Wl,--start-group
|
||||
zvec-ailego
|
||||
${zvec_core_deps}
|
||||
-Wl,--end-group
|
||||
)
|
||||
elseif(APPLE)
|
||||
target_link_libraries(zvec-core INTERFACE
|
||||
"-Wl,-force_load,${ZVEC_LIB_DIR}/libzvec_core.a"
|
||||
-Wl,-force_load ${ZVEC_LIB_DIR}/libzvec_core.a
|
||||
zvec-ailego
|
||||
${zvec_core_deps}
|
||||
)
|
||||
|
|
@ -82,12 +90,23 @@ endif()
|
|||
|
||||
# zvec_db: links libzvec_db.a + all deps
|
||||
add_library(zvec-db INTERFACE)
|
||||
target_link_libraries(zvec-db INTERFACE
|
||||
zvec_db
|
||||
zvec-core
|
||||
zvec-ailego
|
||||
${zvec_db_deps}
|
||||
)
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
target_link_libraries(zvec-db INTERFACE
|
||||
zvec_db
|
||||
zvec-core
|
||||
zvec-ailego
|
||||
-Wl,--start-group
|
||||
${zvec_db_deps}
|
||||
-Wl,--end-group
|
||||
)
|
||||
elseif(APPLE)
|
||||
target_link_libraries(zvec-db INTERFACE
|
||||
zvec_db
|
||||
zvec-core
|
||||
zvec-ailego
|
||||
${zvec_db_deps}
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
# --- Main executable ---
|
||||
|
|
@ -104,4 +123,4 @@ target_link_libraries(core-example PRIVATE
|
|||
add_executable(ailego-example ailego/main.cc)
|
||||
target_link_libraries(ailego-example PRIVATE
|
||||
zvec-ailego
|
||||
)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <zvec/ailego/math_batch/utils.h>
|
||||
#include "ailego/math/distance_matrix.h"
|
||||
#include "cosine_distance_batch.h"
|
||||
#include "inner_product_distance_batch.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
||||
namespace zvec::ailego {
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@
|
|||
#include <ailego/internal/cpu_features.h>
|
||||
#include <ailego/utility/math_helper.h>
|
||||
#include <zvec/ailego/internal/platform.h>
|
||||
#include <zvec/ailego/math_batch/utils.h>
|
||||
#include <zvec/ailego/utility/type_helper.h>
|
||||
#include "inner_product_distance_batch_impl.h"
|
||||
#include "inner_product_distance_batch_impl_fp16.h"
|
||||
#include "inner_product_distance_batch_impl_int8.h"
|
||||
#include "utils.h"
|
||||
|
||||
namespace zvec::ailego::DistanceBatch {
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
namespace zvec::ailego::DistanceBatch {
|
||||
|
||||
typedef void (*DistanceBatchQueryPreprocessFunc)(void *query, size_t dim);
|
||||
|
|
@ -14,8 +14,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <ailego/math_batch/utils.h>
|
||||
#include <zvec/ailego/container/params.h>
|
||||
#include <zvec/ailego/math_batch/utils.h>
|
||||
#include <zvec/core/framework/index_error.h>
|
||||
#include <zvec/core/framework/index_meta.h>
|
||||
#include <zvec/core/framework/index_module.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue