mapnik / python-mapnik

Python bindings for mapnik
GNU Lesser General Public License v2.1
157 stars 91 forks source link

template argument deduction/substitution failed #202

Closed OsamaShabrez closed 5 years ago

OsamaShabrez commented 5 years ago

Following this toturial https://ircama.github.io/osm-carto-tutorials/tile-server-ubuntu/, I have successfully built and installed mapnik from sources but my python-mapnik v3.0.x fails with:

/usr/include/boost/geometry/algorithms/detail/envelope/implementation.hpp:61:40: error: no matching function for call to ‘interior_rings(const mapbox::geometry::polygon<double, std::vector>&)’
                 >::apply(interior_rings(polygon), mbr, strategy);
                          ~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/boost/geometry/geometry.hpp:41,
                 from /usr/include/boost/geometry.hpp:17,
                 from /usr/include/mapnik/geometry_adapters.hpp:38,
                 from /usr/include/mapnik/geometry_is_valid.hpp:32,
                 from src/mapnik_geometry.cpp:40:
/usr/include/boost/geometry/core/interior_rings.hpp:114:53: note: candidate: ‘template<class Polygon> typename boost::geometry::interior_return_type<Geometry>::type boost::geometry::interior_rings(Polygon&)’
 inline typename interior_return_type<Polygon>::type interior_rings(Polygon& polygon)
                                                     ^~~~~~~~~~~~~~
/usr/include/boost/geometry/core/interior_rings.hpp:114:53: note:   template argument deduction/substitution failed:
/usr/include/boost/geometry/core/interior_rings.hpp:135:59: note: candidate: ‘template<class Polygon> typename boost::geometry::interior_return_type<const Polygon>::type boost::geometry::interior_rings(const Polygon&)’
 inline typename interior_return_type<Polygon const>::type interior_rings(
                                                           ^~~~~~~~~~~~~~
/usr/include/boost/geometry/core/interior_rings.hpp:135:59: note:   template argument deduction/substitution failed:
error: command 'c++' failed with exit status 1

full log can be found at https://gist.github.com/OsamaShabrez/4efb4760c5901c880eec1fb4073cc970

I am using Linux lubuntu 4.18.0-10-generic #11-Ubuntu SMP Thu Oct 11 15:13:55 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I receive following output for

mapnik-config -v
3.0.20
mapnik-config --input-plugins
/usr/lib/mapnik/3.0/input

while python -c "import mapnik;print mapnik.__file__" fails with:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "mapnik/__init__.py", line 74, in <module>
    from ._mapnik import *
ImportError: No module named _mapnik

which makes sense because I do not have paython-mapnik installed. I am using package installs for boost and HarfBuzz.

talaj commented 5 years ago

It seems as you would build python-mapnik 3.0.x against master branch of Mapnik.

There is mapbox::geometry::polygon mentioned in the error message, but Mapnik v3.0.x doesn't use mapbox geometries. Polygon in v3.0.x is defined here.

OsamaShabrez commented 5 years ago

Yes, I used master to build Mapnik but it still is v3.0.20 (=< 3.0.x) and shouldn't it be compatible?

talaj commented 5 years ago

Current master branch of Mapnik should be 4.0.0. Anyway, master branch is not compatible with v3.0.x branch. Both components need to be either from master or from v3.0.x.

OsamaShabrez commented 5 years ago

I was able to successfully build python-mapnik using master branch as I had used master to build mapnik. It was only after python-mapnik develop that I could see the correct version of mapnik which is now 4.0.0.