mapnik / mapnik

Mapnik is an open source toolkit for developing mapping applications

Home Page:http://mapnik.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mapnik 3.1.0 not building with Boost 1.80

brad0 opened this issue · comments

Trying to build mapnik 3.1.0 with Boost 1.80 is failing as so..

c++ -o test/unit/serialization/wkb_test.o -c -std=c++14 -DU_USING_ICU_NAMESPACE=0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -I/usr/X11R6/include/freetype2 -pthread -ftemplate-depth-300 -Wsign-compare -Wshadow -O2 -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_J
PEG -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DOPENBSD -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF
 -DOPENBSD -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DHAVE_LIBXML2 -DHAVE_CAIRO -Itest -I/usr/local/include/cairo -I/usr/local/include/lzo -I/usr/local/include/libpng16 -I/usr/X11R6/inc
lude -I/usr/X11R6/include/pixman-1 -Ideps -Ideps/mapbox/variant/include -Ideps/agg/include -Iinclude -I/usr/local/include/postgresql -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/include test/unit/serialization/wkb_test.cpp
In file included from test/unit/serialization/wkb_test.cpp:5:
In file included from include/mapnik/geometry_adapters.hpp:38:
In file included from /usr/local/include/boost/geometry.hpp:17:
In file included from /usr/local/include/boost/geometry/geometry.hpp:63:
In file included from /usr/local/include/boost/geometry/algorithms/buffer.hpp:22:
In file included from /usr/local/include/boost/geometry/algorithms/detail/buffer/implementation.hpp:24:
In file included from /usr/local/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp:30:
In file included from /usr/local/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp:32:
In file included from /usr/local/include/boost/geometry/algorithms/covered_by.hpp:24:
In file included from /usr/local/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp:25:
In file included from /usr/local/include/boost/geometry/algorithms/detail/within/implementation.hpp:32:
In file included from /usr/local/include/boost/geometry/algorithms/detail/relate/implementation.hpp:17:
In file included from /usr/local/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp:29:
/usr/local/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp:99:29: error: no matching member function for call to 'push_back'
            boundary_points.push_back(front_pt);
            ~~~~~~~~~~~~~~~~^~~~~~~~~

latest mapnik shouldn't have those issues. Can you use the latest mapnik?

I substituted in the latest git clone and am now seeing..

c++ -o demo/c++/rundemo.o -c -std=c++14 -DU_USING_ICU_NAMESPACE=0 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -I/usr/X11R6/include/freetype2 -pthread -ftemplate-depth-300 -Wsign-compare -O2 -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ -DMAPNIK_PROJ_VERSION=90001 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DOPENBSD -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DMAPNIK_MEMORY_MAPPED_FILE -DMAPNIK_HAS_DLCFN -DBIGINT -DBOOST_REGEX_HAS_ICU -DHAVE_JPEG -DMAPNIK_USE_PROJ -DMAPNIK_PROJ_VERSION=90001 -DHAVE_PNG -DHAVE_WEBP -DHAVE_TIFF -DOPENBSD -DMAPNIK_THREADSAFE -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1 -DBOOST_SPIRIT_USE_PHOENIX_V3=1 -DNDEBUG -DHAVE_CAIRO -DGRID_RENDERER -DHAVE_LIBXML2 -DHAVE_CAIRO -I/usr/local/include/cairo -I/usr/local/include/lzo -I/usr/local/include/libpng16 -I/usr/X11R6/include -I/usr/X11R6/include/pixman-1 -Ideps -Ideps/mapbox/polylabel/include -Ideps/mapbox/protozero/include -Ideps/mapbox/geometry/include -Ideps/mapbox/variant/include -Ideps/agg/include -Iinclude -I/usr/local/include/postgresql -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/include demo/c++/rundemo.cpp
In file included from demo/c++/rundemo.cpp:23:
In file included from include/mapnik/map.hpp:32:
In file included from include/mapnik/params.hpp:29:
include/mapnik/util/variant.hpp:27:10: fatal error: 'mapbox/variant.hpp' file not found
#include <mapbox/variant.hpp>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.

You have to clone the submodules. E.g. with git submodule update --init --recursive

Ok, that helped. But after bumping up to the latest code I am still seeing the same error.

I don't see any related breaking changes in https://www.boost.org/users/history/version_1_80_0.html . Could you verify that /usr/local/include/boost/geometry is the 1.80 boost version?

If yes, you could try the cmake build instead of the SCons one. https://github.com/mapnik/mapnik/blob/master/docs/cmake-usage.md

Yes, it is from the 1.80 release.

I tried doing a conversion to CMake for our port and I am still seeing the same error.

Okay. Thanks for testing. I will take a look at Sunday or on Monday

@brad0 @mathisloge - FYI, I can replicate this issue on ubuntu 22.04 + boost_1_80
I have a simple fix

diff --git a/test/unit/serialization/wkb_test.cpp b/test/unit/serialization/wkb_test.cpp
index fc2bce049..3dbb4a74b 100644
--- a/test/unit/serialization/wkb_test.cpp
+++ b/test/unit/serialization/wkb_test.cpp
@@ -59,6 +59,21 @@ struct spatially_equal_visitor
         return true;
     }
 
+    result_type operator()(mapnik::geometry::multi_line_string<double> const& lhs,
+                           mapnik::geometry::multi_line_string<double> const& rhs) const
+    {
+        std::size_t size0 = lhs.size();
+        std::size_t size1 = rhs.size();
+        if (size0 != size1)
+            return false;
+        for (std::size_t index = 0; index < size0; ++index)
+        {
+            if (!boost::geometry::equals(lhs[index], rhs[index]))
+                return false;
+        }
+        return true;
+    }
+
     template<typename T>
     result_type operator()(T const& lhs, T const& rhs) const
     {

but I'd like to understand a bit more why boost::geometry::equals(multi_line_string, multi_line_string) is broken before pushing changes.

That indeed does allow the build to complete.

@brad0 - closing as fixed in 8110349

Thanks.