how to compile when using read_graphml

Hi, I've been trying to use the function from read_graphml from BGL. I am using the test case in http://lists.boost.org/Archives/boost/2007/04/119804.php as my first case study. Apparently it compiles ok, but there is a link error. See msg bellow: ====== aamory@gaph14:~/reps/test-tools/bgl/test/sandbox-bgl$ g++ reader_test.cc In file included from /usr/include/c++/4.4/backward/hash_set:59, from /usr/include/boost/graph/adjacency_list.hpp:25, from reader_test.cc:1: /usr/include/c++/4.4/backward/backward_warning.h:28:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. /tmp/ccgvAjHU.o: In function `void boost::read_graphml<boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, VertexProps, boost::property<boost::edge_weight_t, double, boost::no_property>, boost::no_property, boost::listS>
collect2: ld returned 1 exit status aamory@gaph14:~/reps/test-tools/bgl/test/sandbox-bgl$ =======
I guess there should be some library. Reading the doc in http://www.boost.org/doc/libs/1_38_0/libs/graph/doc/read_graphml.html it says that the lib "bgl-graphml" should be included, but I don't known where to find it. At the /usr/lib there is only the files libboost_graph-mt.a, libboost_graph-mt.so, libboost_graph-mt.so.1.38.0 It seems that the problem is just to correctly define the compilation command ... any help would be much appreciated. configuration: - boost 1.38.0 - ubuntu 9.10 64 bits - g++ 4.4.1 Thanks! Alexandre

On Thu, Jan 14, 2010 at 2:50 PM, Jeremiah Willcock <jewillco@osl.iu.edu>wrote:
Thanks Jeremiah, I am newbie in boost and I don't know how to use boost.build. Is there any tutorial for it ? I was wondering if the newer version of boost 1.41.0 still requires setting up boost.build. I would like just to get the boost from apt-get and start using BGL. :( ... Am I dreaming ? :) perhaps the graphviz format is more stable (or with better integration) than the graphml format ... is it true ? I dont need fancy stuff .. just reading and writing small and simple graphs. in other words, is there any quick way of read/write small and simple graphs with BGL ? Regards, Alexandre

On Thu, 14 Jan 2010, Alexandre de Morais Amory wrote:
The GraphViz and GraphML interfaces are the best way. Check whether your package for Boost (from apt-get) contains GraphViz support; that should be in all versions. GraphML may not be there since it relied on Expat until recently. Otherwise, you can look at http://www.boost.org/doc/libs/1_41_0/more/getting_started/index.html for build instructions. -- Jeremiah Willcock

Hi, I finally got the graph io (both graphml and graphviz) working, so, i am sharing my findings. It might be obvious for most of you, anyway, it might also be valuable for newbies in boost and BGL like me. ======================================== installing boost ======================================== - uninstall any old version - download the latest one ( http://sourceforge.net/projects/boost/files/boost/1.41.0/) - run: - ./bootstrap.sh --with-libraries=graph <= one might want to include other libs as well - su - - EXPAT_INCLUDE=/usr/include/ <= required to support graphml format - EXPAT_LIBPATH=/lib/ - export EXPAT_INCLUDE - export EXPAT_LIBPATH - ./bjam install - cp bin.v2/libs/graph/build/gcc-4.4.1/release/threading-multi/*.o /usr/local/lib <= required for supporting both graphviz and graphml (If you download a pre-compiled distribution, these files will not be included (at least i could not find them), then you will not be able to use graphviz and graphml) - LD_RUN_PATH=/user/local/lib; export LD_RUN_PATH - ldconfig -v ==================================================== how to compile with graphviz ==================================================== - download files attached. These files are not mine, I am just redistributing for convenience. I have copied these test files from somewhere. ack to the original author ! g++ graphviz.cpp /usr/local/lib/read_graphviz_new.o -lboost_graph -lboost_regex -o graphviz ==================================================== how to compile with graphml ==================================================== - download files attached. These files are not mine, I am just redistributing for convenience. I have copied these test files from somewhere. ack to the original author ! g++ reader-test.cc /usr/local/lib/graphml.o -lboost_graph -lboost_regex -lexpat -o graphml Cheers! Alexandre On Fri, Jan 15, 2010 at 8:36 AM, Jeremiah Willcock <jewillco@osl.iu.edu>wrote:
participants (2)
-
Alexandre de Morais Amory
-
Jeremiah Willcock