Trouble building C++ version of Graph Tool using CMake.
Hello, I would like to use graph-tool directly in C++ (Only)
My System is using CMake and I decide to try to build graph tool with that. Because the Makefile are really clean its really easy to use CMake to build graph tool, here for example how I am mimicking the makefile for centrality
SET(NAME centrality)
SET(${NAME}_SOURCES
graph_betweenness.cc
graph_centrality_bind.cc
graph_closeness.cc
graph_eigentrust.cc
graph_eigenvector.cc
graph_hits.cc
graph_katz.cc
graph_pagerank.cc
graph_trust_transitivity.cc
)
SET(${NAME}_HEADERS
graph_closeness.hh
graph_eigentrust.hh
graph_eigenvector.hh
graph_pagerank.hh
graph_hits.hh
graph_katz.hh
graph_trust_transitivity.hh
minmax.hh
)
SET(${NAME}_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${NAME})
SET(${NAME}_INCLUDEDIR ${CMAKE_CURRENT_SOURCE_DIR}/include/${NAME})
ADD_LIBRARY(${NAME} OBJECT ${${NAME}_SOURCES} ${${NAME}_HEADERS})
TARGET_INCLUDE_DIRECTORIES(${NAME} PRIVATE ${GRAPHTOOL_INCLUDEDIR})
TARGET_INCLUDE_DIRECTORIES(${NAME} INTERFACE ${${NAME}_INCLUDEDIR})
So far almost everything is good, but when come the dynamic library I have some issue for linking. I also build my own boost with the latest version 1.73
Unfortunately I have this kind of error :
Undefined symbols for architecture x86_64:
"graph_tool::ActionNotFound::ActionNotFound(std::type_info const&, std::__1::vector<std::type_info const*, std::__1::allocator<std::type_info const*> > const&)", referenced from:
void graph_tool::detail::action_dispatch<std::__1::__bind<graph_tool::find_vertices, std::__1::placeholders::__ph<1> const&, std::__1::reference_wrapper<graph_tool::GraphInterface>, std::__1::placeholders::__ph<2> const&, std::__1::reference_wrapper<boost::python::tuple>, std::__1::reference_wrapper<boost::python::list> >, mpl_::bool_<false>, graph_tool::detail::all_graph_views, graph_tool::all_selectors>::operator()<boost::any, boost::any&>(boost::any&&, boost::any&) const in graph_search.cc.o
void graph_tool::detail::action_dispatch<std::__1::__bind<graph_tool::find_edges, std::__1::placeholders::__ph<1> const&, std::__1::reference_wrapper<graph_tool::GraphInterface>, boost::adj_edge_index_property_map<unsigned long>&, std::__1::placeholders::__ph<2> const&, std::__1::reference_wrapper<boost::python::tuple>, std::__1::reference_wrapper<boost::python::list> >, mpl_::bool_<false>, graph_tool::detail::all_graph_views, boost::mpl::v_item<boost::adj_edge_index_property_map<unsigned long>, boost::mpl::v_item<boost::checked_vector_property_map<boost::python::api::object, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<std::__1::vector<long double, std::__1::allocator<long double> >, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<std::__1::vector<double, std::__1::allocator<double> >, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<std::__1::vector<long long, std::__1::allocator<long long> >, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<std::__1::vector<int, std::__1::allocator<int> >, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<std::__1::vector<short, std::__1::allocator<short> >, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<long double, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<double, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<long long, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<int, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<short, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::v_item<boost::checked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> >, boost::mpl::vector0<mpl_::na>, 0>, 0>, 0>, 0>, 0>, 0>, 0>, 0>, 0>, 0>, 0>, 0>, 0>, 0>, 0>, 0> >::operator()<boost::any, boost::any&>(boost::any&&, boost::any&) const in graph_search.cc.o
"graph_tool::GraphException::~GraphException()", referenced from:
graph_tool::ActionNotFound::~ActionNotFound() in graph_search.cc.o
graph_tool::ActionNotFound::~ActionNotFound() in graph_search.cc.o
"graph_tool::ValueException::ValueException(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
graph_tool::PythonEdge<boost::adj_list<unsigned long> >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::reversed_graph<boost::adj_list<unsigned long>, boost::adj_list<unsigned long> const&> >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::undirected_adaptor<boost::adj_list<unsigned long> > >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::filt_graph<boost::adj_list<unsigned long>, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> > >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::typed_identity_property_map<unsigned long> > > > >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::filt_graph<boost::reversed_graph<boost::adj_list<unsigned long>, boost::adj_list<unsigned long> const&>, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> > >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::typed_identity_property_map<unsigned long> > > > >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::filt_graph<boost::undirected_adaptor<boost::adj_list<unsigned long> >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> > >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::typed_identity_property_map<unsigned long> > > > >::check_valid() const in graph_search.cc.o
"graph_tool::ValueException::~ValueException()", referenced from:
graph_tool::PythonEdge<boost::adj_list<unsigned long> >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::reversed_graph<boost::adj_list<unsigned long>, boost::adj_list<unsigned long> const&> >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::undirected_adaptor<boost::adj_list<unsigned long> > >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::filt_graph<boost::adj_list<unsigned long>, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> > >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::typed_identity_property_map<unsigned long> > > > >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::filt_graph<boost::reversed_graph<boost::adj_list<unsigned long>, boost::adj_list<unsigned long> const&>, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> > >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::typed_identity_property_map<unsigned long> > > > >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::filt_graph<boost::undirected_adaptor<boost::adj_list<unsigned long> >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> > >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::typed_identity_property_map<unsigned long> > > > >::check_valid() const in graph_search.cc.o
"graph_tool::degree_selector(boost::variant<graph_tool::GraphInterface::degree_t, boost::any>)", referenced from:
find_vertex_range(graph_tool::GraphInterface&, boost::variant<graph_tool::GraphInterface::degree_t, boost::any>, boost::python::tuple) in graph_search.cc.o
"graph_tool::GraphException::what() const", referenced from:
vtable for graph_tool::ActionNotFound in graph_search.cc.o
"graph_tool::GraphInterface::get_graph_view() const", referenced from:
find_vertex_range(graph_tool::GraphInterface&, boost::variant<graph_tool::GraphInterface::degree_t, boost::any>, boost::python::tuple) in graph_search.cc.o
find_edge_range(graph_tool::GraphInterface&, boost::any, boost::python::tuple) in graph_search.cc.o
"typeinfo for graph_tool::GraphException", referenced from:
typeinfo for graph_tool::ActionNotFound in graph_search.cc.o
"typeinfo for graph_tool::ValueException", referenced from:
graph_tool::PythonEdge<boost::adj_list<unsigned long> >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::reversed_graph<boost::adj_list<unsigned long>, boost::adj_list<unsigned long> const&> >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::undirected_adaptor<boost::adj_list<unsigned long> > >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::filt_graph<boost::adj_list<unsigned long>, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> > >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::typed_identity_property_map<unsigned long> > > > >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::filt_graph<boost::reversed_graph<boost::adj_list<unsigned long>, boost::adj_list<unsigned long> const&>, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> > >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::typed_identity_property_map<unsigned long> > > > >::check_valid() const in graph_search.cc.o
graph_tool::PythonEdge<boost::filt_graph<boost::undirected_adaptor<boost::adj_list<unsigned long> >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::adj_edge_index_property_map<unsigned long> > >, graph_tool::detail::MaskFilter<boost::unchecked_vector_property_map<unsigned char, boost::typed_identity_property_map<unsigned long> > > > >::check_valid() const in graph_search.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I know the way I am doing it its not a classical way, but if you have any idea why I miss I will really appreciate. Thanks