BGL: Problem to compile components_on_edgelist.cpp example.

Hello, I cannot compile the components_on_edgelist.cpp example with gcc 4.5/4.2 and VC++2009. I am using Boost 1.42 It trows errors on
c:\boost\include\boost-1_42\boost\graph\incremental_components.hpp(178) : error C2825: 'ParentIterator': must be a class or namespace when followed by '::' 1> c:\boost\include\boost-1_42\boost\graph\incremental_components.hpp(141) : see reference to function template instantiation 'void boost::component_index<IndexType>::build_index_lists<ParentIterator,boost::typed_identity_property_map<T>>(ParentIterator,const ElementIndexMap &)' being compiled 1> with 1> [ 1> IndexType=int, 1> ParentIterator=const unsigned int *, 1> T=size_t, 1> ElementIndexMap=boost::typed_identity_property_map<size_t> 1> ] and more...
Are there some work around ? Actually I would like to construct disjoint sets based on vector<Edge>, where Edge is pair<uint, uint>. Thanks Arman. -- View this message in context: http://old.nabble.com/BGL%3A-Problem-to-compile-components_on_edgelist.cpp-e... Sent from the Boost - Users mailing list archive at Nabble.com.

On Wed, 5 May 2010, arm2arm wrote:
Hello, I cannot compile the components_on_edgelist.cpp example with gcc 4.5/4.2 and VC++2009. I am using Boost 1.42 It trows errors on
c:\boost\include\boost-1_42\boost\graph\incremental_components.hpp(178) : error C2825: 'ParentIterator': must be a class or namespace when followed by '::' 1> c:\boost\include\boost-1_42\boost\graph\incremental_components.hpp(141) : see reference to function template instantiation 'void boost::component_index<IndexType>::build_index_lists<ParentIterator,boost::typed_identity_property_map<T>>(ParentIterator,const ElementIndexMap &)' being compiled 1> with 1> [ 1> IndexType=int, 1> ParentIterator=const unsigned int *, 1> T=size_t, 1> ElementIndexMap=boost::typed_identity_property_map<size_t> 1> ] and more...
Are there some work around ?
Actually I would like to construct disjoint sets based on vector<Edge>, where Edge is pair<uint, uint>.
I fixed the various issues you are probably seeing with that example in the trunk just now; that version should work better. See if your code works with the new version. -- Jeremiah Willcock

I got the recent revision 61803. The compilation is ok but the code is crashing on the line: 72 incremental_components(g, ds); ------------- SNIP -------------------- libs/graph/example% ./components_on_edgelist.x An undirected graph (edge list): (0,1) (1,4) (4,0) (2,5) Segmentation fault ------------END SNIP------------------ SO, what is the reason? Thanks. Arman. On Wed, May 5, 2010 at 8:51 PM, Jeremiah Willcock <jewillco@osl.iu.edu>wrote:
On Wed, 5 May 2010, arm2arm wrote:
Hello, I cannot compile the components_on_edgelist.cpp example with gcc 4.5/4.2 and VC++2009. I am using Boost 1.42 It trows errors on
c:\boost\include\boost-1_42\boost\graph\incremental_components.hpp(178) :
error C2825: 'ParentIterator': must be a class or namespace when followed by '::' 1> c:\boost\include\boost-1_42\boost\graph\incremental_components.hpp(141) : see reference to function template instantiation 'void
boost::component_index<IndexType>::build_index_lists<ParentIterator,boost::typed_identity_property_map<T>>(ParentIterator,const ElementIndexMap &)' being compiled 1> with 1> [ 1> IndexType=int, 1> ParentIterator=const unsigned int *, 1> T=size_t, 1> ElementIndexMap=boost::typed_identity_property_map<size_t> 1> ] and more...
Are there some work around ?
Actually I would like to construct disjoint sets based on vector<Edge>, where Edge is pair<uint, uint>.
I fixed the various issues you are probably seeing with that example in the trunk just now; that version should work better. See if your code works with the new version.
-- Jeremiah Willcock
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- ------------------------------------------ Dr Arman Khalatyan, Observatoire Astronomique de Marseille-Provence Laboratoire d'Astrophysique de Marseille -----------------------------------------

On Thu, 6 May 2010, Arman Khalatyan wrote:
I got the recent revision 61803.The compilation is ok but the code is crashing on the line: 72 incremental_components(g, ds); ------------- SNIP -------------------- libs/graph/example% ./components_on_edgelist.x An undirected graph (edge list): (0,1) (1,4) (4,0) (2,5)
Segmentation fault ------------END SNIP------------------
SO, what is the reason?
I thought all of the array overruns were fixed -- I guess they might not have been. See if your symptoms are anything like what is in https://svn.boost.org/trac/boost/ticket/3250; if you can run valgrind, please see what it outputs. -- Jeremiah Willcock

Thanks for pointing it. The incremental_components is still broken. The bug is not fixed yet. Using valgrind I see it: An undirected graph (edge list): (0,1) (1,4) (4,0) (2,5) ==8635== Invalid read of size 8 ==8635== at 0x40201F: unsigned long boost::detail::find_representative_with_full_compression<unsigned long*, unsigned long>(unsigned long*, unsigned long) (disjoint_sets.hpp:33) ==8635== by 0x401A7E: unsigned long boost::find_with_full_path_compression::operator()<unsigned long*, unsigned long>(unsigned long*, unsigned long) (disjoint_sets.hpp:30) ==8635== by 0x401444: int boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression>::find_set<int>(int) (disjoint_sets.hpp:167) ==8635== by 0x401A2A: void boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression>::union_set<int>(int, int) (disjoint_sets.hpp:161) ==8635== by 0x40139D: void boost::incremental_components<boost::edge_list<std::pair<int, int>*, std::pair<int, int>, long, std::random_access_iterator_tag>, boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression> >(boost::edge_list<std::pair<int, int>*, std::pair<int, int>, long, std::random_access_iterator_tag>&, boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression>&) (incremental_components.hpp:59) ==8635== by 0x400DD2: main (components_on_edgelist.cpp:72) == On Thu, May 6, 2010 at 3:39 PM, Jeremiah Willcock <jewillco@osl.iu.edu>wrote:
On Thu, 6 May 2010, Arman Khalatyan wrote:
I got the recent revision 61803.The compilation is ok but the code is
crashing on the line: 72 incremental_components(g, ds); ------------- SNIP -------------------- libs/graph/example% ./components_on_edgelist.x An undirected graph (edge list): (0,1) (1,4) (4,0) (2,5)
Segmentation fault ------------END SNIP------------------
SO, what is the reason?
I thought all of the array overruns were fixed -- I guess they might not have been. See if your symptoms are anything like what is in https://svn.boost.org/trac/boost/ticket/3250; if you can run valgrind, please see what it outputs.
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- ------------------------------------------ Dr Arman Khalatyan, Observatoire Astronomique de Marseille-Provence Laboratoire d'Astrophysique de Marseille -----------------------------------------

On Thu, 6 May 2010, Arman Khalatyan wrote:
Thanks for pointing it. The incremental_components is still broken. The bug is not fixed yet. Using valgrind I see it:
An undirected graph (edge list): (0,1) (1,4) (4,0) (2,5)
==8635== Invalid read of size 8 ==8635== at 0x40201F: unsigned long boost::detail::find_representative_with_full_compression<unsigned long*, unsigned long>(unsigned long*, unsigned long) (disjoint_sets.hpp:33) ==8635== by 0x401A7E: unsigned long boost::find_with_full_path_compression::operator()<unsigned long*, unsigned long>(unsigned long*, unsigned long) (disjoint_sets.hpp:30) ==8635== by 0x401444: int boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression>::find_set<int>(int) (disjoint_sets.hpp:167) ==8635== by 0x401A2A: void boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression>::union_set<int>(int, int) (disjoint_sets.hpp:161) ==8635== by 0x40139D: void boost::incremental_components<boost::edge_list<std::pair<int, int>*, std::pair<int, int>, long, std::random_access_iterator_tag>, boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression> >(boost::edge_list<std::pair<int, int>*, std::pair<int, int>, long, std::random_access_iterator_tag>&, boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression>&) (incremental_components.hpp:59) ==8635== by 0x400DD2: main (components_on_edgelist.cpp:72) ==
Do you have a complete source file I can try out to reproduce this? -- Jeremiah Willcock

I took the code from boost-trunk/libs/graph/example/components_on_edgelist.cpp compiled with g++ components_on_edgelist.cpp -I/work2/arm2arm/SOFTWARE/BOOST-SVN/include/ -o components_on_edgelist.x and valgrind components_on_edgelist.x i did not change the components_on_edgelist.cpp file from svn. On Thu, May 6, 2010 at 7:00 PM, Jeremiah Willcock <jewillco@osl.iu.edu>wrote:
On Thu, 6 May 2010, Arman Khalatyan wrote:
Thanks for pointing it.
The incremental_components is still broken. The bug is not fixed yet. Using valgrind I see it:
An undirected graph (edge list): (0,1) (1,4) (4,0) (2,5)
==8635== Invalid read of size 8 ==8635== at 0x40201F: unsigned long boost::detail::find_representative_with_full_compression<unsigned long*, unsigned long>(unsigned long*, unsigned long) (disjoint_sets.hpp:33) ==8635== by 0x401A7E: unsigned long boost::find_with_full_path_compression::operator()<unsigned long*, unsigned long>(unsigned long*, unsigned long) (disjoint_sets.hpp:30) ==8635== by 0x401444: int boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression>::find_set<int>(int) (disjoint_sets.hpp:167) ==8635== by 0x401A2A: void boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression>::union_set<int>(int, int) (disjoint_sets.hpp:161) ==8635== by 0x40139D: void boost::incremental_components<boost::edge_list<std::pair<int, int>*, std::pair<int, int>, long, std::random_access_iterator_tag>, boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression> >(boost::edge_list<std::pair<int, int>*, std::pair<int, int>, long, std::random_access_iterator_tag>&, boost::disjoint_sets_with_storage<boost::typed_identity_property_map<unsigned long>, boost::typed_identity_property_map<unsigned long>, boost::find_with_full_path_compression>&) (incremental_components.hpp:59) ==8635== by 0x400DD2: main (components_on_edgelist.cpp:72) ==
Do you have a complete source file I can try out to reproduce this?
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- ------------------------------------------ Dr Arman Khalatyan, Observatoire Astronomique de Marseille-Provence Laboratoire d'Astrophysique de Marseille -----------------------------------------

On Thu, 6 May 2010, Arman Khalatyan wrote:
I took the code from boost-trunk/libs/graph/example/components_on_edgelist.cpp compiled with g++ components_on_edgelist.cpp -I/work2/arm2arm/SOFTWARE/BOOST-SVN/include/ -o components_on_edgelist.x and valgrind components_on_edgelist.x
i did not change the components_on_edgelist.cpp file from svn.
Update now -- I think I fixed it. The disjoint_sets structure was being created with a zero-length vector, and I changed it to use the number of vertices in the graph. -- Jeremiah Willcock

cool!!! thanks for fixing that. On Fri, May 7, 2010 at 7:19 PM, Jeremiah Willcock <jewillco@osl.iu.edu>wrote:
On Thu, 6 May 2010, Arman Khalatyan wrote:
I took the code from
boost-trunk/libs/graph/example/components_on_edgelist.cpp compiled with g++ components_on_edgelist.cpp -I/work2/arm2arm/SOFTWARE/BOOST-SVN/include/ -o components_on_edgelist.x and valgrind components_on_edgelist.x
i did not change the components_on_edgelist.cpp file from svn.
Update now -- I think I fixed it. The disjoint_sets structure was being created with a zero-length vector, and I changed it to use the number of vertices in the graph.
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- ------------------------------------------ Dr Arman Khalatyan, Observatoire Astronomique de Marseille-Provence Laboratoire d'Astrophysique de Marseille -----------------------------------------
participants (3)
-
arm2arm
-
Arman Khalatyan
-
Jeremiah Willcock