Skip to content

compile error in spirit / phoenix v3 with boost trunk #1658

Closed
springmeyer opened this Issue Dec 17, 2012 · 9 comments

1 participant

@springmeyer
Mapnik member

Compiling against boost trunk/svn at r82031 I see:

n file included from src/json/feature_collection_parser.cpp:25:
In file included from include/mapnik/json/feature_collection_grammar.hpp:28:
In file included from include/mapnik/json/feature_grammar.hpp:27:
In file included from include/mapnik/json/geometry_grammar.hpp:32:
In file included from /opt/boost-trunk/include/boost/spirit/include/phoenix.hpp:13:
In file included from /opt/boost-trunk/include/boost/spirit/home/phoenix.hpp:17:
In file included from /opt/boost-trunk/include/boost/spirit/home/phoenix/operator.hpp:16:
/opt/boost-trunk/include/boost/spirit/home/phoenix/operator/self.hpp:65:65: error: no viable conversion from 'mapnik::feature_impl' to
      'boost::error_cant_deduce_type'
    PHOENIX_UNARY_EVAL(dereference_eval, result_of_dereference, *x)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~

Full error at: https://gist.github.com/4320398

Based on http://boost.2283326.n4.nabble.com/lexer-semantic-action-td3441608.html I tried setting:

-DBOOST_SPIRIT_USE_PHOENIX_V3=1

Which did work around the error. Should we be setting this flag? Or is this a boost bug?

@springmeyer
Mapnik member

But now realizing that setting -DBOOST_SPIRIT_USE_PHOENIX_V3=1 breaks other grammars. One of the problems here appears to be the usage of includes with spirit/home/ instead of spirit/include/ and other header references that reach too deeply into phoenix such that when we set BOOST_SPIRIT_USE_PHOENIX_V3 I think both old and newer phoenix may be being included.

@springmeyer
Mapnik member

gah.... Been trying to get master compiled (not with cpp11 and just with boost 1_51) with ./configure CUSTOM_CXXFLAGS="-DBOOST_SPIRIT_USE_PHOENIX_V3=1" and its quite messy. I clearly did not try this before.

@springmeyer
Mapnik member

appears related but his workarounds do not help for me using boost 1.51 and clang++: https://svn.boost.org/trac/boost/ticket/5687

@springmeyer
Mapnik member

karma stuff is borked, don't know why:

In file included from src/json/geojson_generator.cpp:30:
In file included from include/mapnik/json/feature_generator_grammar.hpp:30:
In file included from include/mapnik/json/geometry_generator_grammar.hpp:35:
In file included from /opt/boost-51/include/boost/spirit/include/karma.hpp:16:
In file included from /opt/boost-51/include/boost/spirit/home/karma.hpp:13:
In file included from /opt/boost-51/include/boost/spirit/home/karma/char.hpp:13:
In file included from /opt/boost-51/include/boost/spirit/home/karma/char/char.hpp:14:
In file included from /opt/boost-51/include/boost/spirit/home/support/common_terminals.hpp:15:
In file included from /opt/boost-51/include/boost/spirit/home/support/terminal.hpp:16:
In file included from /opt/boost-51/include/boost/spirit/include/phoenix_core.hpp:16:
In file included from /opt/boost-51/include/boost/phoenix/core.hpp:15:
In file included from /opt/boost-51/include/boost/phoenix/core/actor.hpp:19:
In file included from /opt/boost-51/include/boost/phoenix/core/is_nullary.hpp:18:
In file included from /opt/boost-51/include/boost/proto/transform/fold.hpp:17:
In file included from /opt/boost-51/include/boost/fusion/include/fold.hpp:10:
In file included from /opt/boost-51/include/boost/fusion/algorithm/iteration/fold.hpp:14:
In file included from /opt/boost-51/include/boost/fusion/sequence/intrinsic/begin.hpp:17:
In file included from /opt/boost-51/include/boost/fusion/sequence/intrinsic/detail/segmented_begin.hpp:12:
In file included from /opt/boost-51/include/boost/fusion/view/iterator_range.hpp:10:
In file included from /opt/boost-51/include/boost/fusion/view/iterator_range/iterator_range.hpp:21:
In file included from /opt/boost-51/include/boost/fusion/view/iterator_range/detail/segments_impl.hpp:13:
In file included from /opt/boost-51/include/boost/fusion/view/iterator_range/detail/segmented_iterator_range.hpp:19:
In file included from /opt/boost-51/include/boost/fusion/algorithm/transformation/push_back.hpp:11:
In file included from /opt/boost-51/include/boost/fusion/view/joint_view/joint_view.hpp:15:
/opt/boost-51/include/boost/fusion/sequence/intrinsic/size.hpp:33:49: error: typename specifier refers to non-type member
      'size' in 'std::basic_string<char>'
            struct unsegmented_size : Sequence::size {};
                                      ~~~~~~~~~~^~~~
/opt/boost-51/include/boost/fusion/sequence/intrinsic/size.hpp:37:17: note: in instantiation of template class
      'boost::fusion::extension::size_impl<boost::fusion::non_fusion_tag>::unsegmented_size<std::basic_string<char> >'
      requested here
              : mpl::if_<
                ^
/opt/boost-51/include/boost/fusion/sequence/intrinsic/size.hpp:69:15: note: in instantiation of template class
      'boost::fusion::extension::size_impl<boost::fusion::non_fusion_tag>::apply<std::basic_string<char> >' requested here
            : extension::size_impl<typename detail::tag_of<Sequence>::type>::
              ^
/opt/boost-51/include/boost/spirit/home/support/argument.hpp:99:36: note: in instantiation of template class
      'boost::fusion::result_of::size<std::basic_string<char> >' requested here
                fusion::result_of::size<Sequence>::type
                                   ^
/opt/boost-51/include/boost/spirit/home/support/argument.hpp:118:40: note: in instantiation of template class
      'boost::spirit::result_of::get_arg<std::basic_string<char>, 0>' requested here
        struct get_arg<Sequence&, N> : get_arg<Sequence, N>
                                       ^
/opt/boost-51/include/boost/spirit/home/support/argument.hpp:166:41: note: in instantiation of template class
      'boost::spirit::result_of::get_arg<std::basic_string<char> &, 0>' requested here
            typedef typename result_of::get_arg<arg_type, N>::type type;
                                        ^
/opt/boost-51/include/boost/phoenix/core/v2_eval.hpp:29:15: note: (skipping 45 contexts in backtrace; use
      -ftemplate-backtrace-limit=0 to see all)
            : Eval::template result<typename proto::detail::uncvref<Env>::type>
@springmeyer springmeyer added a commit that referenced this issue Jan 16, 2013
@springmeyer springmeyer workaround boost::error_cant_deduce_type error when building against …
…boost trunk (currently 1_53) - refs #1658
24463d0
@springmeyer
Mapnik member

turns out that the original error only impacts a single cpp file, so defining BOOST_SPIRIT_USE_PHOENIX_V3 just for that file seems to fix the overall compile when building against boost trunk without hitting all the other incompatibilities with phoenix v3 in the other grammars. Not a viable solution long term, but a better start.

@springmeyer
Mapnik member

okay, just re-pushed to the PHOENIX_V3 branch with works with boost 1_51 (without BOOST_SPIRIT_USE_PHOENIX_V3 defined) and works/compiles with boost trunk (1_53) with BOOST_SPIRIT_USE_PHOENIX_V3 defined.

@springmeyer
Mapnik member

closing, this is mostly worked out now in master. More fixes are in c++11 branch.

@springmeyer springmeyer closed this May 9, 2013
@PetrDlouhy PetrDlouhy added a commit to PetrDlouhy/mapnik that referenced this issue Aug 22, 2013
@springmeyer springmeyer workaround boost::error_cant_deduce_type error when building against …
…boost trunk (currently 1_53) - refs #1658
89d98e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.