#cmake #grpc #rocksdb
#cmake #grpc #rocksdb
Вопрос:
Я пытаюсь использовать gRPC непосредственно в исходном коде rocksdb
LogAndApplyClient log_and_apply_client(grpc::CreateChannel(
secondary, grpc::InsecureChannelCredentials()));
log_and_apply_client — это в основном класс, который я написал, используемый для выполнения вызовов rpc, и он зависит от кода-заглушки, сгенерированного Protobuf. И я добавляю его непосредственно в исходный код rocksdb.
Чтобы устранить зависимость от grpc, я добавляю зависимость в базу данных rocksdb CMakeLists.txt файл с использованием примера CMakeLists, предоставленного gRPC. Я установил gRPC и protobuf в Ubuntu18.04, и это то, что я добавил в CMakeLists rocksdb. Это в основном находит установку grpc и protobuf
# This branch assumes that gRPC and all its dependencies are already installed # on this system, so they can be located by find_package(). # Find Protobuf installation # Looks for protobuf-config.cmake file installed by Protobuf's cmake installation. set(protobuf_MODULE_COMPATIBLE TRUE) find_package(Protobuf CONFIG REQUIRED) message(STATUS "Using protobuf ${Protobuf_VERSION}") set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) set(_REFLECTION gRPC::grpc _reflection) if(CMAKE_CROSSCOMPILING) find_program(_PROTOBUF_PROTOC protoc) else() set(_PROTOBUF_PROTOC
lt;TARGET_FILE:protobuf::protoc>)
endif()# Find gRPC installation
# Looks for gRPCConfig.cmake file installed by gRPC's cmake installation.
find_package(gRPC CONFIG REQUIRED)
message(STATUS "Using gRPC ${gRPC_VERSION}")set(_GRPC_GRPCPP gRPC::grpc )
if(CMAKE_CROSSCOMPILING)
find_program(_GRPC_CPP_PLUGIN_EXECUTABLE grpc_cpp_plugin)
else()
set(_GRPC_CPP_PLUGIN_EXECUTABLElt;TARGET_FILE:gRPC::grpc_cpp_plugin>)
endif()
Связывание базы данных rocksdb с grpc, protobufadd_library(${ROCKSDB_STATIC_LIB} STATIC ${SOURCES}) target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE ${THIRDPARTY_LIBS} ${SYSTEM_LIBS} ${_REFLECTION} ${_GRPC_GRPCPP} ${_PROTOBUF_LIBPROTOBUF} )
Rocksdb отлично компилируется без ошибок, но когда я пытаюсь использовать скомпилированную библиотеку rocksdb, она выдает мне кучу неопределенных ссылок.
mnt/sdb/my_rocksdb/librocksdb.a(version_set.cc.o): In function `__static_initialization_and_destruction_0(int, int)': /mnt/sdb/my_rocksdb/db/version_set.cc:4325: undefined reference to `grpc::InsecureChannelCredentials()' /mnt/sdb/my_rocksdb/db/version_set.cc:4324: undefined reference to `grpc::CreateChannel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > constamp;, std::shared_ptr<grpc::ChannelCredentials> constamp;)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::_InternalParse(char const*, google::protobuf::internal::ParseContext*)': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:468: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:497: undefined reference to `google::protobuf::UnknownFieldSet::default_instance()' /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:497: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet constamp;, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::ByteSizeLong() const': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:519: undefined reference to `google::protobuf::internal::ComputeUnknownFieldsSize(google::protobuf::internal::InternalMetadata constamp;, unsigned long, google::protobuf::internal::CachedSize*)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::MergeFrom(google::protobuf::Message constamp;)': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:534: undefined reference to `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message constamp;, google::protobuf::Message*)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList_VersionEdit::_InternalParse(char const*, google::protobuf::internal::ParseContext*)': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:705: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList_VersionEdit::_InternalSerialize(unsigned char*, google::protobuf::io::EpsCopyOutputStream*) const': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:744: undefined reference to `google::protobuf::UnknownFieldSet::default_instance()' /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:744: undefined reference to `google::protobuf::internal::WireFormat::InternalSerializeUnknownFieldsToArray(google::protobuf::UnknownFieldSet constamp;, unsigned char*, google::protobuf::io::EpsCopyOutputStream*)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists::MergeFrom(google::protobuf::Message constamp;)': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:1206: undefined reference to `google::protobuf::internal::ReflectionOps::Merge(google::protobuf::Message constamp;, google::protobuf::Message*)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::NewFile_FileMetaData_FileDescriptor::_InternalParse(char const*, google::protobuf::internal::ParseContext*)': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.cc:1378: undefined reference to `google::protobuf::internal::UnknownFieldParse(unsigned long, google::protobuf::UnknownFieldSet*, char const*, google::protobuf::internal::ParseContext*)' /root/local/include/google/protobuf/unknown_field_set.h:312: undefined reference to `google::protobuf::UnknownFieldSet::ClearFallback()' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `google::protobuf::Message::Message()': /root/local/include/google/protobuf/message.h:230: undefined reference to `vtable for google::protobuf::Message' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `google::protobuf::Message::Message(google::protobuf::Arena*)': /root/local/include/google/protobuf/message.h:362: undefined reference to `vtable for google::protobuf::Message' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::Response::GetMetadataStatic()': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:207: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList_VersionEdit::GetMetadataStatic()': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:344: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists_EditList::GetMetadataStatic()': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:510: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o): In function `logapply::EditLists::GetMetadataStatic()': /mnt/sdb/my_rocksdb/rubble/logAndApply/logAndApply.pb.h:658: undefined reference to `google::protobuf::internal::AssignDescriptors(google::protobuf::internal::DescriptorTable const*, bool)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply20NewFile_FileMetaDataE[_ZTVN8logapply20NewFile_FileMetaDataE] 0x98): undefined reference to `google::protobuf::Message::SpaceUsedLong() const' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE] 0x20): undefined reference to `google::protobuf::Message::GetTypeName[abi:cxx11]() const' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE] 0x48): undefined reference to `google::protobuf::Message::InitializationErrorString[abi:cxx11]() const' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE] 0x50): undefined reference to `google::protobuf::Message::CheckTypeAndMergeFrom(google::protobuf::MessageLite constamp;)' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTVN8logapply35NewFile_FileMetaData_FileDescriptorE] 0x90): undefined reference to `google::protobuf::Message::DiscardUnknownFields()' (.data.rel.ro._ZTIN8logapply20NewFile_FileMetaDataE[_ZTIN8logapply20NewFile_FileMetaDataE] 0x10): undefined reference to `typeinfo for google::protobuf::Message' /mnt/sdb/my_rocksdb/librocksdb.a(logAndApply.pb.cc.o):(.data.rel.ro._ZTIN8logapply35NewFile_FileMetaData_FileDescriptorE[_ZTIN8logapply35NewFile_FileMetaData_FileDescriptorE] 0x10): more undefined references to `typeinfo for google::protobuf::Message' follow collect2: error: ld returned 1 exit status CMakeFiles/primary_server.dir/build.make:143: recipe for target 'primary_server' failed make[2]: *** [primary_server] Error 1 CMakeFiles/Makefile2:98: recipe for target 'CMakeFiles/primary_server.dir/all' failed make[1]: *** [CMakeFiles/primary_server.dir/all] Error 2 Makefile:102: recipe for target 'all' failed make: *** [all] Error 2
Это файл CMakeLists, который я написал для своей клиентской программы, использующей объект библиотеки rocksdb
# Proto file get_filename_component(kv_proto "../protos/keyvaluestore.proto" ABSOLUTE) get_filename_component(kv_proto_path "${kv_proto}" PATH) # Generated sources set(kv_proto_srcs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.pb.cc") set(kv_proto_hdrs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.pb.h") set(kv_grpc_srcs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.grpc.pb.cc") set(kv_grpc_hdrs "${CMAKE_CURRENT_BINARY_DIR}/keyvaluestore.grpc.pb.h") add_custom_command( OUTPUT "${kv_proto_srcs}" "${kv_proto_hdrs}" "${kv_grpc_srcs}" "${kv_grpc_hdrs}" COMMAND ${_PROTOBUF_PROTOC} ARGS --grpc_out "${CMAKE_CURRENT_BINARY_DIR}" --cpp_out "${CMAKE_CURRENT_BINARY_DIR}" -I "${kv_proto_path}" --plugin=protoc-gen-grpc="${_GRPC_CPP_PLUGIN_EXECUTABLE}" "${kv_proto}" DEPENDS "${kv_proto}") # Include generated *.pb.h files include_directories("${CMAKE_CURRENT_BINARY_DIR}") include_directories(/mnt/sdb/my_rocksdb/include) link_directories(/mnt/sdb/my_rocksdb) # kv_grpc_proto add_library(kv_grpc_proto ${kv_grpc_srcs} ${kv_grpc_hdrs} ${kv_proto_srcs} ${kv_proto_hdrs}) target_link_libraries(kv_grpc_proto ${_REFLECTION} ${_GRPC_GRPCPP} ${_PROTOBUF_LIBPROTOBUF} ) # Targets greeter_[async_](client|server) foreach(_target kv_store_client primary_server ) add_executable(${_target} "${_target}.cc") target_link_libraries(${_target} kv_grpc_proto ${_REFLECTION} ${_GRPC_GRPCPP} ${_PROTOBUF_LIBPROTOBUF} liblog_and_apply_grpc_proto.a librocksdb.a ) endforeach()
Я не совсем знаком с cmake, я думаю, что я не понял это правильно, когда пытался добавить зависимость в исходный код rocksdb, и я действительно застрял на этом, поэтому любые предложения будут оценены!
Комментарии:
1. Похоже, вы создаете свой проект с
make
помощью утилиты. Если это верно, то добавьтеVERBOSE=1
опцию при вызовеmake
. Таким образом, он будет печатать все параметры, переданные компоновщику. Проверьте, чтоgrpc
иprotobuf
библиотеки входят в число этих опций.2. @Tsyvarev Спасибо за комментарий. Это то, что я получаю после указания
VERBOSE=1
, похоже, что он не находит библиотеку, но я все еще не уверен, почему и как это исправить3.
Building CXX object CMakeFiles/rocksdb.dir/db/version_set.cc.o /usr/bin/c -DCARES_STATICLIB -DGFLAGS=1 -DGFLAGS_IS_A_DLL=0 -I/mnt/sdb/my_rocksdb -I/mnt/sdb/my_rocksdb/include -I/mnt/sdb/my_rocksdb/third-party/folly -isystem /root/local/include -W -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -Wno-strict-aliasing -march=native -Werror -fno-builtin-memcmp -g -DROCKSDB_USE_RTTI -std=gnu 11 -o CMakeFiles/rocksdb.dir/db/version_set.cc.o -c /mnt/sdb/my_rocksdb/db/version_set.cc
4. Подождите.. Находит ли это библиотеки? Мои
protoc
иgrpc
устанавливаются в/root/local/
В выводе говорится-isystem /root/local/include
. Не уверен, найдет ли он библиотеку..5. Нет, это не та командная строка, которую вам нужно проверить. Вам нужно проверить командную строку компоновщика (которая вызывает ошибки «неопределенной ссылки»), а не командную строку компилятора .
Ответ №1:
linker
Вывод, похоже, не связан libprotobuf.a
и libgrpcpp.a
[100%] Linking CXX static library librocksdb.a
/usr/local/bin/cmake -P CMakeFiles/rocksdb.dir/cmake_clean_target.cmake
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/rocksdb.dir/link.txt --verbose=1
/usr/bin/ar qc librocksdb.a CMakeFiles/rocksdb.dir/cache/cache.cc.o CMakeFiles/rocksdb.dir/cache/clock_cache.cc.o CMakeFiles/rocksdb.dir/cache/lru_cache.cc.o CMakeFiles/rocksdb.dir/cache/sharded_cache.cc.o CMakeFiles/rocksdb.dir/db/arena_wrapped_db_iter.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_addition.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_builder.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_cache.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_garbage.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_meta.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_file_reader.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_log_format.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_log_sequential_reader.cc.o CMakeFiles/rocksdb.dir/db/blob/blob_log_writer.cc.o CMakeFiles/rocksdb.dir/db/builder.cc.o CMakeFiles/rocksdb.dir/db/c.cc.o CMakeFiles/rocksdb.dir/db/column_family.cc.o CMakeFiles/rocksdb.dir/db/compacted_db_impl.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_iterator.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_job.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker_fifo.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker_level.cc.o CMakeFiles/rocksdb.dir/db/compaction/compaction_picker_universal.cc.o CMakeFiles/rocksdb.dir/db/compaction/sst_partitioner.cc.o CMakeFiles/rocksdb.dir/db/convenience.cc.o CMakeFiles/rocksdb.dir/db/db_filesnapshot.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_write.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_compaction_flush.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_files.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_open.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_debug.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_experimental.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_readonly.cc.o CMakeFiles/rocksdb.dir/db/db_impl/db_impl_secondary.cc.o CMakeFiles/rocksdb.dir/db/db_info_dumper.cc.o CMakeFiles/rocksdb.dir/db/db_iter.cc.o CMakeFiles/rocksdb.dir/db/dbformat.cc.o CMakeFiles/rocksdb.dir/db/error_handler.cc.o CMakeFiles/rocksdb.dir/db/event_helpers.cc.o CMakeFiles/rocksdb.dir/db/experimental.cc.o CMakeFiles/rocksdb.dir/db/external_sst_file_ingestion_job.cc.o CMakeFiles/rocksdb.dir/db/file_indexer.cc.o CMakeFiles/rocksdb.dir/db/flush_job.cc.o CMakeFiles/rocksdb.dir/db/flush_scheduler.cc.o CMakeFiles/rocksdb.dir/db/forward_iterator.cc.o CMakeFiles/rocksdb.dir/db/import_column_family_job.cc.o CMakeFiles/rocksdb.dir/db/internal_stats.cc.o CMakeFiles/rocksdb.dir/db/logs_with_prep_tracker.cc.o CMakeFiles/rocksdb.dir/db/log_reader.cc.o CMakeFiles/rocksdb.dir/db/log_writer.cc.o CMakeFiles/rocksdb.dir/db/malloc_stats.cc.o CMakeFiles/rocksdb.dir/db/memtable.cc.o CMakeFiles/rocksdb.dir/db/memtable_list.cc.o CMakeFiles/rocksdb.dir/db/merge_helper.cc.o CMakeFiles/rocksdb.dir/db/merge_operator.cc.o CMakeFiles/rocksdb.dir/db/output_validator.cc.o CMakeFiles/rocksdb.dir/db/periodic_work_scheduler.cc.o CMakeFiles/rocksdb.dir/db/range_del_aggregator.cc.o CMakeFiles/rocksdb.dir/db/range_tombstone_fragmenter.cc.o CMakeFiles/rocksdb.dir/db/repair.cc.o CMakeFiles/rocksdb.dir/db/snapshot_impl.cc.o CMakeFiles/rocksdb.dir/db/table_cache.cc.o CMakeFiles/rocksdb.dir/db/table_properties_collector.cc.o CMakeFiles/rocksdb.dir/db/transaction_log_impl.cc.o CMakeFiles/rocksdb.dir/db/trim_history_scheduler.cc.o CMakeFiles/rocksdb.dir/db/version_builder.cc.o CMakeFiles/rocksdb.dir/db/version_edit.cc.o CMakeFiles/rocksdb.dir/db/version_edit_handler.cc.o CMakeFiles/rocksdb.dir/db/version_set.cc.o CMakeFiles/rocksdb.dir/db/wal_edit.cc.o CMakeFiles/rocksdb.dir/db/wal_manager.cc.o CMakeFiles/rocksdb.dir/db/write_batch.cc.o CMakeFiles/rocksdb.dir/db/write_batch_base.cc.o CMakeFiles/rocksdb.dir/db/write_controller.cc.o CMakeFiles/rocksdb.dir/db/write_thread.cc.o CMakeFiles/rocksdb.dir/env/env.cc.o CMakeFiles/rocksdb.dir/env/env_chroot.cc.o CMakeFiles/rocksdb.dir/env/env_encryption.cc.o CMakeFiles/rocksdb.dir/env/env_hdfs.cc.o CMakeFiles/rocksdb.dir/env/file_system.cc.o CMakeFiles/rocksdb.dir/env/file_system_tracer.cc.o CMakeFiles/rocksdb.dir/env/mock_env.cc.o CMakeFiles/rocksdb.dir/file/delete_scheduler.cc.o CMakeFiles/rocksdb.dir/file/file_prefetch_buffer.cc.o CMakeFiles/rocksdb.dir/file/file_util.cc.o CMakeFiles/rocksdb.dir/file/filename.cc.o CMakeFiles/rocksdb.dir/file/random_access_file_reader.cc.o CMakeFiles/rocksdb.dir/file/read_write_util.cc.o CMakeFiles/rocksdb.dir/file/readahead_raf.cc.o CMakeFiles/rocksdb.dir/file/sequence_file_reader.cc.o CMakeFiles/rocksdb.dir/file/sst_file_manager_impl.cc.o CMakeFiles/rocksdb.dir/file/writable_file_writer.cc.o CMakeFiles/rocksdb.dir/logging/auto_roll_logger.cc.o CMakeFiles/rocksdb.dir/logging/event_logger.cc.o CMakeFiles/rocksdb.dir/logging/log_buffer.cc.o CMakeFiles/rocksdb.dir/memory/arena.cc.o CMakeFiles/rocksdb.dir/memory/concurrent_arena.cc.o CMakeFiles/rocksdb.dir/memory/jemalloc_nodump_allocator.cc.o CMakeFiles/rocksdb.dir/memory/memkind_kmem_allocator.cc.o CMakeFiles/rocksdb.dir/memtable/alloc_tracker.cc.o CMakeFiles/rocksdb.dir/memtable/hash_linklist_rep.cc.o CMakeFiles/rocksdb.dir/memtable/hash_skiplist_rep.cc.o CMakeFiles/rocksdb.dir/memtable/skiplistrep.cc.o CMakeFiles/rocksdb.dir/memtable/vectorrep.cc.o CMakeFiles/rocksdb.dir/memtable/write_buffer_manager.cc.o CMakeFiles/rocksdb.dir/monitoring/histogram.cc.o CMakeFiles/rocksdb.dir/monitoring/histogram_windowing.cc.o CMakeFiles/rocksdb.dir/monitoring/in_memory_stats_history.cc.o CMakeFiles/rocksdb.dir/monitoring/instrumented_mutex.cc.o CMakeFiles/rocksdb.dir/monitoring/iostats_context.cc.o CMakeFiles/rocksdb.dir/monitoring/perf_context.cc.o CMakeFiles/rocksdb.dir/monitoring/perf_level.cc.o CMakeFiles/rocksdb.dir/monitoring/persistent_stats_history.cc.o CMakeFiles/rocksdb.dir/monitoring/statistics.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_impl.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_updater.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_util.cc.o CMakeFiles/rocksdb.dir/monitoring/thread_status_util_debug.cc.o CMakeFiles/rocksdb.dir/options/cf_options.cc.o CMakeFiles/rocksdb.dir/options/configurable.cc.o CMakeFiles/rocksdb.dir/options/db_options.cc.o CMakeFiles/rocksdb.dir/options/options.cc.o CMakeFiles/rocksdb.dir/options/options_helper.cc.o CMakeFiles/rocksdb.dir/options/options_parser.cc.o CMakeFiles/rocksdb.dir/port/stack_trace.cc.o CMakeFiles/rocksdb.dir/table/adaptive/adaptive_table_factory.cc.o CMakeFiles/rocksdb.dir/table/block_based/binary_search_index_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/block.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_builder.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_factory.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_iterator.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_based_table_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_builder.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_prefetcher.cc.o CMakeFiles/rocksdb.dir/table/block_based/block_prefix_index.cc.o CMakeFiles/rocksdb.dir/table/block_based/data_block_hash_index.cc.o CMakeFiles/rocksdb.dir/table/block_based/data_block_footer.cc.o CMakeFiles/rocksdb.dir/table/block_based/filter_block_reader_common.cc.o CMakeFiles/rocksdb.dir/table/block_based/filter_policy.cc.o CMakeFiles/rocksdb.dir/table/block_based/flush_block_policy.cc.o CMakeFiles/rocksdb.dir/table/block_based/full_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/hash_index_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/index_builder.cc.o CMakeFiles/rocksdb.dir/table/block_based/index_reader_common.cc.o CMakeFiles/rocksdb.dir/table/block_based/parsed_full_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/partitioned_filter_block.cc.o CMakeFiles/rocksdb.dir/table/block_based/partitioned_index_iterator.cc.o CMakeFiles/rocksdb.dir/table/block_based/partitioned_index_reader.cc.o CMakeFiles/rocksdb.dir/table/block_based/reader_common.cc.o CMakeFiles/rocksdb.dir/table/block_based/uncompression_dict_reader.cc.o CMakeFiles/rocksdb.dir/table/block_fetcher.cc.o CMakeFiles/rocksdb.dir/table/cuckoo/cuckoo_table_builder.cc.o CMakeFiles/rocksdb.dir/table/cuckoo/cuckoo_table_factory.cc.o CMakeFiles/rocksdb.dir/table/cuckoo/cuckoo_table_reader.cc.o CMakeFiles/rocksdb.dir/table/format.cc.o CMakeFiles/rocksdb.dir/table/get_context.cc.o CMakeFiles/rocksdb.dir/table/iterator.cc.o CMakeFiles/rocksdb.dir/table/merging_iterator.cc.o CMakeFiles/rocksdb.dir/table/meta_blocks.cc.o CMakeFiles/rocksdb.dir/table/persistent_cache_helper.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_bloom.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_builder.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_factory.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_index.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_key_coding.cc.o CMakeFiles/rocksdb.dir/table/plain/plain_table_reader.cc.o CMakeFiles/rocksdb.dir/table/sst_file_dumper.cc.o CMakeFiles/rocksdb.dir/table/sst_file_reader.cc.o CMakeFiles/rocksdb.dir/table/sst_file_writer.cc.o CMakeFiles/rocksdb.dir/table/table_factory.cc.o CMakeFiles/rocksdb.dir/table/table_properties.cc.o CMakeFiles/rocksdb.dir/table/two_level_iterator.cc.o CMakeFiles/rocksdb.dir/test_util/sync_point.cc.o CMakeFiles/rocksdb.dir/test_util/sync_point_impl.cc.o CMakeFiles/rocksdb.dir/test_util/testutil.cc.o CMakeFiles/rocksdb.dir/test_util/transaction_test_util.cc.o CMakeFiles/rocksdb.dir/tools/block_cache_analyzer/block_cache_trace_analyzer.cc.o CMakeFiles/rocksdb.dir/tools/dump/db_dump_tool.cc.o CMakeFiles/rocksdb.dir/tools/io_tracer_parser_tool.cc.o CMakeFiles/rocksdb.dir/tools/ldb_cmd.cc.o CMakeFiles/rocksdb.dir/tools/ldb_tool.cc.o CMakeFiles/rocksdb.dir/tools/sst_dump_tool.cc.o CMakeFiles/rocksdb.dir/tools/trace_analyzer_tool.cc.o CMakeFiles/rocksdb.dir/trace_replay/trace_replay.cc.o CMakeFiles/rocksdb.dir/trace_replay/block_cache_tracer.cc.o CMakeFiles/rocksdb.dir/trace_replay/io_tracer.cc.o CMakeFiles/rocksdb.dir/util/coding.cc.o CMakeFiles/rocksdb.dir/util/compaction_job_stats_impl.cc.o CMakeFiles/rocksdb.dir/util/comparator.cc.o CMakeFiles/rocksdb.dir/util/compression_context_cache.cc.o CMakeFiles/rocksdb.dir/util/concurrent_task_limiter_impl.cc.o CMakeFiles/rocksdb.dir/util/crc32c.cc.o CMakeFiles/rocksdb.dir/util/dynamic_bloom.cc.o CMakeFiles/rocksdb.dir/util/hash.cc.o CMakeFiles/rocksdb.dir/util/murmurhash.cc.o CMakeFiles/rocksdb.dir/util/random.cc.o CMakeFiles/rocksdb.dir/util/rate_limiter.cc.o CMakeFiles/rocksdb.dir/util/slice.cc.o CMakeFiles/rocksdb.dir/util/file_checksum_helper.cc.o CMakeFiles/rocksdb.dir/util/status.cc.o CMakeFiles/rocksdb.dir/util/string_util.cc.o CMakeFiles/rocksdb.dir/util/thread_local.cc.o CMakeFiles/rocksdb.dir/util/threadpool_imp.cc.o CMakeFiles/rocksdb.dir/util/xxhash.cc.o CMakeFiles/rocksdb.dir/utilities/backupable/backupable_db.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_compaction_filter.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_db.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_db_impl.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_db_impl_filesnapshot.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_dump_tool.cc.o CMakeFiles/rocksdb.dir/utilities/blob_db/blob_file.cc.o CMakeFiles/rocksdb.dir/utilities/cassandra/cassandra_compaction_filter.cc.o CMakeFiles/rocksdb.dir/utilities/cassandra/format.cc.o CMakeFiles/rocksdb.dir/utilities/cassandra/merge_operator.cc.o CMakeFiles/rocksdb.dir/utilities/checkpoint/checkpoint_impl.cc.o CMakeFiles/rocksdb.dir/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc.o CMakeFiles/rocksdb.dir/utilities/debug.cc.o CMakeFiles/rocksdb.dir/utilities/env_mirror.cc.o CMakeFiles/rocksdb.dir/utilities/env_timed.cc.o CMakeFiles/rocksdb.dir/utilities/fault_injection_env.cc.o CMakeFiles/rocksdb.dir/utilities/fault_injection_fs.cc.o CMakeFiles/rocksdb.dir/utilities/leveldb_options/leveldb_options.cc.o CMakeFiles/rocksdb.dir/utilities/memory/memory_util.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/bytesxor.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/max.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/put.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/sortlist.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/string_append/stringappend.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/string_append/stringappend2.cc.o CMakeFiles/rocksdb.dir/utilities/merge_operators/uint64add.cc.o CMakeFiles/rocksdb.dir/utilities/object_registry.cc.o CMakeFiles/rocksdb.dir/utilities/option_change_migration/option_change_migration.cc.o CMakeFiles/rocksdb.dir/utilities/options/options_util.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/block_cache_tier.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/block_cache_tier_file.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/block_cache_tier_metadata.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/persistent_cache_tier.cc.o CMakeFiles/rocksdb.dir/utilities/persistent_cache/volatile_tier_impl.cc.o CMakeFiles/rocksdb.dir/utilities/simulator_cache/cache_simulator.cc.o CMakeFiles/rocksdb.dir/utilities/simulator_cache/sim_cache.cc.o CMakeFiles/rocksdb.dir/utilities/table_properties_collectors/compact_on_deletion_collector.cc.o CMakeFiles/rocksdb.dir/utilities/trace/file_trace_reader_writer.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/lock/lock_manager.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/lock/point/point_lock_tracker.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/lock/point/point_lock_manager.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/optimistic_transaction_db_impl.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/optimistic_transaction.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/pessimistic_transaction.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/pessimistic_transaction_db.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/snapshot_checker.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/transaction_base.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/transaction_db_mutex_impl.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/transaction_util.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_prepared_txn.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_prepared_txn_db.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_unprepared_txn.cc.o CMakeFiles/rocksdb.dir/utilities/transactions/write_unprepared_txn_db.cc.o CMakeFiles/rocksdb.dir/utilities/ttl/db_ttl_impl.cc.o CMakeFiles/rocksdb.dir/utilities/write_batch_with_index/write_batch_with_index.cc.o CMakeFiles/rocksdb.dir/utilities/write_batch_with_index/write_batch_with_index_internal.cc.o CMakeFiles/rocksdb.dir/rubble/logAndApply/logAndApply.grpc.pb.cc.o CMakeFiles/rocksdb.dir/rubble/logAndApply/logAndApply.pb.cc.o CMakeFiles/rocksdb.dir/port/port_posix.cc.o CMakeFiles/rocksdb.dir/env/env_posix.cc.o CMakeFiles/rocksdb.dir/env/fs_posix.cc.o CMakeFiles/rocksdb.dir/env/io_posix.cc.o CMakeFiles/rocksdb.dir/third-party/folly/folly/detail/Futex.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/AtomicNotification.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/DistributedMutex.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/ParkingLot.cpp.o CMakeFiles/rocksdb.dir/third-party/folly/folly/synchronization/WaitOptions.cpp.o CMakeFiles/rocksdb.dir/logAndApply.grpc.pb.cc.o CMakeFiles/rocksdb.dir/logAndApply.pb.cc.o CMakeFiles/build_version.dir/build_version.cc.o
/usr/bin/ranlib librocksdb.a
выполнение a grep
на выходе grpc
и protobuf
не дало мне библиотеку… Итак, компоновщику каким-то образом не удается найти библиотеку, что меня смущает, потому что я сделал
target_link_libraries(${ROCKSDB_STATIC_LIB} PRIVATE
${THIRDPARTY_LIBS} ${SYSTEM_LIBS}
${_REFLECTION}
${_GRPC_GRPCPP}
${_PROTOBUF_LIBPROTOBUF}
)
в базе данных rocksdb CMakeLists
.
Комментарии:
1. Пожалуйста, обратите внимание, что при переполнении стека сообщение ответа должно содержать ответ на вопрос. Если вы просто хотите опубликовать дополнительную информацию о своей проблеме, добавьте эту информацию в сообщение с вопросом .