fix(c++): fix the 'multiple definition' bug when linking libarrow.a and libgraphar_bundled_dependencies.a in one CMakeLists.txt#657
Merged
lixueclaire merged 2 commits intoapache:mainfrom Dec 23, 2024
Conversation
…c graphar build arrow from source
…nd libgraphar_bundled_dependencies.a in one CMakeLists.txt
Contributor
Author
Elssky
commented
Nov 11, 2024
| "${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 |
Contributor
Author
There was a problem hiding this comment.
remove -Wl,--whole-archive and -Wl,--no-whole-archive
Contributor
Contributor
Author
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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


fix the issues in #628