Subject: Re: [boost] Cycle between Graph and GraphParallel
From: Marc Glisse (marc.glisse_at_[hidden])
Date: 2018-10-06 07:01:36
On Sat, 6 Oct 2018, Peter Dimov via Boost wrote:
> Currently we have a dependency cycle between `graph` and `graph_parallel`.
> It's not the only one, but it's notable with the fact that both libraries are
> buildable and we therefore can't ignore it as we can ignore cycles between
> header-only libraries that at release time become a single directory.
> In the particular, this impedes efforts to generate CMake config files. Under
> one scheme I'm currently working on, for instance, Boost.Python can't be
> installed because it tries to install Graph, which tries to install
> GraphParallel, which tries to install Graph.
> The cycle between these two is an interesting one.
> boost/graph/breadth_first_search.hpp does:
> #ifdef BOOST_GRAPH_USE_MPI
> # include <boost/graph/distributed/breadth_first_search.hpp>
> at its end, and boost/graph/distributed/breadth_first_search.hpp does:
> #ifndef BOOST_GRAPH_USE_MPI
> #error "Parallel BGL files should not be included unless
> <boost/graph/use_mpi.hpp> has been included"
> #include <boost/graph/breadth_first_search.hpp>
> at its very start. So these headers include each other.
> One would naively think that only the parallel header should include the
> normal one, but one is not well versed in graph library architectures, so one
> might quite possibly be missing something, or a lot.
I don't know why you are calling this a dependency. The file declares the
sequential stuff, and if the parallel version is available/requested
(BOOST_GRAPH_USE_MPI) makes it available as well. So you don't need the
parallel version to use the sequential one.
-- Marc Glisse
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk