milvus-io / milvus-sdk-cpp

C++ SDK for Milvus 2.0
Apache License 2.0
40 stars 21 forks source link

执行cmake的时候hang住 #242

Open Lowpower opened 1 year ago

Lowpower commented 1 year ago

如图:

image

uname -a如下 5.15.0-1035-raspi #38-Ubuntu SMP PREEMPT aarch64 aarch64 aarch64 GNU/Linux

matrixji commented 1 year ago

在下载依赖grpc,需要科学上网+耐心等待。 It's fetching the grpc from github which may require a proxy and wait for a long time.

Lowpower commented 1 year ago

grpc能否加到install_deps.sh里呢?

matrixji commented 1 year ago

grpc能否加到install_deps.sh里呢? 你可以尝试: 手动编译安装grpc, cmake 的时候 cmake -DMILVUS_WITH_GRPC=package

目前下面这些包都是可以尝试使用系统的(默认是从Github下载编译)

define_option_string(MILVUS_WITH_GRPC           "Using gRPC from"       "module" "package" "module")
define_option_string(MILVUS_WITH_ZLIB           "Using Zlib from"       "module" "package" "module")
define_option_string(MILVUS_WITH_NLOHMANN_JSON  "nlohmann json from"    "module" "package" "module")
define_option_string(MILVUS_WITH_GTEST          "Using GTest from"      "module" "package" "module")
Lowpower commented 1 year ago

function milvus::MilvusClientImpl::CreateCollection(milvus::CollectionSchema const&)::{lambda()#1}::operator()() const: error: undefined reference to 'google::protobuf::internal::ArenaStringPtr::Set(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::Arena*)' 应用程序链接libmilvus_sdk.a的时候报这个错误,是不是编译的.a有问题?

matrixji commented 1 year ago

.a 只是一个archive,并不解决相关依赖。所以还是需要链接上 grpc等依赖库。

dingjianfei commented 1 year ago

麻烦能写一个事例教程吗?make install 之后也引入grpc依赖库,依然报错。 format_request.cc:(.text+0xb76): undefined reference to absl::lts_20220623::StrAppend(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, absl::lts_20220623::AlphaNum const&)' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(format_request.cc.o): in functiongrpc_httpcli_format_put_request(grpc_http_request const, char const, char const)': format_request.cc:(.text+0xfe0): undefined reference to `absl::lts_20220623::StrAppend(std::__cxx11::basic_string<char, std::char_traits, std::allocator >, absl::lts_20220623::AlphaNum const&)' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(socket_factory_posix.cc.o): in function grpc_socket_factory_init(grpc_socket_factory*, grpc_socket_factory_vtable const*)': socket_factory_posix.cc:(.text+0x30): undefined reference togpr_ref_init' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(socket_factory_posix.cc.o): in function grpc_socket_factory_ref(grpc_socket_factory*)': socket_factory_posix.cc:(.text+0x141): undefined reference togpr_ref' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(socket_factory_posix.cc.o): in function grpc_socket_factory_unref(grpc_socket_factory*)': socket_factory_posix.cc:(.text+0x167): undefined reference togpr_unref' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(alts_counter.cc.o): in function maybe_copy_error_msg(char const*, char**)': alts_counter.cc:(.text+0x36): undefined reference togpr_malloc' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(alts_counter.cc.o): in function alts_counter_create(bool, unsigned long, unsigned long, alts_counter**, char**)': alts_counter.cc:(.text+0x1a3): undefined reference togpr_malloc' /usr/bin/ld: alts_counter.cc:(.text+0x1da): undefined reference to gpr_zalloc' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(alts_counter.cc.o): in functionalts_counter_destroy(alts_counter)': alts_counter.cc:(.text+0x3db): undefined reference to gpr_free' /usr/bin/ld: alts_counter.cc:(.text+0x3e7): undefined reference togpr_free' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(alts_crypter.cc.o): in function `maybe_copy_error_msg(char const, char)': alts_crypter.cc:(.text+0x36): undefined reference to gpr_malloc' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(alts_crypter.cc.o): in functionalts_crypter_destroy(alts_crypter)': alts_crypter.cc:(.text+0x22e): undefined reference to gpr_free' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(alts_record_protocol_crypter_common.cc.o): in functionmaybe_copy_error_msg(char const, char)': alts_record_protocol_crypter_common.cc:(.text+0x36): undefined reference to gpr_malloc' /usr/bin/ld: ../third_party//grpc_install/lib/libgrpc.a(alts_record_protocol_crypter_common.cc.o): in functionalts_crypter_create_common(gsec_aead_crypter, bool, unsigned long, char)': alts_record_protocol_crypter_common.cc:(.text+0x338): undefined reference to `gpr_malloc' collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/milvus_test_code.dir/build.make:171: milvus_test_code] Error 1 make[1]: [CMakeFiles/Makefile2:78: CMakeFiles/milvus_test_code.dir/all] Error 2 make: [Makefile:84: all] Error 2

dingjianfei commented 1 year ago

通过cmake -DCMAKE_INSTALL_PREFIX 指定路径,能把所有的依赖环境都make install到指定目录吗?现在这样,编译出来的依赖库,太难用了!

matrixji commented 10 months ago

240 add an install, then make install should be right now supported.