From b9f16e9ab840ee4bbab61cc4e047a07fee33075f Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Thu, 29 Mar 2018 11:05:17 -0700 Subject: [PATCH 1/7] build: use AX_BOOST_GRAPH macro Problem: --with-boost=path has no effect on the search location for libboost_graph.so. boost_graph is found with AC_CHECK_LIB, while the rest of boost is found with purpose-build autoconf macros. The macro for boost_graph is included but not used. Call AX_BOOST_GRAPH and adjust Makefiles accordingly. --- configure.ac | 6 +----- resource/Makefile.am | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 06b24f41b..00a5a77f4 100644 --- a/configure.ac +++ b/configure.ac @@ -53,11 +53,7 @@ AX_FLUX_CORE AX_BOOST_BASE([1.53.0], [], [AC_MSG_ERROR([Please install boost >= 1.53)])]) AX_BOOST_SYSTEM AX_BOOST_FILESYSTEM -AC_CHECK_LIB([boost_graph], [exit], - [AC_SUBST([BOOST_GRAPH_LIB], ["-lboost_graph"]) - AC_DEFINE([HAVE_BOOST_GRRAPH], [1], - [Define if you have boost_graph])], - [AC_MSG_ERROR([Please install Boost Graph library])]) +AX_BOOST_GRAPH PKG_CHECK_MODULES([JOBSPEC], [flux-jobspec], [], []) AC_CHECK_LIB([readline], [readline], [AC_SUBST([READLINE_LIBS], ["-lreadline"]) diff --git a/resource/Makefile.am b/resource/Makefile.am index 9241774f2..a1a05ad52 100644 --- a/resource/Makefile.am +++ b/resource/Makefile.am @@ -4,7 +4,8 @@ AM_CXXFLAGS = \ AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) -AM_CPPFLAGS = -I$(top_srcdir) $(CZMQ_CFLAGS) $(FLUX_CORE_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir) $(CZMQ_CFLAGS) $(FLUX_CORE_CFLAGS) \ + $(BOOST_CPPFLAGS) SUBDIRS = planner . From d8f3f2d04eebba52ae681a2cb31bf836df313452 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Fri, 30 Mar 2018 13:49:43 -0700 Subject: [PATCH 2/7] build: fix bug in AX_BOOST_GRAPH macro Problem: AX_BOOST_GRAPH, in its search for the graph library, matches libboost_graph_parallel.so over libboost_graph.so, but graph_parallel is not a replacement for graph. Alter the glob used so that it doesn't match graph_parallel. --- m4/ax_boost_graph.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/ax_boost_graph.m4 b/m4/ax_boost_graph.m4 index 77f2f5142..eb30b2a0d 100644 --- a/m4/ax_boost_graph.m4 +++ b/m4/ax_boost_graph.m4 @@ -81,7 +81,7 @@ AC_DEFUN([AX_BOOST_GRAPH], AC_DEFINE(HAVE_BOOST_GRAPH,,[define if the Boost::Graph library is available]) BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` if test "x$ax_boost_user_graph_lib" = "x"; then - for libextension in `ls -r $BOOSTLIBDIR/libboost_graph* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do + for libextension in `ls -r $BOOSTLIBDIR/libboost_graph.* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do ax_lib=${libextension} AC_CHECK_LIB($ax_lib, exit, [BOOST_GRAPH_LIB="-l$ax_lib"; AC_SUBST(BOOST_GRAPH_LIB) link_graph="yes"; break], From 8a4b016c4b39938cf8a3041d8b006b163d02c3cc Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Thu, 29 Mar 2018 11:45:57 -0700 Subject: [PATCH 3/7] build: [g++-5.4.0] suppress boost warnings Problem: sched fails to compile with gcc-5.4.0 and boost-1.53 due to excessive compiler warnings that are treated as errors. Suppress the following warnings completely: unused-local-typedefs deprecated-declarations unused-variable maybe-uninitialized --- resource/Makefile.am | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resource/Makefile.am b/resource/Makefile.am index a1a05ad52..b6a0ec3f2 100644 --- a/resource/Makefile.am +++ b/resource/Makefile.am @@ -1,5 +1,9 @@ AM_CXXFLAGS = \ $(WARNING_CXXFLAGS) \ + -Wno-unused-local-typedefs \ + -Wno-deprecated-declarations \ + -Wno-unused-variable \ + -Wno-maybe-uninitialized \ $(CODE_COVERAGE_CXXFLAGS) AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) From cb1d0f9801e0fc32f0918bf6304b67af1eeed5ea Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Thu, 29 Mar 2018 12:04:05 -0700 Subject: [PATCH 4/7] build: add AX_BOOST_REGEX Problem: boost_regex library, apparently a dependency of boost_graph, cannot be found during linkage. Add AX_BOOST_REGEX macro and adjust Makefile.am accordingly. --- configure.ac | 1 + m4/ax_boost_regex.m4 | 111 +++++++++++++++++++++++++++++++++++++++++++ resource/Makefile.am | 6 ++- 3 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 m4/ax_boost_regex.m4 diff --git a/configure.ac b/configure.ac index 00a5a77f4..301822d13 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,7 @@ AX_BOOST_BASE([1.53.0], [], [AC_MSG_ERROR([Please install boost >= 1.53)])]) AX_BOOST_SYSTEM AX_BOOST_FILESYSTEM AX_BOOST_GRAPH +AX_BOOST_REGEX PKG_CHECK_MODULES([JOBSPEC], [flux-jobspec], [], []) AC_CHECK_LIB([readline], [readline], [AC_SUBST([READLINE_LIBS], ["-lreadline"]) diff --git a/m4/ax_boost_regex.m4 b/m4/ax_boost_regex.m4 new file mode 100644 index 000000000..e2413c24f --- /dev/null +++ b/m4/ax_boost_regex.m4 @@ -0,0 +1,111 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_boost_regex.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_REGEX +# +# DESCRIPTION +# +# Test for Regex library from the Boost C++ libraries. The macro requires +# a preceding call to AX_BOOST_BASE. Further documentation is available at +# . +# +# This macro calls: +# +# AC_SUBST(BOOST_REGEX_LIB) +# +# And sets: +# +# HAVE_BOOST_REGEX +# +# LICENSE +# +# Copyright (c) 2008 Thomas Porschberg +# Copyright (c) 2008 Michael Tindal +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 23 + +AC_DEFUN([AX_BOOST_REGEX], +[ + AC_ARG_WITH([boost-regex], + AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@], + [use the Regex library from boost - it is possible to specify a certain library for the linker + e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]), + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ax_boost_user_regex_lib="" + else + want_boost="yes" + ax_boost_user_regex_lib="$withval" + fi + ], + [want_boost="yes"] + ) + + if test "x$want_boost" = "xyes"; then + AC_REQUIRE([AC_PROG_CC]) + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_CACHE_CHECK(whether the Boost::Regex library is available, + ax_cv_boost_regex, + [AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include + ]], + [[boost::regex r(); return 0;]])], + ax_cv_boost_regex=yes, ax_cv_boost_regex=no) + AC_LANG_POP([C++]) + ]) + if test "x$ax_cv_boost_regex" = "xyes"; then + AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available]) + BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'` + if test "x$ax_boost_user_regex_lib" = "x"; then + for libextension in `ls $BOOSTLIBDIR/libboost_regex*.so* $BOOSTLIBDIR/libboost_regex*.dylib* $BOOSTLIBDIR/libboost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.dylib.*;\1;' -e 's;^lib\(boost_regex.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], + [link_regex="no"]) + done + if test "x$link_regex" != "xyes"; then + for libextension in `ls $BOOSTLIBDIR/boost_regex*.dll* $BOOSTLIBDIR/boost_regex*.a* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a.*$;\1;'` ; do + ax_lib=${libextension} + AC_CHECK_LIB($ax_lib, exit, + [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], + [link_regex="no"]) + done + fi + + else + for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do + AC_CHECK_LIB($ax_lib, main, + [BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break], + [link_regex="no"]) + done + fi + if test "x$ax_lib" = "x"; then + AC_MSG_ERROR(Could not find a version of the Boost::Regex library!) + fi + if test "x$link_regex" != "xyes"; then + AC_MSG_ERROR(Could not link against $ax_lib !) + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + fi +]) diff --git a/resource/Makefile.am b/resource/Makefile.am index b6a0ec3f2..54b736500 100644 --- a/resource/Makefile.am +++ b/resource/Makefile.am @@ -30,7 +30,8 @@ utilities_grug2dot_CXXFLAGS = \ utilities_grug2dot_LDADD = \ $(BOOST_SYSTEM_LIB) \ $(BOOST_FILESYSTEM_LIB) \ - $(BOOST_GRAPH_LIB) + $(BOOST_GRAPH_LIB) \ + $(BOOST_REGEX_LIB) #. # resource-query @@ -64,5 +65,6 @@ utilities_resource_query_LDADD = \ $(READLINE_LIBS) \ $(BOOST_SYSTEM_LIB) \ $(BOOST_FILESYSTEM_LIB) \ - $(BOOST_GRAPH_LIB) + $(BOOST_GRAPH_LIB) \ + $(BOOST_REGEX_LIB) From db5281694eae6fefad8fc77795c42b7665458fb7 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Thu, 29 Mar 2018 12:05:33 -0700 Subject: [PATCH 5/7] build: add BOOST_LDFLAGS Problem: cannot find boost libraries when building test executables. When linking against a side installed boost, $(BOOST_LDFLAGS) is required. Add it. --- resource/Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resource/Makefile.am b/resource/Makefile.am index 54b736500..40d79b4a4 100644 --- a/resource/Makefile.am +++ b/resource/Makefile.am @@ -6,7 +6,8 @@ AM_CXXFLAGS = \ -Wno-maybe-uninitialized \ $(CODE_COVERAGE_CXXFLAGS) -AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) +AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) \ + $(BOOST_LDFLAGS) AM_CPPFLAGS = -I$(top_srcdir) $(CZMQ_CFLAGS) $(FLUX_CORE_CFLAGS) \ $(BOOST_CPPFLAGS) From 61e9b8e872157dc3233c5ea500b20d1a0436906a Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Thu, 29 Mar 2018 14:47:26 -0700 Subject: [PATCH 6/7] resource: [cleanup] avoid 'using namespace boost' Problem: with g++ 5.4.0, the integer types in stdint.h (or cstdint) have the same names as types defined within boost, resulting in "ambiguous type" errors. Avoid 'using namespace boost' in Flux code. Instead, prefix all boost symbols with boost:: --- resource/dfu_match_id_based.hpp | 6 ++-- resource/resource_gen.cpp | 11 ++++--- resource/resource_gen_spec.cpp | 7 ++--- resource/resource_gen_spec.hpp | 40 +++++++++++++------------- resource/resource_graph.hpp | 38 ++++++++++++------------- resource/utilities/grug2dot.cpp | 3 +- resource/utilities/resource-query.cpp | 41 +++++++++++++-------------- 7 files changed, 68 insertions(+), 78 deletions(-) diff --git a/resource/dfu_match_id_based.hpp b/resource/dfu_match_id_based.hpp index c44284622..dfb109e3f 100644 --- a/resource/dfu_match_id_based.hpp +++ b/resource/dfu_match_id_based.hpp @@ -216,7 +216,6 @@ class greater_interval_first_t : public dfu_match_cb_t const std::vector &resources, const f_resource_graph_t &g, scoring_api_t &dfu) { - using namespace boost; using namespace boost::icl; int score = MATCH_MET; fold::interval_greater comp; @@ -230,7 +229,7 @@ class greater_interval_first_t : public dfu_match_cb_t break; } dfu.transform (subsystem, type, - icl::inserter (comp.ivset, comp.ivset.end ()), + boost::icl::inserter (comp.ivset, comp.ivset.end ()), fold::to_interval); dfu.choose_accum_best_k (subsystem, type, count, comp); } @@ -242,7 +241,6 @@ class greater_interval_first_t : public dfu_match_cb_t const std::vector &resources, const f_resource_graph_t &g, scoring_api_t &dfu) { - using namespace boost; using namespace boost::icl; int score = MATCH_MET; int64_t overall; @@ -261,7 +259,7 @@ class greater_interval_first_t : public dfu_match_cb_t break; } dfu.transform (subsystem, c_type, - icl::inserter (comp.ivset, comp.ivset.end ()), + boost::icl::inserter (comp.ivset, comp.ivset.end ()), fold::to_interval); dfu.choose_accum_best_k (subsystem, c_type, count, comp); } diff --git a/resource/resource_gen.cpp b/resource/resource_gen.cpp index 830334be7..f179d7e30 100644 --- a/resource/resource_gen.cpp +++ b/resource/resource_gen.cpp @@ -37,14 +37,13 @@ extern "C" { } using namespace std; -using namespace boost; using namespace Flux::resource_model; /*! Note that this class must be copy-constructible * required by the concept of the depth first search * visitor. It must be lightweight. */ -class dfs_emitter_t : public default_dfs_visitor { +class dfs_emitter_t : public boost::default_dfs_visitor { public: dfs_emitter_t (); dfs_emitter_t (resource_graph_db_t *db_p, resource_gen_spec_t *g); @@ -184,7 +183,7 @@ vtx_t dfs_emitter_t::emit_vertex (ggv_t u, gge_t e, const gg_t &recipe, vtx_t src_v, int i, int sz, int j) { resource_graph_db_t &db = *m_db_p; - if (src_v == graph_traits::null_vertex()) + if (src_v == boost::graph_traits::null_vertex()) if (db.roots.find (recipe[u].subsystem) != db.roots.end ()) return db.roots[recipe[u].subsystem]; @@ -193,7 +192,7 @@ vtx_t dfs_emitter_t::emit_vertex (ggv_t u, gge_t e, const gg_t &recipe, string ssys = recipe[u].subsystem; int id = 0; - if (src_v == graph_traits::null_vertex()) { + if (src_v == boost::graph_traits::null_vertex()) { // ROOT!! db.roots[recipe[u].subsystem] = v; id = 0; @@ -290,7 +289,7 @@ void dfs_emitter_t::tree_edge (gge_t e, const gg_t &recipe) if (recipe[src_ggv].root) { //! ROOT if (m_gen_src_vtx[src_ggv].empty ()) { - vtx_t null_v = graph_traits::null_vertex(); + vtx_t null_v = boost::graph_traits::null_vertex(); m_gen_src_vtx[src_ggv].push_back (emit_vertex (src_ggv, e, recipe, null_v, 0, 1, 0)); } @@ -453,7 +452,7 @@ int resource_generator_t::read_graphml (const string &fn, resource_graph_db_t &d // with emitter visitor. // dfs_emitter_t emitter (&db, &m_gspec); - depth_first_search (m_gspec.gen_graph (), visitor (emitter)); + depth_first_search (m_gspec.gen_graph (), boost::visitor (emitter)); m_err_msg += emitter.err_message (); return (m_err_msg == "")? rc : -1; diff --git a/resource/resource_gen_spec.cpp b/resource/resource_gen_spec.cpp index 45881ef89..12a0e809b 100644 --- a/resource/resource_gen_spec.cpp +++ b/resource/resource_gen_spec.cpp @@ -36,7 +36,6 @@ extern "C" { } using namespace std; -using namespace boost; using namespace Flux::resource_model; struct str2enum_t @@ -87,7 +86,7 @@ class gg_label_writer_sim_t { * * ********************************************************************************/ -void resource_gen_spec_t::setup_dynamic_property (dynamic_properties &dp, gg_t &g) +void resource_gen_spec_t::setup_dynamic_property (boost::dynamic_properties &dp, gg_t &g) { dp.property("root", get(&resource_pool_gen_t::root, g)); dp.property("type", get(&resource_pool_gen_t::type, g)); @@ -159,7 +158,7 @@ int resource_gen_spec_t::read_graphml (const string &ifn) try { boost::read_graphml (in_file, g, dp); - } catch (graph_exception &e) { + } catch (boost::graph_exception &e) { cerr << e.what () << endl; rc = -1; } @@ -199,7 +198,7 @@ int resource_gen_spec_t::write_graphviz (const string &ofn, bool simple) gg_label_writer_sim_t ewr (e_rel_map); boost::write_graphviz (out_file, g, vwr, ewr); } - } catch (graph_exception &e) { + } catch (boost::graph_exception &e) { cerr << e.what () << endl; rc = -1; } diff --git a/resource/resource_gen_spec.hpp b/resource/resource_gen_spec.hpp index 4445a983d..d65b19578 100644 --- a/resource/resource_gen_spec.hpp +++ b/resource/resource_gen_spec.hpp @@ -34,8 +34,6 @@ namespace Flux { namespace resource_model { -using namespace boost; - enum gen_meth_t { MULTIPLY, ASSOCIATE_IN, @@ -66,30 +64,30 @@ struct relation_gen_t { int as_src_uplvl; }; -typedef adjacency_list< - vecS, - vecS, - directedS, +typedef boost::adjacency_list< + boost::vecS, + boost::vecS, + boost::directedS, resource_pool_gen_t, relation_gen_t > gg_t; typedef std::string resource_pool_gen_t::* pgen_t; typedef std::string relation_gen_t::* rgen_t; -typedef graph_traits::vertex_descriptor ggv_t; -typedef graph_traits::edge_descriptor gge_t; +typedef boost::graph_traits::vertex_descriptor ggv_t; +typedef boost::graph_traits::edge_descriptor gge_t; -typedef property_map::type vtx_type_map_t; -typedef property_map::type vtx_basename_map_t; -typedef property_map::type vtx_size_map_t; -typedef property_map::type vtx_unit_map_t; -typedef property_map::type vtx_subsystem_map_t; -typedef property_map::type edg_e_subsystem_map_t; -typedef property_map::type edg_relation_map_t; -typedef property_map::type edg_rrelation_map_t; -typedef property_map::type edg_gen_method_map_t; -typedef property_map::type edg_id_method_map_t; -typedef property_map::type edg_multi_scale_map_t; +typedef boost::property_map::type vtx_type_map_t; +typedef boost::property_map::type vtx_basename_map_t; +typedef boost::property_map::type vtx_size_map_t; +typedef boost::property_map::type vtx_unit_map_t; +typedef boost::property_map::type vtx_subsystem_map_t; +typedef boost::property_map::type edg_e_subsystem_map_t; +typedef boost::property_map::type edg_relation_map_t; +typedef boost::property_map::type edg_rrelation_map_t; +typedef boost::property_map::type edg_gen_method_map_t; +typedef boost::property_map::type edg_id_method_map_t; +typedef boost::property_map::type edg_multi_scale_map_t; class resource_gen_spec_t { public: @@ -101,9 +99,9 @@ class resource_gen_spec_t { int write_graphviz (const std::string &ofn, bool simple=false); private: - void setup_dynamic_property (dynamic_properties &dp, gg_t &g); + void setup_dynamic_property (boost::dynamic_properties &dp, gg_t &g); gg_t g; - dynamic_properties dp; + boost::dynamic_properties dp; }; } // namespace resource_model diff --git a/resource/resource_graph.hpp b/resource/resource_graph.hpp index 075f76192..8f07413dd 100644 --- a/resource/resource_graph.hpp +++ b/resource/resource_graph.hpp @@ -35,8 +35,6 @@ namespace Flux { namespace resource_model { -using namespace boost; - enum class emit_format_t { GRAPHVIZ_DOT, GRAPH_ML, }; typedef pool_infra_t resource_pool_t::* pinfra_t; @@ -44,7 +42,7 @@ typedef std::string resource_pool_t::* pname_t; typedef std::string resource_relation_t::* rname_t; typedef relation_infra_t resource_relation_t::* rinfra_t; -typedef adjacency_list resource_graph_t; /*! For each chosen subsystem, a selector has std::set. @@ -65,7 +63,7 @@ class subsystem_selector_t { m_selector = sel; } bool operator () (const graph_entity &ent) const { - typedef typename property_traits::value_type infra_type; + typedef typename boost::property_traits::value_type infra_type; const infra_type &inf = get (m_imap, ent); const multi_subsystems_t &subsystems = inf.member_of; for (auto &kv : subsystems) { @@ -87,25 +85,25 @@ class subsystem_selector_t { inframap m_imap; }; -typedef property_map::type vtx_infra_map_t; -typedef property_map::type edg_infra_map_t; -typedef graph_traits::vertex_descriptor vtx_t; -typedef graph_traits::edge_descriptor edg_t; -typedef graph_traits::vertex_iterator vtx_iterator_t; -typedef graph_traits::edge_iterator edg_iterator_t; -typedef graph_traits::out_edge_iterator out_edg_iterator_t; -typedef filtered_graph::type vtx_infra_map_t; +typedef boost::property_map::type edg_infra_map_t; +typedef boost::graph_traits::vertex_descriptor vtx_t; +typedef boost::graph_traits::edge_descriptor edg_t; +typedef boost::graph_traits::vertex_iterator vtx_iterator_t; +typedef boost::graph_traits::edge_iterator edg_iterator_t; +typedef boost::graph_traits::out_edge_iterator out_edg_iterator_t; +typedef boost::filtered_graph, subsystem_selector_t> f_resource_graph_t; -typedef property_map::type f_edg_infra_map_t; -typedef property_map::type f_vtx_infra_map_t; -typedef property_map::type f_res_name_map_t; -typedef property_map::type f_rel_name_map_t; -typedef property_map::type f_vtx_infra_map_t; -typedef graph_traits::vertex_iterator f_vtx_iterator_t; -typedef graph_traits::edge_iterator f_edg_iterator_t; -typedef graph_traits::out_edge_iterator f_out_edg_iterator_t; +typedef boost::property_map::type f_edg_infra_map_t; +typedef boost::property_map::type f_vtx_infra_map_t; +typedef boost::property_map::type f_res_name_map_t; +typedef boost::property_map::type f_rel_name_map_t; +typedef boost::property_map::type f_vtx_infra_map_t; +typedef boost::graph_traits::vertex_iterator f_vtx_iterator_t; +typedef boost::graph_traits::edge_iterator f_edg_iterator_t; +typedef boost::graph_traits::out_edge_iterator f_out_edg_iterator_t; /*! Resource graph data store. * Adjacency_list graph, roots of this graph and various indexing. diff --git a/resource/utilities/grug2dot.cpp b/resource/utilities/grug2dot.cpp index ecb27100a..2735f14e2 100644 --- a/resource/utilities/grug2dot.cpp +++ b/resource/utilities/grug2dot.cpp @@ -33,7 +33,6 @@ extern "C" { } using namespace std; -using namespace boost; using namespace Flux::resource_model; #define OPTIONS "hm" @@ -85,7 +84,7 @@ int main (int argc, char *argv[]) resource_gen_spec_t gspec; string fn (argv[optind]); - filesystem::path path = fn; + boost::filesystem::path path = fn; string base = path.stem ().string (); if (gspec.read_graphml (fn) != 0) { diff --git a/resource/utilities/resource-query.cpp b/resource/utilities/resource-query.cpp index 8b4039627..f5314541c 100644 --- a/resource/utilities/resource-query.cpp +++ b/resource/utilities/resource-query.cpp @@ -43,7 +43,6 @@ extern "C" { } using namespace std; -using namespace boost; using namespace Flux::resource_model; #define OPTIONS "G:S:P:g:o:t:e:h" @@ -176,9 +175,9 @@ static void set_default_params (resource_context_t *ctx) static int string_to_graph_format (string st, emit_format_t &format) { int rc = 0; - if (iequals (st, string ("dot"))) + if (boost::iequals (st, string ("dot"))) format = emit_format_t::GRAPHVIZ_DOT; - else if (iequals (st, string ("graphml"))) + else if (boost::iequals (st, string ("graphml"))) format = emit_format_t::GRAPH_ML; else rc = -1; @@ -216,57 +215,57 @@ static int set_subsystems_use (resource_context_t *ctx, string n) dfu_match_cb_t &matcher = *(ctx->matcher); const string &matcher_type = matcher.matcher_name (); - if (iequals (matcher_type, string ("CA"))) { + if (boost::iequals (matcher_type, string ("CA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "*"); - } else if (iequals (matcher_type, string ("IBA"))) { + } else if (boost::iequals (matcher_type, string ("IBA"))) { if ( (rc = subsystem_exist (ctx, "ibnet")) == 0) matcher.add_subsystem ("ibnet", "*"); - } else if (iequals (matcher_type, string ("IBBA"))) { + } else if (boost::iequals (matcher_type, string ("IBBA"))) { if ( (rc = subsystem_exist (ctx, "ibnetbw")) == 0) matcher.add_subsystem ("ibnetbw", "*"); - } else if (iequals (matcher_type, string ("PFS1BA"))) { + } else if (boost::iequals (matcher_type, string ("PFS1BA"))) { if ( (rc = subsystem_exist (ctx, "pfs1bw")) == 0) matcher.add_subsystem ("pfs1bw", "*"); - } else if (iequals (matcher_type, string ("PA"))) { + } else if (boost::iequals (matcher_type, string ("PA"))) { if ( (rc = subsystem_exist (ctx, "power")) == 0) matcher.add_subsystem ("power", "*"); - } else if (iequals (matcher_type, string ("C+PFS1BA"))) { + } else if (boost::iequals (matcher_type, string ("C+PFS1BA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "contains"); if ( !rc && (rc = subsystem_exist (ctx, "pfs1bw")) == 0) matcher.add_subsystem ("pfs1bw", "*"); - } else if (iequals (matcher_type, string ("C+IBA"))) { + } else if (boost::iequals (matcher_type, string ("C+IBA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "contains"); if ( !rc && (rc = subsystem_exist (ctx, "ibnet")) == 0) matcher.add_subsystem ("ibnet", "connected_up"); - } else if (iequals (matcher_type, string ("C+PA"))) { + } else if (boost::iequals (matcher_type, string ("C+PA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "*"); if ( !rc && (rc = subsystem_exist (ctx, "power")) == 0) matcher.add_subsystem ("power", "draws_from"); - } else if (iequals (matcher_type, string ("IB+IBBA"))) { + } else if (boost::iequals (matcher_type, string ("IB+IBBA"))) { if ( (rc = subsystem_exist (ctx, "ibnet")) == 0) matcher.add_subsystem ("ibnet", "connected_down"); if ( !rc && (rc = subsystem_exist (ctx, "ibnetbw")) == 0) matcher.add_subsystem ("ibnetbw", "*"); - } else if (iequals (matcher_type, string ("C+P+IBA"))) { + } else if (boost::iequals (matcher_type, string ("C+P+IBA"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "contains"); if ( (rc = subsystem_exist (ctx, "power")) == 0) matcher.add_subsystem ("power", "draws_from"); if ( !rc && (rc = subsystem_exist (ctx, "ibnet")) == 0) matcher.add_subsystem ("ibnet", "connected_up"); - } else if (iequals (matcher_type, string ("V+PFS1BA"))) { + } else if (boost::iequals (matcher_type, string ("V+PFS1BA"))) { if ( (rc = subsystem_exist (ctx, "virtual1")) == 0) matcher.add_subsystem ("virtual1", "*"); if ( !rc && (rc = subsystem_exist (ctx, "pfs1bw")) == 0) matcher.add_subsystem ("pfs1bw", "*"); - } else if (iequals (matcher_type, string ("VA"))) { + } else if (boost::iequals (matcher_type, string ("VA"))) { if ( (rc = subsystem_exist (ctx, "virtual1")) == 0) matcher.add_subsystem ("virtual1", "*"); - } else if (iequals (matcher_type, string ("ALL"))) { + } else if (boost::iequals (matcher_type, string ("ALL"))) { if ( (rc = subsystem_exist (ctx, "containment")) == 0) matcher.add_subsystem ("containment", "*"); if ( !rc && (rc = subsystem_exist (ctx, "ibnet")) == 0) @@ -323,13 +322,13 @@ static void flatten (f_resource_graph_t &fg, map &paths, static void write_to_graphml (f_resource_graph_t &fg, fstream &o) { - dynamic_properties dp; + boost::dynamic_properties dp; map esubsystems; map subsystems, properties, paths; - associative_property_map> subsystems_map (subsystems); - associative_property_map> esubsystems_map (esubsystems); - associative_property_map> props_map (properties); - associative_property_map> paths_map (paths); + boost::associative_property_map> subsystems_map (subsystems); + boost::associative_property_map> esubsystems_map (esubsystems); + boost::associative_property_map> props_map (properties); + boost::associative_property_map> paths_map (paths); flatten (fg, paths, subsystems, esubsystems); From 68569905a21592f290bf581a78e270336df450cd Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Fri, 30 Mar 2018 15:29:10 -0700 Subject: [PATCH 7/7] build: add -Wno-error to resource build Problem: clang-3.8 doesn't grok -Wno-maybe-uninitialized, and gcc-5.4.0 doesn't grok -Wno-error=unknown-warning-option. For now, add -Wno-error in the resource directory and drop -Wno-maybe-uninitialized so we can get this built on travis. --- resource/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resource/Makefile.am b/resource/Makefile.am index 40d79b4a4..5fb28eafd 100644 --- a/resource/Makefile.am +++ b/resource/Makefile.am @@ -3,7 +3,7 @@ AM_CXXFLAGS = \ -Wno-unused-local-typedefs \ -Wno-deprecated-declarations \ -Wno-unused-variable \ - -Wno-maybe-uninitialized \ + -Wno-error \ $(CODE_COVERAGE_CXXFLAGS) AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) \