Build error with GCC 12 when importing Boost Geometry
This has been discovered on Fedora 36 which uses GCC 12.2.1 by default, but it likely affects all build environments that use GCC 12.
When compiling source that imports boost/geometry/geometry.hpp
, the build fails. This has been encountered when building library/FieldUtils/ProcessModules/ProcessInterpPoints.cpp
. The error is as follows:
In file included from /usr/include/boost/geometry/geometries/geometries.hpp:28,
from /usr/include/boost/geometry/io/svg/svg_mapper.hpp:43,
from /usr/include/boost/geometry/geometry.hpp:127,
from /usr/include/boost/geometry.hpp:17,
from /root/rpmbuild/BUILD/nektar-v5.3.0/library/FieldUtils/ProcessModules/ProcessInterpPoints.cpp:40:
/usr/include/boost/geometry/geometries/point_xyz.hpp: In member function ‘void boost::geometry::model::d3::point_xyz<CoordinateType, CoordinateSystem>::x(const CoordinateType&)’:
/usr/include/boost/geometry/geometries/point_xyz.hpp:68:27: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Key, class _Compare, class _Alloc> class std::set’
68 | { this->template set<0>(v); }
| ^
/usr/include/boost/geometry/geometries/point_xyz.hpp:68:27: note: expected a type, got ‘0’
/usr/include/boost/geometry/geometries/point_xyz.hpp:68:27: error: template argument 2 is invalid
/usr/include/boost/geometry/geometries/point_xyz.hpp:68:27: error: template argument 3 is invalid
/usr/include/boost/geometry/geometries/point_xyz.hpp: In member function ‘void boost::geometry::model::d3::point_xyz<CoordinateType, CoordinateSystem>::y(const CoordinateType&)’:
/usr/include/boost/geometry/geometries/point_xyz.hpp:72:27: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Key, class _Compare, class _Alloc> class std::set’
72 | { this->template set<1>(v); }
| ^
/usr/include/boost/geometry/geometries/point_xyz.hpp:72:27: note: expected a type, got ‘1’
/usr/include/boost/geometry/geometries/point_xyz.hpp:72:27: error: template argument 2 is invalid
/usr/include/boost/geometry/geometries/point_xyz.hpp:72:27: error: template argument 3 is invalid
/usr/include/boost/geometry/geometries/point_xyz.hpp: In member function ‘void boost::geometry::model::d3::point_xyz<CoordinateType, CoordinateSystem>::z(const CoordinateType&)’:
/usr/include/boost/geometry/geometries/point_xyz.hpp:76:27: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _Key, class _Compare, class _Alloc> class std::set’
76 | { this->template set<2>(v); }
| ^
/usr/include/boost/geometry/geometries/point_xyz.hpp:76:27: note: expected a type, got ‘2’
/usr/include/boost/geometry/geometries/point_xyz.hpp:76:27: error: template argument 2 is invalid
/usr/include/boost/geometry/geometries/point_xyz.hpp:76:27: error: template argument 3 is invalid
In file included from /usr/include/boost/math/tools/cxx03_warn.hpp:9,
from /usr/include/boost/math/constants/constants.hpp:11,
from /usr/include/boost/geometry/util/math.hpp:30,
from /usr/include/boost/geometry/core/radian_access.hpp:33,
from /usr/include/boost/geometry/geometry.hpp:51:
This has been reported as an issue in the Boost Geometry GitHub repo: https://github.com/boostorg/geometry/issues/1009.
Currently investigating options for a fix.