Modify

Opened 4 years ago

Last modified 3 years ago

#10920 new Bugs

Boost error from XlC11. 01 using BOOST 1.53 in union

Reported by: devika.rs@… Owned by: Barend Gehrels
Milestone: To Be Determined Component: geometry
Version: Boost 1.53.0 Severity: Problem
Keywords: Union on XlC11.1 Cc: devika.rs@…

Description

Hi All,

We are trying to compile sample boost code to demonstrate union on Aix64: Testcase: http://www.boost.org/doc/libs/1_55_0/libs/geometry/doc/html/geometry/reference/algorithms/union_.html

Following are the details of compiler Xlc Version:Version: 11.01.0000.0011 OS version:6100-06-05-1115 Boost version:1.53

It throws errors: "/usr/vacpp/include/vector.t", line 163.36: 1540-0716 (S) The template argument "std::vector<boost_1_53_0::geometry::model::ring<boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector<boost_1_53_0::geometry::model::ring<boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector<boost_1_53_0::geometry::model::ring<boost_1_53_0::geometry::mod..." does not match the template parameter "template class Container". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "_Ucopy". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "class std::vector<boost_1_53_0::geometry::model::ring<boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector<boost_1_53_0::geometry::model::ring<boost_1_53_0::geometry::model::d2::point_xy<double,snps_boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector,std::allocator>,std::allocator<boost_1_53_0::geometry::model::ring<boost_1_53_0::geometry::model:...". "/usr/vacpp/include/vector.t", line 163.36: 1540-1174 (S) The member "template pointer _Ucopy(_It, _It, pointer)" is not declared as a template in its containing class definition. "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "_Ucopy". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "class std::vector<boost_1_53_0::geometry::model::ring<boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector,std::allocator>,std::allocator<boost_1_53_0::geometry::model::ring<boost_1_53_0::geometry::model::d2::point_xy<double,snps_boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector,std::allocator> > >". "/boost/boost/geometry/geometries/polygon.hpp", line 69.7: 1540-0700 (I) The previous message was produced while processing "class boost_1_53_0::geometry::model::polygon<boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector,std::vector,std::allocator,std::allocator>". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "main()". "/usr/vacpp/include/vector.t", line 163.36: 1540-0716 (S) The template argument "std::vector<boost_1_53_0::geometry::model::polygon<snps_boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector<boost_1_53_0::geometry::model::polygon<boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector<boost_1_53_0::geometry::model::polygon<boost_1_53_0::geom..." does not match the template parameter "template class PointList?". "/usr/vacpp/include/vector.t", line 163.36: 1540-0700 (I) The previous message was produced while processing "_Ucopy". "/usr/vacpp/include/vector.t", line 163.36: 1540-0700 (I) The previous message was produced while processing "class std::vector<boost_1_53_0::geometry::model::polygon<boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector<boost_1_53_0::geometry::model::polygon<snps_boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector,std::vector,std::allocator,std::allocator>,std::allocator<boost_1_53_0::geometry::model::polygon...". "/remote/ports/aix/xlcpp11_1_aix53/usr/vacpp/include/vector.t", line 163.36: 1540-1174 (S) The member "template pointer _Ucopy(_It, _It, pointer)" is not declared as a template in its containing class definition. "test.cpp", line 25.26: 1540-0700 (I) The previous message was produced while processing "_Ucopy". "test.cpp", line 25.26: 1540-0700 (I) The previous message was produced while processing "class std::vector<boost_1_53_0::geometry::model::polygon<boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector,std::vector,std::allocator,std::allocator>,std::allocator<boost_1_53_0::geometry::model::polygon<boost_1_53_0::geometry::model::d2::point_xy<double,boost_1_53_0::geometry::cs::cartesian>,1,1,std::vector,std::vector,std::allocator,std::allocator> > >". "test.cpp", line 12.5: 1540-0700 (I) The previous message was produced while processing "main()".

Is this a known bug ? Please help us in case a patch is available.

Attachments (1)

union.txt (22.8 KB) - added by anonymous 3 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 4 years ago by awulkiew

Hi,

I personally am not aware of this problem. I have no access to an AIX machine.

Is the code in test.cpp exactly the same as on the page? Or have you tried the example contained in BOOST_ROOT/libs/geometry/doc/src/examples/algorithms/union.cpp (https://github.com/boostorg/geometry/blob/boost-1.53.0/doc/src/examples/algorithms/union.cpp) ?

Could you try to find what exactly fails to compile. Is it model::polygon, read_wkt or union_? Are you able to compile the bg::model::polygon properly? For example:

    typedef boost::geometry::model::d2::point_xy<double> point;
    typedef boost::geometry::model::polygon<point> polygon;

    polygon p;

If it was ok and you tried to add other things from the example, when does the code stop to compile?

Could you provide more info or contact the developers on the mailing list (http://lists.boost.org/mailman/listinfo.cgi/geometry)?

Changed 3 years ago by anonymous

Attachment: union.txt added

comment:2 Changed 3 years ago by anonymous

Hi,

read_wkt is not causing the problem.

These four line:

typedef boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<double> > polygon;

polygon green, blue;

std::vector<polygon> output;

boost::geometry::union_(green, blue, output);

Please find the attachment union.txt for full error message.

comment:3 Changed 3 years ago by Barend Gehrels

Apparently the geometry::model::ring class itself does not compile:

"/remote/ports/aix/xlcpp11_1_aix53/usr/vacpp/include/vector.t", 
line 163.36: 1540-0716 (S) The template argument 
"std::vector<boost_1_53_0::geometry::model::ring
<boost_1_53_0::geometry::model::d2::point_xy
<double,boost_1_53_0::geometry::cs::cartesian>,1,1,
std::vector<boost_1_53_0::geometry::model::ring
<boost_1_53_0::geometry::model::d2::point_xy
<double,boost_1_53_0::geometry::cs::cartesian>,1,1,
std::vector<boost_1_53_0::geometry::model::ring
<boost_1_53_0::geometry::mod..." 

does not match the template parameter "template class Container".

What kind of STL is used by AIX? Is it compliant? Can you maybe use stlport?

comment:4 Changed 3 years ago by awulkiew

I'm guessing that at this point we shouldn't change the definition of a model::ring<> and model::polygon<>. So we are unable to fix it on our side.

But those types (model::ring, model::polygon) are just the default ones implemented for the users convenience. Boost.Geometry allows to use any user-defined type as long as it's adapted to one of the Geometry concepts. See:

and in particular:

You could implement your own ring and polygon types, adapt them to Boost.Geometry concepts and use with the algorithms. Consider one of the methods below:

USE MACRO FOR ADAPTATION

You could use one of the REGISTER_XXX macros which generates the adaptation code automatically, see:

and in particular:

It could look as simple as this:

typedef boost::geometry::model::d2::point_xy<double> point_2d;
struct ring_2d : public std::vector<point_2d> {}
BOOST_GEOMETRY_REGISTER_RING(ring_2d)

ADAPT YOUR OWN TYPE MANUALLY

The most simple way of doing it would be to copy the contents of Boost.Geometry files defining the models, e.g. see:

Then remove unneeded template parameters (e.g. Container for ring and PointList,RingList for polygon) and internally use e.g. std::vector<> everywhere instead. Then adapt this type properly, so remove the template parameters also from traits' specializations below, etc.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Barend Gehrels.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.