[BGL] build problems
Dear all,
I'm a bjam newbie trying to build the BGL in boost 1.30.0 on a DEC
Alpha running linux. However, the build process is failing to
generate the graphviz parser and lexer:
$ cd libs/graph/build
$ bjam "-sTOOLS=gcc"
...found 437 targets...
...using 2 temp targets...
...updating 3 targets...
...using
Angus Leeming
Dear all,
I'm a bjam newbie trying to build the BGL in boost 1.30.0 on a DEC Alpha running linux. However, the build process is failing to generate the graphviz parser and lexer:
$ cd libs/graph/build $ bjam "-sTOOLS=gcc" ...found 437 targets... ...using 2 temp targets... ...updating 3 targets... ...using
graphviz_graph_lex.o... ...using graphviz_digraph_lex.o... gcc-C++-action ../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/inlining-on/runtime-link-dynamic/graphviz_graph_parser.o graphviz_parser.y:44:2: #error Need to define the GRAPHVIZ_GRAPH
Try bjam -sTOOLS=gcc "-sBUILD=<define>GRAPHVIZ_GRAPH=GraphvizGraph" HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com
David Abrahams wrote:
Angus Leeming
writes: Dear all,
I'm a bjam newbie trying to build the BGL in boost 1.30.0 on a DEC Alpha running linux. However, the build process is failing to generate the graphviz parser and lexer:
$ cd libs/graph/build $ bjam "-sTOOLS=gcc" ...found 437 targets... ...using 2 temp targets... ...updating 3 targets... ...using
graphviz_graph_lex.o... ...using graphviz_digraph_lex.o... gcc-C++-action ../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/inlining-on/runtime-link-dynamic/graphviz_graph_parser.o graphviz_parser.y:44:2: #error Need to define the GRAPHVIZ_GRAPH Try bjam -sTOOLS=gcc "-sBUILD=<define>GRAPHVIZ_GRAPH=GraphvizGraph"
HTH,
Thank you, Dave. It does indeed fix that particular problem. Now I have another that appears similar: gcc-C++-action ../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/runtime-link-dynamic/graphviz_graph_parser.o graphviz_parser.y:44:2: #error Need to define the GRAPHVIZ_DIRECTED macro to either 0 or 1 Needless to say, neither "-sBUILD=<define>GRAPHVIZ_GRAPH=GraphvizGraph <define>GRAPHVIZ_DIRECTED=GraphvizDirected" nor "-sBUILD=<define>GRAPHVIZ_DIRECTED=GraphvizDirected" (in case I got the syntax wrong ;-) have any effect. I don't know how familiar you are with the code here, but the Makefile way would be to define specialised targets (my terminology is probably incorrect), in transparent terms something like: graphviz_graph_parser.o: graphviz_parser.C g++ -DGRAPHVIZ_DIRECTED=0 -o graphviz_graph_parser.o graphviz_parser.C graphviz_digraph_parser.o: graphviz_parser.C g++ -DGRAPHVIZ_DIRECTED=1 -o graphviz_digraph_parser.o graphviz_parser.C ie, two object files from one source file. The complication here, of course, is that the source code is in graphviz_parser.y. Does this enable you to 'cure' the problem or is it fundamental? Angus
Angus Leeming
David Abrahams wrote:
Angus Leeming
writes: Dear all,
I'm a bjam newbie trying to build the BGL in boost 1.30.0 on a DEC Alpha running linux. However, the build process is failing to generate the graphviz parser and lexer:
$ cd libs/graph/build $ bjam "-sTOOLS=gcc" ...found 437 targets... ...using 2 temp targets... ...updating 3 targets... ...using
graphviz_graph_lex.o... ...using graphviz_digraph_lex.o... gcc-C++-action ../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/inlining-on/runtime-link-dynamic/graphviz_graph_parser.o graphviz_parser.y:44:2: #error Need to define the GRAPHVIZ_GRAPH Try bjam -sTOOLS=gcc "-sBUILD=<define>GRAPHVIZ_GRAPH=GraphvizGraph"
HTH,
Thank you, Dave. It does indeed fix that particular problem. Now I have another that appears similar:
gcc-C++-action ../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/runtime-link-dynamic/graphviz_graph_parser.o graphviz_parser.y:44:2: #error Need to define the GRAPHVIZ_DIRECTED macro to either 0 or 1
Needless to say, neither "-sBUILD=<define>GRAPHVIZ_GRAPH=GraphvizGraph <define>GRAPHVIZ_DIRECTED=GraphvizDirected" nor "-sBUILD=<define>GRAPHVIZ_DIRECTED=GraphvizDirected" (in case I got the syntax wrong ;-)
have any effect.
Why is that needless to say? Both of those seem to have the intended effect. What do you see on the generated command-lines?
I don't know how familiar you are with the code here, but the Makefile way would be to define specialised targets (my terminology is probably incorrect), in transparent terms something like:
graphviz_graph_parser.o: graphviz_parser.C g++ -DGRAPHVIZ_DIRECTED=0 -o graphviz_graph_parser.o graphviz_parser.C
graphviz_digraph_parser.o: graphviz_parser.C g++ -DGRAPHVIZ_DIRECTED=1 -o graphviz_digraph_parser.o graphviz_parser.C
ie, two object files from one source file. The complication here, of course, is that the source code is in graphviz_parser.y.
That's not complicated, IMO.
Does this enable you to 'cure' the problem or is it fundamental?
I'm sorry, I don't know how to "cure" the problem right now, because I'm not sure what results would be produced by a complete cure. Do you expect to end up with both of these .o files in in the same library? -- Dave Abrahams Boost Consulting www.boost-consulting.com
David Abrahams wrote:
gcc-C++-action ../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/runtime-link-dynamic/graphviz_graph_parser.o graphviz_parser.y:44:2: #error Need to define the GRAPHVIZ_DIRECTED macro to either 0 or 1
Needless to say, neither "-sBUILD=<define>GRAPHVIZ_GRAPH=GraphvizGraph <define>GRAPHVIZ_DIRECTED=GraphvizDirected" nor "-sBUILD=<define>GRAPHVIZ_DIRECTED=GraphvizDirected" (in case I got the syntax wrong ;-)
have any effect.
Why is that needless to say? Both of those seem to have the intended effect. What do you see on the generated command-lines?
My apologies. I meant only that I was ignorant of the syntax. The relevant snippet of source code in graphviz_parser.y is #ifndef GRAPHVIZ_DIRECTED #error Need to define the GRAPHVIZ_DIRECTED macro to either 0 or 1 #endif #if GRAPHVIZ_DIRECTED == 0 #define GRAPHVIZ_GRAPH boost::GraphvizGraph #define yyrestart bgl_undir_restart #else #define GRAPHVIZ_GRAPH boost::GraphvizDigraph #define yyrestart bgl_dir_restart #endif So, passing 'GRAPHVIZ_GRAPH=GraphvizGraph' to the compiler is actually the wrong thing to do. We should pass it 'GRAPHVIZ_DIRECTED=0' or 'GRAPHVIZ_DIRECTED=1' as appropriate. Hence invoking bjam with a fixed value for GRAPHVIZ_DIRECTED is also wrong. Instead the Jamfile requires rules to create graphviz_graph_parser.o and graphviz_digraph_parser.o from graphviz_parser.y. Nonetheless, proceeding with your suggested stategy in order to demonstrate what is actually happening and to answer your question about what is seen on the generated command-lines: $ bjam -sTOOLS=gcc "-sBUILD=<define>GRAPHVIZ_DIRECTED=0" [snip] gcc-C++-action ../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/runtime-link-dynamic/graphviz_graph_parser.o graphviz_parser.y:44:2: #error Need to define the GRAPHVIZ_DIRECTED macro to either 0 or 1 graphviz_parser.y: In function `void boost::read_graphviz(const std::string&, boost::GraphvizGraph&)': graphviz_parser.y:500: warning: unused variable `void*in' graphviz_parser.y: In function `void boost::read_graphviz(FILE*, boost::GraphvizGraph&)': graphviz_parser.y:505: warning: unused variable `void*in' /home/aleem/boost/boost-1.30.1/boost/tuple/detail/tuple_basic.hpp: At top level: graphviz_parser.y:89: warning: `const std::string& graphviz::get_graph_name(const graphviz::Subgraph&)' defined but not used g++ -c -Wall -ftemplate-depth-100 -g -O0 -fno-inline -I"../../../libs/graph/build" -I "/home/aleem/boost/boost-1.30.1" -o "../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/runtime-link-dynamic/graphviz_graph_parser.o" "../../../libs/graph/build/../src/graphviz_graph_parser.cpp" ...failed gcc-C++-action ../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/runtime-link-dynamic/graphviz_graph_parser.o... As you can see, GRAPHVIZ_DIRECTED=0 is not passed to g++.
I don't know how familiar you are with the code here, but the Makefile way would be to define specialised targets (my terminology is probably incorrect), in transparent terms something like:
graphviz_graph_parser.o: graphviz_parser.C g++ -DGRAPHVIZ_DIRECTED=0 -o graphviz_graph_parser.o graphviz_parser.C
graphviz_digraph_parser.o: graphviz_parser.C g++ -DGRAPHVIZ_DIRECTED=1 -o graphviz_digraph_parser.o graphviz_parser.C
ie, two object files from one source file. The complication here, of course, is that the source code is in graphviz_parser.y.
That's not complicated, IMO.
Does this enable you to 'cure' the problem or is it fundamental?
I'm sorry, I don't know how to "cure" the problem right now, because I'm not sure what results would be produced by a complete cure. Do you expect to end up with both of these .o files in in the same library?
Yes.
There is a file 'libs/graph/build/Jamfile.v2' containing
obj graphviz_graph_lex : graphviz_lex.l
:
In article
Does any of this help?
Yes, and no. 1. There's no immediate support for building lexx/yacc source in Boost>Biuld.V1. As you can see from the Jamfile.v2, there is support in BB.V2. 2. But, the source files are already built going from the grammar files to the cpp source should not be needed as there are already source files there. 3. BB.V1 doesn't support per-source file properties. Which is what the Makefile is doing. 4. But, here's a way I came up of "hacking" it to do it anyway... ---boost-root/libs/graph/build/Jamfile--- subproject libs/graph/build ; SOURCES = graphviz_graph_lex graphviz_digraph_lex graphviz_graph_parser graphviz_digraph_parser ; GRAPHVIZ_DEFS(graphviz_graph_parser) = GRAPHVIZ_GRAPH=boost::GraphvizGraph GRAPHVIZ_DIRECTED=0 ; GRAPHVIZ_DEFS(graphviz_digraph_parser) = GRAPHVIZ_GRAPH=boost::GraphvizDigraph GRAPHVIZ_DIRECTED=1 ; { rule bgl-lib-file { local objects source defs ; defs = $(DEFINES) ; for source in $(>) { DEFINES = $(defs) $(GRAPHVIZ_DEFS($(source:B))) ; objects += [ Objects $(source) ] ; } LibraryFromObjects $(<) : $(objects) ; } local gGENERATOR_FUNCTION(LIB) = bgl-lib-file ; lib bgl-viz : ../src/$(SOURCES).cpp : <sysinclude>$(BOOST_ROOT) : debug <inlining>on #inlining prevents linker name clashes due to truncation! ; } ---boost-root/libs/graph/build/Jamfile--- 5. AFAICT the code doesn't compile even when passing in the required defines (non of the 3 compilers I tried in Windows compiles it). Possibly the code hasn't been updated to reflect the state of the parser files. -- I really can't do anything about that problem. It's not my code ;-) HTH. -- -- grafik -- Don't Assume Anything
I have successfully build the graphviz I/O module for BGL, though not with bjam. There is a Makefile in graph/src that does the trick. Angus Leeming wrote:
Dear all,
I'm a bjam newbie trying to build the BGL in boost 1.30.0 on a DEC Alpha running linux. However, the build process is failing to generate the graphviz parser and lexer:
$ cd libs/graph/build $ bjam "-sTOOLS=gcc" ...found 437 targets... ...using 2 temp targets... ...updating 3 targets... ...using
graphviz_graph_lex.o... ...using graphviz_digraph_lex.o... gcc-C++-action ../../../libs/graph/build/bin/liblibbgl-viz.a/gcc/debug/inlining-on/runtime-link-dynamic/graphviz_graph_parser.o graphviz_parser.y:44:2: #error Need to define the GRAPHVIZ_GRAPH macro to either GraphvizGraph or GraphvizDigraph. graphviz_parser.y:61: error: `GRAPHVIZ_GRAPH' was not declared in this scope graphviz_parser.y:61: error: template argument 1 is invalid graphviz_parser.y:61: error: syntax error before `;' token graphviz_parser.y:62: error: `GRAPHVIZ_GRAPH' was not declared in this scope graphviz_parser.y:62: error: template argument 1 is invalid graphviz_parser.y:62: error: syntax error before `;' token graphviz_parser.y:63: error: syntax error before `;' token [snip] This all seems very reasonable, but I do not know how to resolve the problem. I see that Jamfile.v2 has explicit rules to build graphviz_graph_lex.o, graphviz_digraph_lex.o, setting GRAPHVIZ_GRAPH appropriately. However, my version of bjam (3.1.4) does not understand Jamfile.v2 and I lack the knowledge to do the equivalent in Jamfile.
I did try to append some rules to the Jamfile(see below), but unsurprisingly without success.
Could anyone provide me with pointers on how to proceed?
Kind regards, Angus
Lex graphviz_graph_lex.cpp : graphviz_lex.l : <define>GRAPHVIZ_DIRECTED=0 <dependency>graphviz_graph_parser ;
Yacc graphviz_graph_parser.cpp : graphviz_parser.y : <define>GRAPHVIZ_DIRECTED=0 ;
Lex graphviz_digraph_lex.cpp : graphviz_lex.l : <define>GRAPHVIZ_DIRECTED=1 <dependency>graphviz_digraph_parser ;
Yacc graphviz_digraph_parser.cpp : graphviz_parser.y : <define>GRAPHVIZ_DIRECTED=1 ;
Object graphviz_graph_lex.o : graphviz_graph_lex.cpp ; Object graphviz_graph_parser.o : graphviz_graph_parser.cpp ; Object graphviz_digraph_lex.o : graphviz_digraph_lex.cpp ; Object graphviz_digraph_parser.o : graphviz_digraph_parser.cpp ;
*Yahoo! Groups Sponsor* ADVERTISEMENT http://rd.yahoo.com/M=244522.3656190.4921519.1261774/D=egroupweb/S=1705006788:HM/A=1595056/R=0/SIG=124ps9ikp/*http://ashnin.com/clk/muryutaitakenattogyo?YH=3656190&yhad=1595056
Info: http://www.boost.org Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/.
participants (4)
-
Angus Leeming
-
David Abrahams
-
Jeff Holle
-
Rene Rivera