alibaba / GraphScope

🔨 🍇 💻 🚀 GraphScope: A One-Stop Large-Scale Graph Computing System from Alibaba | 一站式图计算系统
https://graphscope.io
Apache License 2.0
3.26k stars 442 forks source link

[BUG] There seems to be a bug in library dependencies #4243

Open zhanglei1949 opened 1 week ago

zhanglei1949 commented 1 week ago

The dependency relationship is still unclear and confusion. When I add a test in flex/tests/hqps/ with name runtime_test.cc, with following content

#include "flex/engines/graph_db/runtime/adhoc/runtime.h"
#include <map>
#include <string>
#include <vector>

int main(int argc, char** argv) {
  physical::PhysicalPlan plan;
  std::map<std::string, std::string> params;

  // Receiving output
  std::vector<char> buf;
  gs::Encoder output(buf);

  gs::runtime::Context ctx;
  ctx.append_tag_id(0);
  LOG(INFO) << "Finish query, output size: " << buf.size();

  return 0;
}

The project fail to build at linking time.

/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::graph() const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::Schema::has_multi_props_edge() const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::MutablePropertyFragment::get_ie_csr(unsigned char, unsigned char, unsigned char) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::Schema::get_vertex_property_names[abi:cxx11](unsigned char) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::edge_iterator::GetNeighbor() const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::GetVertexIndex(unsigned char, gs::Any const&, unsigned int&) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::GetInEdgeIterator(unsigned char, unsigned int, unsigned char, unsigned char) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::edge_iterator::~edge_iterator()'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::MutablePropertyFragment::get_vertex_table(unsigned char) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::MutablePropertyFragment::schema() const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::edge_iterator::IsValid() const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::edge_iterator::GetData() const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::Schema::get_edge_label_name[abi:cxx11](unsigned char) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::edge_iterator::Next()'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::schema() const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::GetVertexId(unsigned char, unsigned int) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::Schema::vertex_label_num() const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::ReadTransaction::GetOutEdgeIterator(unsigned char, unsigned int, unsigned char, unsigned char) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::Schema::get_vertex_label_name[abi:cxx11](unsigned char) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::Schema::get_edge_properties(unsigned char, unsigned char, unsigned char) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::Schema::exist(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::Schema::edge_label_num() const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::Schema::get_edge_property_names[abi:cxx11](unsigned char const&, unsigned char const&, unsigned char const&) const'
/usr/bin/ld: ../../engines/graph_db/runtime/libruntime_common.so: undefined reference to `gs::MutablePropertyFragment::get_oe_csr(unsigned char, unsigned char, unsigned char) const'
zhanglei1949 commented 1 week ago

The issue may arise because libruntime_common.so depends on symbols from libflex_graph_db.so. Previously, only libflex_graph_db.so linked to libruntime_common.so, so there was no problem. Now, when other CMake targets link to libruntime_common.so, the symbols defined in libflex_graph_db.so are not found.