using with CGAL compiled without -frounding-math (as currently required on some arm) #259

5263 opened this Issue Jan 29, 2013 · 15 comments


None yet
4 participants

5263 commented Jan 29, 2013

I get the following error when running openscad

terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: -CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1)
File: /home/username/openscad_deps/src/CGAL-4.0.2/include/CGAL/Interval_nt.h
Line: 160
Explanation: Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.


kintel commented Jan 29, 2013

You could always try to raise the issue on the CGAL mailing list - perhaps some of the researchers there have insights into this.


5263 commented Jan 30, 2013

the reasion seems to be an incomplete FPU emulation provided by the glibc.

5263 closed this Jan 30, 2013

This was referenced Jan 30, 2013


donbright commented Feb 1, 2013

if there was a public arm box that offers shell access, i could take a look at this.

(the GNU compile farm doesn't count, it's ARM boxes are down/not accessible)


5263 commented Feb 2, 2013

I was able to compile CGAL with CGAL_DISABLE_ROUNDING_MATH_CHECK set. this way I can run openscad. But i have no idea what the consequences of using a wrong rounding method are.


5263 commented Feb 2, 2013

I tried to run the tests:

system cannot create offscreen GL framebuffer object
system cannot create images

STARTDATE: Feb 02 16:53 CET
ENDDATE: Feb 02 18:49 CET
SYSID: linux2_no_images


69/470 Testing: dumptest_child-tests
69/470 Test: dumptest_child-tests
Command: "/usr/bin/python" "/mnt/ext500/github/openscad/tests/" "--comparator=" "-c" "/usr/bin/convert" "-s" "txt" "/mnt/ext500/github/openscad/tests/build/dumptest" "/mnt/ext500/github/openscad/tests/../testdata/scad/features/child-tests.scad"
Directory: /mnt/ext500/github/openscad/tests/build
"dumptest_child-tests" start time: Feb 02 16:54 CET
diff text compare: 
 expected textfile:  /mnt/ext500/github/openscad/tests/regression/dumptest/child-tests-expected.txt
 actual textfile:  /mnt/ext500/github/openscad/tests/build/dumptest-output/child-tests-actual.txt
<       group();
>       group() {
>           cube(size = [1, 1, 1], center = false);
>       }

Test time =   0.41 sec
Test Failed.
"dumptest_child-tests" end time: Feb 02 16:54 CET
"dumptest_child-tests" time elapsed: 00:00:00

Expected    Actual

184/470 Testing: cgalpngtest_transform-tests
184/470 Test: cgalpngtest_transform-tests
Command: "/usr/bin/python" "/mnt/ext500/github/openscad/tests/" "--comparator=" "-c" "/usr/bin/convert" "-s" "png" "/mnt/ext500/github/openscad/tests/build/cgalpngtest" "/mnt/ext500/github/openscad/tests/../testdata/scad/features/transform-tests.scad"
Directory: /mnt/ext500/github/openscad/tests/build
"cgalpngtest_transform-tests" start time: Feb 02 16:55 CET
Error output: Xlib:  extension "GLX" missing on display ":1.0".
Xlib:  extension "GLX" missing on display ":1.0".
glXChooseFBConfig failed
Can't create OpenGL OffscreenView. Code: -1. Exiting.

Error: cgalpngtest failed with return code 1
ImageMagick image comparison: /usr/bin/convert -alpha Off -compose difference -composite -threshold 10% -morphology Erode Square -format %[fx:w*h*mean] info:
 expected image: /mnt/ext500/github/openscad/tests/regression/cgalpngtest/transform-tests-expected.png

Error: OpenSCAD did not generate an image to test

Test time =  18.44 sec
Test Failed.
"cgalpngtest_transform-tests" end time: Feb 02 16:55 CET
"cgalpngtest_transform-tests" time elapsed: 00:00:18´´´

@kintel kintel added a commit that referenced this issue Feb 2, 2013

@kintel kintel Fix bug assuming negative doubles will overflow a size_t, which faile…
…d on ARM. Related to #259

kintel commented Feb 2, 2013

Could you try rerunning the test with the latest master. I think I fixed the issue causing the dumptest to fail.
About the other tests - they are related to OpenGL - do you have OpenGL drivers and an OpenGL 2.0-capable GPU on this system?
What system are you trying to run this on?


5263 commented Feb 3, 2013

test69 passes.
tests 184-269 fail.
The current system is a shevaplug (marvell kirkwood platform) It's headless and has no GPU. I don't lnow much about OpenGL. Would it make any sense to install addditional software.
I own a rasperry pi as well. It should have OpenGL. But it has even less CPU power. And compiling on these systems takes ages, )


5263 commented Feb 3, 2013

i installed a software renderer and rerun the test

99% tests passed, 5 tests failed out of 470

Total Test time (real) = 7511.36 sec

The following tests FAILED:
        237 - cgalpngtest_polygon-mesh (Failed)
        332 - opencsgtest_polygon-mesh (Failed)
        367 - opencsgtest_example009 (Failed)
        427 - throwntogethertest_polygon-mesh (Failed)
        463 - throwntogethertest_example009 (Failed)
writing 7 images,  32 text pages, and index.html to:
Errors while running CTest

Error output: terminate called after throwing an instance of 'CGAL::Precondition_exception'
  what():  CGAL ERROR: precondition violation!
Expr: oriented_side(f,p) == ON_POSITIVE_SIDE
File: /home/sebastian/openscad_deps/include/CGAL/Triangulation_2.h
Line: 1085

5263 reopened this Feb 3, 2013


kintel commented Feb 3, 2013

Wow, impressive that almost everything worked!

Not sure how to debug the CGAL exception further - perhaps you could try compiling the test suite in debug mode and run the failing test manually, e.g.:

$ cmake -DCMAKE_BUILD_TYPE=Debug .
$ make cgalpngtest
$ ./cgalpngtest ../testdata/scad/dxf/polygon-mesh.scad out.png

..then see if you can get a stacktrace from that exception.

It would also be cool if you could write up a no-brainer howto get this up and running on a SheevaPlug.
I've got a DockStar and could give it a spin on that one when I get some time.


donbright commented Feb 4, 2013

5263 ... This is so cool!!

Marius those failures look like exactly the tests that were affected by my recent modification of the CGAL tessellator to accept 'non-simple' (self intersecting etc) polygons. . .


Maybe I should not have submitted that change?


kintel commented Feb 4, 2013

I haven't noticed such issues after that commit though - why would it only affect ARM.
Admittedly, "all" other computers run on Intel-type CPU's these days, so who knows what's actually supported by external libraries..


5263 commented Feb 4, 2013

for comparrsion I installed openscad 2011.3 from the raspbian repos on my raspberry pi.
On armhf all the rounding modes for CGAL seems to work.
I ran the tests, though most of the problems are obsolete by now.

Maybe i need to setup some cross compilation framework, before i compile recent versions of CGAL, openscad and the tests.


kintel commented Feb 5, 2013

Hehe, yeah - a cross-compilation framework would be cool. I've heard it's a bit of a hassle to set up - it would certainly be cool to have it somewhat documented :)

Hi, as recently flagged on the OpenSCAD mailing list I have bumped against the same issue while trying to get OpenSCAD on an Android tablet.

Here is what I did and what I got:

  • Nexus 7 2013
  • Installed Android app GNURoot
  • Installed Debian
  • Run as 'force root'
  • Installed Android app XServer XSDL
  • Accessed Debian GUI via XServer XSDL
  • did 'apt-get install openscad'
  • successfully (no errors) installed OpenSCAD
  • tried to run openscad from the command line
  • failed with error quoted below:

terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: -CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1)
File: /usr/include/CGAL/Interval_nt.h
Line: 160
Explanation: Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?

I already kindly got pointed here by Marius, I will try to learn more about CGAL but as I am really not a developer and have never compiled anything from sources before, while I am willing and keen to learn, please don't assume I know anything beyond basic use as above.

That said I have 2 hands, can follow instructions and would be delighted to help any effort to test this issue further, and as Marius suggested I will try to learn more about CGAL... I really want OpenSCAD in my pocket to allow me to develop my 3D printing projects in odd snippets of time I get.

Would a bounty help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment