Re: [Boost-users] boost graph library with gcc 4.2 and later (Andrew Sutton)
Hi,
Below is the details of my problem:
gcc version and system: g++ (Debian 4.3.1-9) 4.3.1
I tried to compile the graph example (boost/libs/graph/example/graph.cpp)
using the following command:
g++ -Wall -I /cs/phd/freiman/include/boost_1_36_0 graph.cpp -o graph
and got the following message about deprecated headers:
---------------------------------------- OUTPUT
-------------------------------------------------
In file included from /usr/include/c++/4.3/backward/hash_set:64,
from
/cs/phd/freiman/include/boost_1_36_0/boost/graph/adjacency_list.hpp:22,
from graph.cpp:15:
/usr/include/c++/4.3/backward/backward_warning.h:33: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.
---------------------------------------- END OF OUTPUT
--------------------------------------------------
The running of this file was o.k.
When I tried to compile the kolmogorov max-flow example
(boost/libs/graph/example/kolmogorov-eg.cpp) using the following command:
g++ -Wall -I /cs/phd/freiman/include/boost_1_36_0 kolmogorov-eg.cpp -o
kolmogorov-eg
I got the following:
-------------------------------------- OUTPUT
------------------------------------------------------
In file included from /usr/include/c++/4.3/backward/hash_set:64,
from
/cs/phd/freiman/include/boost_1_36_0/boost/graph/adjacency_list.hpp:22,
from kolmogorov-eg.cpp:36:
/usr/include/c++/4.3/backward/backward_warning.h:33: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.
In file included from kolmogorov-eg.cpp:37:
/cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp: In
function 'int boost::read_dimacs_max_flow(Graph&, CapacityMap,
ReverseEdgeMap, typename boost::graph_traits<G>::vertex_descriptor&,
typename boost::graph_traits<G>::vertex_descriptor&, std::istream&)':
/cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:140: error:
there are no arguments to 'strcmp' that depend on a template parameter, so a
declaration of 'strcmp' must be available
/cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:140: error:
(if you use '-fpermissive', G++ will accept your code, but allowing the use
of an undeclared name is deprecated)
/cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp: In
function 'int boost::read_dimacs_max_flow(Graph&, CapacityMap,
ReverseEdgeMap, typename boost::graph_traits<G>::vertex_descriptor&,
typename boost::graph_traits<G>::vertex_descriptor&, std::istream&) [with
Graph = main()::Graph, CapacityMap =
boost::adj_list_edge_property_map
Date: Tue, 28 Oct 2008 18:50:48 -0400 From: "Andrew Sutton"
Subject: Re: [Boost-users] boost graph library with gcc 4.2 and later To: boost-users@lists.boost.org Message-ID: Content-Type: text/plain; charset="iso-8859-1" I'm a newbie to boost and have a storng interest in the graph algorithms
in
boost.
I tried to run both kolmogorov and edmund-karp examples and got many
warnings due to deprecated conversions in the read_dimacs function When I tried to run these examples I got segmentation faults. Other simple program (from boost homepage) that I tried to compile and run, run well. Is there any known issue about using boost with gcc 4 and later?
You need to be more specific about the errors system that you're building for and the errors that you're getting. Which version of Boost? Which compiler (very specifically)? What are the warnings? Can you tell what's causing the error?
Andrew Sutton andrew.n.sutton@gmail.com
-- __ Moti Freiman, Ph.D Student. Medical Image Processing and Computer-Assisted Surgery Laboratory. School of Computer Science and Engineering. The Hebrew University of Jerusalem Givat Ram, Jerusalem 91904, Israel Phone: +(972)-2-658-5371 (laboratory) WWW site: http://www.cs.huji.ac.il/~freiman
Hi Moti, I am also on Debian and just went up to lenny recently, which also upgraded the C++ compiler. I can confirm that I also got the deprecated header warning (just noticed it an hour ago, actually, so your e-mail timing was perfect :-) ) because of the "hash_set" header. Like the example, it wasn't because I explicitly included it, but because I am using an adjacency list. I did, however, do what the warning said and added -Wno-deprecated. I took a look at "backward_warning.h" and realized that I would never directly use those files, so it was fine to turn off the warning. It will compile and run fine...it's just a warning. As for your other problem, I will let someone who isn't a newbie with Boost Graph help you with that... Ray Moti Freiman wrote:
Hi, Below is the details of my problem:
gcc version and system: g++ (Debian 4.3.1-9) 4.3.1
I tried to compile the graph example (boost/libs/graph/example/graph.cpp) using the following command: g++ -Wall -I /cs/phd/freiman/include/boost_1_36_0 graph.cpp -o graph
and got the following message about deprecated headers: ---------------------------------------- OUTPUT ------------------------------------------------- In file included from /usr/include/c++/4.3/backward/hash_set:64, from /cs/phd/freiman/include/boost_1_36_0/boost/graph/adjacency_list.hpp:22, from graph.cpp:15: /usr/include/c++/4.3/backward/backward_warning.h:33: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. ---------------------------------------- END OF OUTPUT --------------------------------------------------
which has error due to the strcmp function in line 140 in the file: read_dimacs.hpp
I added the required header file (string.h) and only the warnings remain.
When I tried to run this example using the following command:
kolmogorov-eg < max_flow.dat
I got a segmentation fault:
I tried to understand where the seg. fault came from using valgrind and it runs without seg. fault but with many "invalid read" errors, that seems to come from the file read_dimacs.hpp, line 118
Using the same code with WinXP and visual studio 2003, yields no problems.
Any idea?
Not really :) Part of the problem may be with using GCC-4.3. I don't believe that its fully supported by Boost.Config. As you can see 4.3 starts deprecating the old hash_* headers, and the BGL uses these in a number of places - or pulls them through some other header. It's a non-trivial job to fix this. Any chance you'd be interested in downgrading your compiler :) 4.2.x seems to works nicely. You should file a ticket over at svn.boost.org with exactly this information, and I'll try to take a look at it sometime this week. Andrew Sutton andrew.n.sutton@gmail.com
Hi ! An'n Mittwoch 29 Oktober 2008 hett Andrew Sutton schreven:
Not really :) Part of the problem may be with using GCC-4.3. I don't believe that its fully supported by Boost.Config. As you can see 4.3 starts deprecating the old hash_* headers, and the BGL uses these in a number of places - or pulls them through some other header. It's a non-trivial job to fix this. Any chance you'd be interested in downgrading your compiler :) 4.2.x seems to works nicely.
Simply #define BOOST_NO_HASH. This will disable hash_* support of the BGL and thus silence the warnings. I've done this here.
You should file a ticket over at svn.boost.org with exactly this information, and I'll try to take a look at it sometime this week.
That would be nice if Boost.Config could detect this. Unfortunately, the new headers are only available with --std=cxx0x and this opens a new can of worms... Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! Ingenieurgesellschaft für * voice: ++49 511 262926 57 ! Verkehrs- und Eisenbahnwesen mbH * fax : ++49 511 262926 99 ! Lister Straße 15 * juergen.hunold@ivembh.de ! www.ivembh.de * * Geschäftsführer: ! Sitz des Unternehmens: Hannover * Prof. Dr.-Ing. Thomas Siefer ! Amtsgericht Hannover, HRB 56965 * PD Dr.-Ing. Alfons Radtke !
participants (4)
-
Andrew Sutton
-
Jürgen Hunold
-
Moti Freiman
-
Raymond Wan