-1

I have trying to wrap a small part of CGAL (Computational Geometry Algorithms Library) using cppyy. I get completely unreadable error messages. Are these messages just being passed through from CGAL?

Here is one of the messages. I have chopped the long lines up into pieces:

Which I have deleted. Some research revealed that these un-readable error messages are a well-known problem which gcc and clang are working on.

Here is a survey paper:

Compiler Error Messages Considered Unhelpful: The Landscape of Text-Based Programming Error Message Research
  Brett A. Becker, Paul Denny, Raymond Pettit, Durell Bouchard,
  Dennis J. Bouvier, Brian Harrington, Amir Kamil, Amey Karkare,
  Chris McDonald, Peter-Michael Osera, Janice L. Pearce,
  James Prather
ITiCSE-WGR '19: Proceedings of the Working Group Reports on
Innovation and Technology in Computer Science Education,
December, 2019; Pages 177–210;
https://doi.org/10.1145/3344429.3372508
  • 2
    *"I have chopped the long lines up into pieces:"* -- yes you did, and by doing so you made the message less readable, in my view. Better would have been to leave the lines as-is and format the message as a code block (language `none` if you know how to do that). – JaMiT Dec 12 '21 at 02:03

1 Answers1

0

Since you're only asking what the message means ...

overlap is apparently a templated function. You're calling it from Python using cgal.CGAL.overlay(ar0, ar1, big, FOLT). Thus, cppyy tries to match the argument types (ar0 etc.) to instantiate that overlap function. That is what fails and the reported messages are the instantiations that were tried.

Yes, C++ template error messages are rather ugly/indecipherable. Is the nature of the beast.

Aside, note that if CGAL is using expression templates, then these have a tendency to grow more in Python than they do in C++ b/c assignments in C++ force them to collapse, whereas assignments in Python are by reference. If you want the same type collapse in Python, use an explicit constructor or __assign__. (Alternatively, you can use type reducers to force the collapse before returning to Python, but that only works if the use of the expression templates is very systematic. Use of a constructor allows more detailed control otherwise.)

Wim Lavrijsen
  • 3,453
  • 1
  • 9
  • 21