-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(c++): fix the 'multiple definition' bug when linking libarrow.a and libgraphar_bundled_dependencies.a in one CMakeLists.txt #657
Conversation
…c graphar build arrow from source
…nd libgraphar_bundled_dependencies.a in one CMakeLists.txt
"${GAR_DATASET_STATIC_LIB}" | ||
"${GAR_ARROW_ACERO_STATIC_LIB}" | ||
"${GAR_ARROW_BUNDLED_DEPS_STATIC_LIB}" -Wl,--no-whole-archive) | ||
target_link_libraries(graphar PRIVATE -Wl,--exclude-libs,ALL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove -Wl,--whole-archive
and -Wl,--no-whole-archive
Yes, I used the totally same exmaple in the comment for testing and the installation steps are exactly the same, the results show that we can run this code correctly Other exampletest_read.cc#include <cstdlib>
#include <iostream>
#include "arrow/api.h"
#include "graphar/api/arrow_reader.h"
int main() {
std::string path = "/workspaces/incubator-graphar/testing/ldbc_sample/parquet/ldbc_sample.graph.yml";
std::string src_type = "person", edge_type = "knows", dst_type = "person";
std::string vertex_property_name = "id";
std::string edge_property_name = "creationDate";
auto maybe_graph_info = graphar::GraphInfo::Load(path);
auto graph_info = maybe_graph_info.value();
auto vertex_info = graph_info->GetVertexInfo(src_type);
auto maybe_reader = graphar::VertexPropertyArrowChunkReader::Make(
graph_info, src_type, vertex_property_name);
auto reader = maybe_reader.value();
std::cout << "Chunknum " << reader->GetChunkNum() << std::endl;
auto result = reader->GetChunk();
auto table = result.value();
std::cout << "num_rows " << table->num_rows() << std::endl;
} CMakeLists.txtcmake_minimum_required(VERSION 3.15)
project(test_read)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall")
set(TARGET test_read)
find_package(graphar REQUIRED)
find_package(Arrow REQUIRED)
add_executable(${TARGET} test_read.cc)
target_link_libraries(${TARGET} PRIVATE graphar Arrow::arrow_static) buildcmake . && make |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fix the issues in #628