Commit 6d1810e1 authored by Tiago Peixoto's avatar Tiago Peixoto

Sync with boost 1.40

Fix compilation warnings with boost 1.40, remove unnecessary files, fix
autoconf macros and link with "boost_graph".

This also raises the minimum boost version to 1.40.
parent 3f400d2a
...@@ -156,7 +156,7 @@ AC_PYTHON_DEVEL([2.5]) ...@@ -156,7 +156,7 @@ AC_PYTHON_DEVEL([2.5])
[LDFLAGS="${LDFLAGS} ${PYTHON_LDFLAGS}"] [LDFLAGS="${LDFLAGS} ${PYTHON_LDFLAGS}"]
dnl boost dnl boost
AX_BOOST_BASE([1.33.1]) AX_BOOST_BASE([1.40.0])
AX_BOOST_PYTHON AX_BOOST_PYTHON
if test "$BOOST_PYTHON_LIB" = ""; then if test "$BOOST_PYTHON_LIB" = ""; then
AC_MSG_ERROR([No usable boost::python found]) AC_MSG_ERROR([No usable boost::python found])
...@@ -169,6 +169,10 @@ AX_BOOST_REGEX ...@@ -169,6 +169,10 @@ AX_BOOST_REGEX
if test "$BOOST_REGEX_LIB" = ""; then if test "$BOOST_REGEX_LIB" = ""; then
AC_MSG_ERROR([No usable boost::regex found]) AC_MSG_ERROR([No usable boost::regex found])
fi fi
AX_BOOST_GRAPH
if test "$BOOST_GRAPH_LIB" = ""; then
AC_MSG_ERROR([No usable boost::graph found])
fi
[CPPFLAGS="${CPPFLAGS} ${BOOST_CPPFLAGS}"] [CPPFLAGS="${CPPFLAGS} ${BOOST_CPPFLAGS}"]
dnl Checks for header files. dnl Checks for header files.
...@@ -276,7 +280,7 @@ AC_SUBST(MOD_DIR) ...@@ -276,7 +280,7 @@ AC_SUBST(MOD_DIR)
# default LIBADD flags for submodules # default LIBADD flags for submodules
[MOD_LIBADD="${PYTHON_LDFLAGS} ${BOOST_IOSTREAMS_LIB} -l${BOOST_PYTHON_LIB} \ [MOD_LIBADD="${PYTHON_LDFLAGS} ${BOOST_IOSTREAMS_LIB} -l${BOOST_PYTHON_LIB} \
${BOOST_REGEX_LIB} ${OPENMP_LDFLAGS} -lexpat"] ${BOOST_REGEX_LIB} -l${BOOST_GRAPH_LIB} ${OPENMP_LDFLAGS} -lexpat"]
AC_SUBST(MOD_LIBADD) AC_SUBST(MOD_LIBADD)
# needed for typeinfo objects to work across DSO boundaries. # needed for typeinfo objects to work across DSO boundaries.
......
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_graph.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_GRAPH
#
# DESCRIPTION
#
# This macro checks to see if the Boost.Graph library is installed. It
# also attempts to guess the currect library name using several attempts.
# It tries to build the library name using a user supplied name or suffix
# and then just the raw library.
#
# If the library is found, HAVE_BOOST_GRAPH is defined and
# BOOST_GRAPH_LIB is set to the name of the library.
#
# This macro calls AC_SUBST(BOOST_GRAPH_LIB).
#
# In order to ensure that the Graph headers are specified on the include
# path, this macro requires AX_GRAPH to be called.
#
# LAST MODIFICATION
#
# 2008-04-12
#
# COPYLEFT
#
# Copyright (c) 2008 Michael Tindal
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Macro Archive. When you make and
# distribute a modified version of the Autoconf Macro, you may extend this
# special exception to the GPL to apply to your modified version as well.
AC_DEFUN([AX_BOOST_GRAPH],
[AC_CACHE_CHECK(whether the Boost::Graph library is available,
ac_cv_boost_graph,
[AC_LANG_SAVE
AC_LANG_CPLUSPLUS
CPPFLAGS_SAVE=$CPPFLAGS
if test "x$GRAPH_INCLUDE_DIR" != "x"; then
CPPFLAGS="-I$GRAPH_INCLUDE_DIR $CPPFLAGS"
fi
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
#include <boost/graph/adjacency_list.hpp>
using namespace boost;
adjacency_list<> g;
]],
[[return 0;]]),
ac_cv_boost_graph=yes, ac_cv_boost_graph=no)
AC_LANG_RESTORE
CPPFLAGS="$CPPFLAGS_SAVE"
])
if test "$ac_cv_boost_graph" = "yes"; then
AC_DEFINE(HAVE_BOOST_GRAPH,,[define if the Boost::Graph library is available])
ax_graph_lib=boost_graph
AC_ARG_WITH([boost-graph],AS_HELP_STRING([--with-boost-graph],[specify the boost graph library or suffix to use]),
[if test "x$with_boost_graph" != "xno"; then
ax_graph_lib=$with_boost_graph
ax_boost_graph_lib=boost_graph-$with_boost_graph
fi])
for ax_lib in $ax_graph_lib $ax_boost_graph_lib boost_graph boost_graph-mt boost_graph-mt-py2.5; do
AC_CHECK_LIB($ax_lib, exit, [BOOST_GRAPH_LIB=$ax_lib break])
done
AC_SUBST(BOOST_GRAPH_LIB)
fi
])dnl
...@@ -80,7 +80,7 @@ AC_DEFUN([AX_BOOST_IOSTREAMS], ...@@ -80,7 +80,7 @@ AC_DEFUN([AX_BOOST_IOSTREAMS],
AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available]) AC_DEFINE(HAVE_BOOST_IOSTREAMS,,[define if the Boost::IOStreams library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_iostreams_lib" = "x"; then if test "x$ax_boost_user_iostreams_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_iostreams*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_iostreams.*\)\.so.*$;\1;' -e 's;^lib\(boost_iostreams.*\)\.a*$;\1;'` ; do for libextension in `ls $BOOSTLIBDIR/libboost_iostreams*.{so,a}* 2>/dev/null | sort -r | sed 's,.*/,,' | sed -e 's;^lib\(boost_iostreams.*\)\.so.*$;\1;' -e 's;^lib\(boost_iostreams.*\)\.a*$;\1;'` ; do
ax_lib=${libextension} ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit, AC_CHECK_LIB($ax_lib, exit,
[BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break], [BOOST_IOSTREAMS_LIB="-l$ax_lib"; AC_SUBST(BOOST_IOSTREAMS_LIB) link_iostreams="yes"; break],
......
...@@ -72,7 +72,7 @@ AC_DEFUN([AX_BOOST_REGEX], ...@@ -72,7 +72,7 @@ AC_DEFUN([AX_BOOST_REGEX],
AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available]) AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_regex_lib" = "x"; then if test "x$ax_boost_user_regex_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_regex*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.a*$;\1;'` ; do for libextension in `ls $BOOSTLIBDIR/libboost_regex*.{so,a}* 2>/dev/null | sort -r | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.a*$;\1;'` ; do
ax_lib=${libextension} ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit, AC_CHECK_LIB($ax_lib, exit,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
......
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
#include <boost/type_traits/is_convertible.hpp> #include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
#include <boost/property_map.hpp> #include <boost/property_map/property_map.hpp>
#include <boost/graph/named_function_params.hpp> #include <boost/graph/named_function_params.hpp>
#include <algorithm> #include <algorithm>
#include <boost/vector_property_map.hpp> #include <boost/property_map/vector_property_map.hpp>
namespace boost { namespace boost {
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include <boost/config.hpp> #include <boost/config.hpp>
#include <vector> #include <vector>
#include <boost/graph/graph_traits.hpp> #include <boost/graph/graph_traits.hpp>
#include <boost/property_map.hpp> #include <boost/property_map/property_map.hpp>
#include <boost/graph/named_function_params.hpp> #include <boost/graph/named_function_params.hpp>
#include <boost/graph/breadth_first_search.hpp> #include <boost/graph/breadth_first_search.hpp>
#include <boost/type_traits/conversion_traits.hpp> #include <boost/type_traits/conversion_traits.hpp>
......
// Copyright 2004-9 Trustees of Indiana University
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// read_graphviz_new.hpp -
// Initialize a model of the BGL's MutableGraph concept and an associated
// collection of property maps using a graph expressed in the GraphViz
// DOT Language.
//
// Based on the grammar found at:
// http://www.graphviz.org/cvs/doc/info/lang.html
//
// Jeremiah rewrite used grammar found at:
// http://www.graphviz.org/doc/info/lang.html
// and page 34 or http://www.graphviz.org/pdf/dotguide.pdf
//
// See documentation for this code at:
// http://www.boost.org/libs/graph/doc/read-graphviz.html
//
// Author: Jeremiah Willcock
// Ronald Garcia
//
#ifndef BOOST_READ_GRAPHVIZ_NEW_HPP
#define BOOST_READ_GRAPHVIZ_NEW_HPP
#include <boost/ref.hpp>
#include <boost/dynamic_property_map.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/detail/workaround.hpp>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <utility>
#include <map>
#include <iostream>
#include <cstdlib>
namespace boost {
namespace read_graphviz_detail {
typedef std::string node_name;
typedef std::string subgraph_name;
typedef std::map<std::string, std::string> properties;
struct node_and_port {
node_name name;
std::string angle; // Or empty if no angle
std::vector<std::string> location; // Up to two identifiers
friend inline bool operator==(const node_and_port& a, const node_and_port& b) {
return a.name == b.name &&
a.angle == b.angle &&
a.location == b.location;
}
friend inline bool operator<(const node_and_port& a, const node_and_port& b) {
if (a.name != b.name) return a.name < b.name;
if (a.angle != b.angle) return a.angle < b.angle;
return a.location < b.location;
}
};
struct edge_info {
node_and_port source;
node_and_port target;
properties props;
};
struct parser_result {
bool graph_is_directed;
bool graph_is_strict;
std::map<node_name, properties> nodes; // Global set
std::vector<edge_info> edges;
std::map<subgraph_name, properties> graph_props; // Root and subgraphs
};
// The actual parser, from libs/graph/src/read_graphviz_new.cpp
void parse_graphviz_from_string(const std::string& str, parser_result& result, bool want_directed);
// Translate from those results to a graph
void translate_results_to_graph(const parser_result& r, ::boost::detail::graph::mutate_graph* mg);
} // namespace read_graphviz_detail
// This is also in boost/graph/graphviz.hpp
namespace detail {
namespace graph {
BOOST_GRAPH_DECL bool read_graphviz(const std::string& str, boost::detail::graph::mutate_graph* mg);
} // end namespace graph
} // end namespace detail
template <typename MutableGraph>
bool read_graphviz(const std::string& str,
MutableGraph& graph, boost::dynamic_properties& dp,
std::string const& node_id = "node_id") {
boost::detail::graph::mutate_graph_impl<MutableGraph> mg(graph, dp, node_id);
return detail::graph::read_graphviz(str, &mg);
}
template <typename InputIter, typename MutableGraph>
bool read_graphviz(InputIter begin, InputIter end,
MutableGraph& graph, boost::dynamic_properties& dp,
std::string const& node_id = "node_id") {
return read_graphviz(std::string(begin, end), graph, dp, node_id);
}
} // namespace boost
#endif // BOOST_READ_GRAPHVIZ_NEW_HPP
This diff is collapsed.
...@@ -30,16 +30,12 @@ libgraph_tool_core_la_SOURCES = \ ...@@ -30,16 +30,12 @@ libgraph_tool_core_la_SOURCES = \
graph_python_interface_export.cc \ graph_python_interface_export.cc \
graph_selectors.cc \ graph_selectors.cc \
graphml.cpp\ graphml.cpp\
read_graphviz_spirit.cpp\
read_graphviz_new.cpp\ read_graphviz_new.cpp\
../boost-workaround/boost/graph/filtered_graph.hpp\ ../boost-workaround/boost/graph/filtered_graph.hpp\
../boost-workaround/boost/graph/graphml.hpp\ ../boost-workaround/boost/graph/graphml.hpp\
../boost-workaround/boost/graph/betweenness_centrality.hpp\ ../boost-workaround/boost/graph/betweenness_centrality.hpp\
../boost-workaround/boost/graph/copy.hpp\ ../boost-workaround/boost/graph/copy.hpp\
../boost-workaround/boost/graph/overloading.hpp\ ../boost-workaround/boost/graph/overloading.hpp\
../boost-workaround/boost/graph/graphviz.hpp\
../boost-workaround/boost/graph/detail/read_graphviz_new.hpp\
../boost-workaround/boost/graph/detail/read_graphviz_spirit.hpp\
../boost-workaround/boost/graph/isomorphism.hpp\ ../boost-workaround/boost/graph/isomorphism.hpp\
../boost-workaround/boost/graph/fruchterman_reingold.hpp\ ../boost-workaround/boost/graph/fruchterman_reingold.hpp\
../boost-workaround/boost/graph/kamada_kawai_spring_layout.hpp ../boost-workaround/boost/graph/kamada_kawai_spring_layout.hpp
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#ifndef FAST_VECTOR_PROPERTY_MAP_HH #ifndef FAST_VECTOR_PROPERTY_MAP_HH
#define FAST_VECTOR_PROPERTY_MAP_HH #define FAST_VECTOR_PROPERTY_MAP_HH
#include <boost/property_map.hpp> #include <boost/property_map/property_map.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <vector> #include <vector>
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <tr1/unordered_set> #include <tr1/unordered_set>
#include <tr1/random> #include <tr1/random>
#include <boost/functional/hash.hpp> #include <boost/functional/hash.hpp>
#include <boost/vector_property_map.hpp>
#include "graph.hh" #include "graph.hh"
#include "graph_filtering.hh" #include "graph_filtering.hh"
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <tr1/unordered_set> #include <tr1/unordered_set>
#include <tr1/random> #include <tr1/random>
#include <boost/functional/hash.hpp> #include <boost/functional/hash.hpp>
#include <boost/vector_property_map.hpp>
#include "graph.hh" #include "graph.hh"
#include "graph_filtering.hh" #include "graph_filtering.hh"
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <boost/graph/adjacency_list.hpp> #include <boost/graph/adjacency_list.hpp>
#include "fast_vector_property_map.hh" #include "fast_vector_property_map.hh"
#include <boost/dynamic_property_map.hpp>
#include <boost/variant.hpp> #include <boost/variant.hpp>
#include <boost/python/object.hpp> #include <boost/python/object.hpp>
#include <boost/python/dict.hpp> #include <boost/python/dict.hpp>
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
#include <tr1/memory> #include <tr1/memory>
#include <boost/python/object.hpp> #include <boost/python/object.hpp>
#include <boost/property_map.hpp> #include <boost/property_map/property_map.hpp>
#include <boost/dynamic_property_map.hpp> #include <boost/property_map/dynamic_property_map.hpp>
#include "fast_vector_property_map.hh" #include "fast_vector_property_map.hh"
#include <boost/functional/hash.hpp> #include <boost/functional/hash.hpp>
#include <boost/mpl/vector.hpp> #include <boost/mpl/vector.hpp>
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <boost/mpl/find.hpp> #include <boost/mpl/find.hpp>
#include <boost/mpl/not.hpp> #include <boost/mpl/not.hpp>
#include <boost/mpl/logical.hpp> #include <boost/mpl/logical.hpp>
#include <boost/dynamic_property_map.hpp>
#include "graph_adaptor.hh" #include "graph_adaptor.hh"
#include "graph_properties.hh" #include "graph_properties.hh"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <boost/ref.hpp> #include <boost/ref.hpp>
#include <boost/function/function2.hpp> #include <boost/function/function2.hpp>
#include <boost/dynamic_property_map.hpp> #include <boost/property_map/dynamic_property_map.hpp>
#include <boost/graph/graph_traits.hpp> #include <boost/graph/graph_traits.hpp>
#include <boost/detail/workaround.hpp> #include <boost/detail/workaround.hpp>
#include <boost/algorithm/string/case_conv.hpp> #include <boost/algorithm/string/case_conv.hpp>
......
// Copyright 2004-5 Trustees of Indiana University
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// read_graphviz_spirit.hpp -
// Initialize a model of the BGL's MutableGraph concept and an associated
// collection of property maps using a graph expressed in the GraphViz
// DOT Language.
//
// Based on the grammar found at:
// http://www.graphviz.org/cvs/doc/info/lang.html
//
// See documentation for this code at:
// http://www.boost.org/libs/graph/doc/read-graphviz.html
//
// Authors: Ronald Garcia and Douglas Gregor
//
#define BOOST_GRAPH_SOURCE
#ifndef BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS
# define BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS
#endif
#include <boost/graph/graphviz.hpp>
#include <iostream>
namespace boost { namespace detail { namespace graph {
BOOST_GRAPH_DECL
bool read_graphviz(std::istream& in, mutate_graph& graph)
{
using namespace boost;
typedef std::istream_iterator<char> is_t;
std::string str((is_t(in)), is_t());
return read_graphviz(str, &graph);
}
} } } // end namespace boost::detail::graph
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment