mapnik / mapnik

Mapnik is an open source toolkit for developing mapping applications
http://mapnik.org
GNU Lesser General Public License v2.1
3.68k stars 826 forks source link

Fails to build with Boost 1.70.0 #4041

Open jbeich opened 5 years ago

jbeich commented 5 years ago

Regressed by boostorg/spirit@d4c0179fa6c6:

src/css_color_grammar_x3.cpp:33:15: error: explicit instantiation of 'parse_rule' does not refer to a function
      template, variable template, member function, member class, or static data member
template bool parse_rule<iterator_type, context_type, mapnik::filter::color_to_alpha>
              ^
include/mapnik/css_color_grammar_x3_def.hpp:434:1: note: candidate template ignored: invalid explicitly-specified
      argument for template parameter 'Context'
BOOST_SPIRIT_DEFINE(
^
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
include/mapnik/css_color_grammar_x3_def.hpp:434:1: note: candidate template ignored: invalid explicitly-specified
      argument for template parameter 'Context'
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
include/mapnik/css_color_grammar_x3_def.hpp:434:1: note: candidate template ignored: invalid explicitly-specified
      argument for template parameter 'Context'
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
include/mapnik/css_color_grammar_x3_def.hpp:434:1: note: candidate template ignored: invalid explicitly-specified
      argument for template parameter 'Context'
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
include/mapnik/css_color_grammar_x3_def.hpp:434:1: note: candidate template ignored: invalid explicitly-specified
      argument for template parameter 'Context'
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
include/mapnik/css_color_grammar_x3_def.hpp:434:1: note: candidate template ignored: invalid explicitly-specified
      argument for template parameter 'Context'
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
include/mapnik/css_color_grammar_x3_def.hpp:434:1: note: candidate template ignored: invalid explicitly-specified
      argument for template parameter 'Context'
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
1 error generated.

Regressed by boostorg/spirit@a3cf3f2c3ebe:

src/svg/svg_path_grammar_x3.cpp:28:1: error: explicit instantiation of 'parse_rule' does not refer to a function
      template, variable template, member function, member class, or static data member
BOOST_SPIRIT_INSTANTIATE_UNUSED(svg_path_grammar_type, iterator_type, svg_parse_context_type);
^
include/mapnik/boost_spirit_instantiate.hpp:30:19: note: expanded from macro 'BOOST_SPIRIT_INSTANTIATE_UNUSED'
    template bool parse_rule<Iterator, Context, boost::spirit::x3::unused_type const>( \
                  ^
include/mapnik/svg/svg_path_grammar_x3_def.hpp:197:1: note: candidate template ignored: invalid
      explicitly-specified argument for template parameter 'Context'
BOOST_SPIRIT_DEFINE(
^
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
include/mapnik/svg/svg_path_grammar_x3_def.hpp:197:1: note: candidate template ignored: invalid
      explicitly-specified argument for template parameter 'Context'
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
src/svg/svg_path_grammar_x3.cpp:29:1: error: explicit instantiation of 'parse_rule' does not refer to a function
      template, variable template, member function, member class, or static data member
BOOST_SPIRIT_INSTANTIATE_UNUSED(svg_points_grammar_type, iterator_type, svg_parse_context_type);
^
include/mapnik/boost_spirit_instantiate.hpp:30:19: note: expanded from macro 'BOOST_SPIRIT_INSTANTIATE_UNUSED'
    template bool parse_rule<Iterator, Context, boost::spirit::x3::unused_type const>( \
                  ^
include/mapnik/svg/svg_path_grammar_x3_def.hpp:197:1: note: candidate template ignored: invalid
      explicitly-specified argument for template parameter 'Context'
BOOST_SPIRIT_DEFINE(
^
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
include/mapnik/svg/svg_path_grammar_x3_def.hpp:197:1: note: candidate template ignored: invalid
      explicitly-specified argument for template parameter 'Context'
/usr/local/include/boost/spirit/home/x3/nonterminal/rule.hpp:210:5: note: expanded from macro
      'BOOST_SPIRIT_DEFINE'
    BOOST_SPIRIT_DEFINE_, _, BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__))             \
    ^
2 errors generated.
artemp commented 5 years ago

@jbeich - yep, thanks for reporting.

r1de commented 5 years ago

Sorry to bring forth an old thread but, any activity on this issue? I am also similar having issues compiling mapnik using boost 1.70.0.

In file included from include/mapnik/json/json_grammar_config.hpp:36,
                 from src/json/unicode_string_grammar_x3.cpp:24:
include/mapnik/boost_spirit_instantiate.hpp:30:19: error: template-id ‘parse_rule<mapnik::json::grammar::iterator_type, mapnik::json::grammar::phrase_parse_context_type, const boost::spirit::x3::unused_type>’ for ‘bool mapnik::json::grammar::parse_rule(mapnik::json::grammar::unicode_string_grammar_type, const char*&, const char* const&, const phrase_parse_context_type&, const boost::spirit::x3::unused_type&)’ does not match any template declaration
   30 |     template bool parse_rule<Iterator, Context, boost::spirit::x3::unused_type const>( \
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/mapnik/boost_spirit_instantiate.hpp:30:19: note: in definition of macro ‘BOOST_SPIRIT_INSTANTIATE_UNUSED’
   30 |     template bool parse_rule<Iterator, Context, boost::spirit::x3::unused_type const>( \
      |

googling has not helped so far. (that is what brought me here) Thank you and 73

artemp commented 5 years ago

I'm aware of this issue @r1de @jbeich. x3 based grammars rely on ability to reuse rules with or without input attribute defined explicitly. This has been broken in 1.70 see relevant discussion : https://github.com/boostorg/spirit/issues/511

r1de commented 5 years ago

@artemp Thank you!
I (hopefully) await a fix from upstream.

Thanks again

am2222 commented 5 years ago

does this error still exist?

kathur2rain commented 5 years ago

yes, @am2222 same make error here

artemp commented 5 years ago

Yes, this issue persists with boost >= 1_70. I have tried to fix but ran into issues that need fixing in boost.spirit.x3 . I just posted an issue with a minimal use-case: https://github.com/boostorg/spirit/issues/548

am2222 commented 5 years ago

Thanks. The reason that I am asking is that there might be a chance that the vcpkg team adds mapnik to their ports and it might solve many issue for mapnik compile on windows which can be great.

artemp commented 5 years ago

https://github.com/mapnik/mapnik/pull/4094 <-- this branch works with the latest boost.spirit.x3 (https://github.com/boostorg/spirit/pull/549/commits/10d027fd5cfd573471e80e2e3c2d0cb0616a6d65).

am2222 commented 5 years ago

@artemp thanks so much. is there any possibility to merge it into main branch in future?

artemp commented 5 years ago

@am2222 - yes, this is the plan^. To summarise: this PR supports BOOST<1.70 and > 1.71 BOOST 1.71 also works with https://github.com/boostorg/spirit/commit/10d027fd5cfd573471e80e2e3c2d0cb0616a6d65 applied but BOOST 1.70 is still broken.

am2222 commented 5 years ago

@artemp awo. thanks so much

artemp commented 5 years ago

An update : boost_1_70 works also when patched ^.

am2222 commented 5 years ago

@artemp wow thanks, But one question, I have to update boost.spirit to the latest version, right? because I wanted to use vcpkg version of boost and it seems it is not updated yet.

artemp commented 5 years ago

@am2222 - you can use latest boost.spirit which is not released yet or you can apply https://github.com/boostorg/spirit/commit/10d027fd5cfd573471e80e2e3c2d0cb0616a6d65 (one line change in rule.hpp) to BOOST 1_70 or 1_71

am2222 commented 5 years ago

@artemp I got it. Thanks so much

jbeich commented 5 years ago

@artemp, do you plan to backport #4094 to v3.0.x branch?

artemp commented 5 years ago

@jbeich - Have you tried building v3.0.x with BOOST 1_70 and 1_71? If there are issues related to #4094 then, yes. Thanks!

cpaulik commented 5 years ago

I get the following error when building v3.0.x with boost 1_70

include/mapnik/json/geometry_generator_grammar_impl.hpp:109:25:   required from 'mapnik::json::geometry_generator_grammar<OutputIterator, Geometry>::geometry_generator_grammar() [with OutputIterator = std::back_insert_iterator<std::basic_string<char> >; Geometry = mapnik::geometry::geometry<double>]'
src/json/mapnik_json_generator_grammar.cpp:35:31:   required from here
/home/cpa/.pyenv/versions/miniconda2-4.3.30/conda-bld/mapnik_1572601251166/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/include/boost/static_assert.hpp:31:45: error: static assertion failed: Transformed cannot be a reference type
 #     define BOOST_STATIC_ASSERT_MSG( ... ) static_assert(__VA_ARGS__)
                                             ^
/home/cpa/.pyenv/versions/miniconda2-4.3.30/conda-bld/mapnik_1572601251166/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/include/boost/spirit/home/support/attributes.hpp:963:9: note: in expansion of macro 'BOOST_STATIC_ASSERT_MSG'
         BOOST_STATIC_ASSERT_MSG(!is_reference<Transformed>::value,
         ^
scons: *** [src/json/mapnik_json_generator_grammar.o] Error 1
jbeich commented 5 years ago

v3.0.x with Boost 1.71 fails in the same way, see error log.

tobwen commented 4 years ago

v3.0.x with Boost 1.71 fails in the same way, see error log.

Same here. v1.69 works.

Xeverous commented 4 years ago

Subscribing to this issue because I have a project which also uses Spirit X3 and would like any updates from you. I have 60+ grammar objects but no build problems with boost 1.70 and 1.71. I have 0 semantic actions though. If semantic actions cause you build problems you can try replacing them with annotations (I have no issues with them).

On the other hand, my project uncovered a GCC bug which was fixed in GCC 9.0. Before 9.0, it requires non-intrusive workaround but with different versions of Spirit non-workarounded code may either result in compile errors or degradation of all moves to deep copies during parsing.

Sinan81 commented 4 years ago

Mapnik@3.0.23 compiles with all boost versions except the latest: 1.73.