{"action":"created","issue":{"url":"https://api.github.com/repos/boostorg/geometry/issues/416","repository_url":"https://api.github.com/repos/boostorg/geometry","labels_url":"https://api.github.com/repos/boostorg/geometry/issues/416/labels{/name}","comments_url":"https://api.github.com/repos/boostorg/geometry/issues/416/comments","events_url":"https://api.github.com/repos/boostorg/geometry/issues/416/events","html_url":"https://github.com/boostorg/geometry/issues/416","id":251100138,"number":416,"title":"Compilation error with g++","user":{"login":"thk686","id":592841,"avatar_url":"https://avatars0.githubusercontent.com/u/592841?v=4","gravatar_id":"","url":"https://api.github.com/users/thk686","html_url":"https://github.com/thk686","followers_url":"https://api.github.com/users/thk686/followers","following_url":"https://api.github.com/users/thk686/following{/other_user}","gists_url":"https://api.github.com/users/thk686/gists{/gist_id}","starred_url":"https://api.github.com/users/thk686/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thk686/subscriptions","organizations_url":"https://api.github.com/users/thk686/orgs","repos_url":"https://api.github.com/users/thk686/repos","events_url":"https://api.github.com/users/thk686/events{/privacy}","received_events_url":"https://api.github.com/users/thk686/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-17T23:28:48Z","updated_at":"2017-08-18T23:23:31Z","closed_at":null,"body":"I am getting:\r\n\r\n```\r\n/usr/local/lib/R/site-library/BH/include/boost/mpl/assert.hpp:429:42: error: no \r\nmatching function for call to ‘assertion_failed(mpl_::failed************ (boost:\r\n:geometry::index::detail::indexable<std::pair<Eigen::Matrix<double, 1, 1, 0, 1, \r\n1>, double>, false>::NOT_VALID_INDEXABLE_TYPE::************)(Eigen::Matrix<doubl\r\ne, 1, 1, 0, 1, 1>))’\r\n     , BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \\\r\n                                                            ~~~\r\n         boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)\r\n::assert_arg() ) \\\r\n         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n~~~~~~~~~~~~~~~~~~\r\n         ) \\\r\n         ~                                 \r\n\r\n```\r\nwith g++ (6.3). This compiles fine with Clang++ (8.1). I am registering a matrix from the Eigen library as the coordinate type. The header look like:\r\n\r\n```\r\n// Boost.Geometry (aka GGL, Generic Geometry Library)\r\n\r\n// Copyright (c) 2010 Alfredo Correa\r\n// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.\r\n// Copyright (c) 2016 Norbert Wenzel\r\n\r\n// Use, modification and distribution is subject to the Boost Software License,\r\n// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at\r\n// http://www.boost.org/LICENSE_1_0.txt)\r\n\r\n// Modified from the orignal code by Tim Keitt 4/7/17\r\n// Changes Copyright (c) 2017 Tim Keitt\r\n\r\n#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_EIGEN_MATRIX_HPP\r\n#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_EIGEN_MATRIX_HPP\r\n\r\n#define BOOST_GEOMETRY_ADAPTED_EIGEN_MATRIX_TAG_DEFINED\r\n\r\n#include <cstddef>\r\n\r\n#include <boost/type_traits/is_arithmetic.hpp>\r\n\r\n#include <boost/geometry/core/access.hpp>\r\n#include <boost/geometry/core/cs.hpp>\r\n#include <boost/geometry/core/coordinate_dimension.hpp>\r\n#include <boost/geometry/core/coordinate_type.hpp>\r\n#include <boost/geometry/core/tags.hpp>\r\n\r\n#include <Eigen/Dense>\r\n\r\nnamespace boost { namespace geometry\r\n{\r\n\r\n\r\n#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS\r\nnamespace traits\r\n{\r\n\r\n\r\n#ifndef DOXYGEN_NO_DETAIL\r\nnamespace detail\r\n{\r\n\r\n\r\n// Create class and specialization to indicate the tag\r\n// for normal cases and the case that the type of the std-array is arithmetic\r\ntemplate <bool>\r\nstruct eigen_matrix_tag\r\n{\r\n  typedef geometry_not_recognized_tag type;\r\n};\r\n\r\n\r\ntemplate <>\r\nstruct eigen_matrix_tag<true>\r\n{\r\n  typedef point_tag type;\r\n};\r\n\r\n\r\n} // namespace detail\r\n#endif // DOXYGEN_NO_DETAIL\r\n\r\n\r\n// Assign the point-tag, preventing arrays of points getting a point-tag\r\ntemplate <typename CoordinateType, std::size_t DimensionCount>\r\nstruct tag<Eigen::Matrix<CoordinateType, DimensionCount, 1>>\r\n  : detail::eigen_matrix_tag<boost::is_arithmetic<CoordinateType>::value> {};\r\n\r\n\r\ntemplate <typename CoordinateType, std::size_t DimensionCount>\r\nstruct coordinate_type<Eigen::Matrix<CoordinateType, DimensionCount, 1>>\r\n{\r\n  typedef CoordinateType type;\r\n};\r\n\r\n\r\ntemplate <typename CoordinateType, std::size_t DimensionCount>\r\nstruct dimension<Eigen::Matrix<CoordinateType, DimensionCount, 1>>: boost::mpl::int_<DimensionCount> {};\r\n\r\n\r\ntemplate <typename CoordinateType, std::size_t DimensionCount, std::size_t Dimension>\r\nstruct access<Eigen::Matrix<CoordinateType, DimensionCount, 1>, Dimension>\r\n{\r\n  static inline CoordinateType get(Eigen::Matrix<CoordinateType, DimensionCount, 1> const& a)\r\n  {\r\n    return a(Dimension);\r\n  }\r\n\r\n  static inline void set(Eigen::Matrix<CoordinateType, DimensionCount, 1>& a,\r\n                         CoordinateType const& value)\r\n  {\r\n    a(Dimension) = value;\r\n  }\r\n};\r\n\r\n\r\n} // namespace traits\r\n#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS\r\n\r\n\r\n}} // namespace boost::geometry\r\n\r\n\r\n#define BOOST_GEOMETRY_REGISTER_EIGEN_MATRIX_CS(CoordinateSystem) \\\r\nnamespace boost { namespace geometry { namespace traits {      \\\r\ntemplate <class T, std::size_t N>                              \\\r\nstruct coordinate_system<Eigen::Matrix<T, N, 1>>               \\\r\n{                                                              \\\r\n  typedef CoordinateSystem type;                               \\\r\n};                                                             \\\r\n}}}\r\n\r\n\r\n#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_EIGEN_MATRIX_HPP\r\n\r\n```\r\nThe BH R package uses Boost 1.62.\r\n\r\nTHK"},"comment":{"url":"https://api.github.com/repos/boostorg/geometry/issues/comments/323481694","html_url":"https://github.com/boostorg/geometry/issues/416#issuecomment-323481694","issue_url":"https://api.github.com/repos/boostorg/geometry/issues/416","id":323481694,"user":{"login":"awulkiew","id":1226951,"avatar_url":"https://avatars3.githubusercontent.com/u/1226951?v=4","gravatar_id":"","url":"https://api.github.com/users/awulkiew","html_url":"https://github.com/awulkiew","followers_url":"https://api.github.com/users/awulkiew/followers","following_url":"https://api.github.com/users/awulkiew/following{/other_user}","gists_url":"https://api.github.com/users/awulkiew/gists{/gist_id}","starred_url":"https://api.github.com/users/awulkiew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awulkiew/subscriptions","organizations_url":"https://api.github.com/users/awulkiew/orgs","repos_url":"https://api.github.com/users/awulkiew/repos","events_url":"https://api.github.com/users/awulkiew/events{/privacy}","received_events_url":"https://api.github.com/users/awulkiew/received_events","type":"User","site_admin":false},"created_at":"2017-08-18T23:23:31Z","updated_at":"2017-08-18T23:23:31Z","body":"Ok, so you adapt `Eigen::Matrix` to Boost.Geometry Point concept. The code above looks ok.\r\n\r\nWhat's the program you're compiling? I see that you're creating R-tree and passing `std::pair<Eigen::Matrix<...>, double>` as ValueType. Is that correct? Or are you calling some algorithm?\r\n\r\nThe `NOT_VALID_INDEXABLE_TYPE` MPL assertion occurs when `tag<ValueType>::type` is neither point_tag, box_tag nor segment_tag. Could you check in your code if the tag is set properly? E.g.: `std::cout << boost::is_same<bg::tag<Eigen::Matrix<...>>::type, point_tag>::value;`.\r\n\r\nHow are you including Boost.Geometry in your code and what is the order of includes? It's possible that the order of `#includes` is important for GCC. This wouldn't be the first time something like this happen with this compiler."}}
{"actor":{"display_login":"awulkiew"}}