cgal and emscripten

230 views
Skip to first unread message

Alessio Mochi

unread,
Oct 20, 2020, 12:20:28 PM10/20/20
to emscripten-discuss
Hello,

I am not able to compile 
this piece of code of cgal library

CGAL_assertion_msg(-CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1),
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?");
CGAL_assertion_msg(-CGAL_IA_DIV(-1., 10) != CGAL_IA_DIV(1., 10),
"Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?");

I tried to use -frounding-math with a simple example with this compiler flag
I get a warning and I think this flag is not supported.

I am able to compile cgal library if exclude this code but when I run the cgal corefine example I get crash. Is it possible that the missed flag can change the CGAL calculations?

Floh

unread,
Oct 21, 2020, 7:47:12 AM10/21/20
to emscripten-discuss
I suspect that this isn't a WASM issue, but a gcc vs clang issue, see this cgal issue thread:

https://github.com/CGAL/cgal/issues/3180

Also there seems to be clang-specific workarounds here:


...and this CGAL_FPU_HAS_EXCESS_PRECISION define is here:


...all those hardwired x86 architecture checks look a bit suspicious. I guess the platform/compiler detection in cgal fails when compiling for WASM.

Cheers,
-Floh.

Alessio Mochi

unread,
Oct 21, 2020, 12:44:27 PM10/21/20
to emscripte...@googlegroups.com
emscripen will support  -frounding-math in the next release?

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/f4446e0d-6e8d-4101-9da9-b6d4cfb010dao%40googlegroups.com.

Liam

unread,
Jul 15, 2021, 4:04:27 AM7/15/21
to emscripten-discuss
Hello, I am Liam.

I saw your article on emscripten-discuss. Can you tell me about your project? For example, how to include the CGAL library when building with emscripten.
I heard that with the CGAL 5.3 release, an option related to your problem has been added. I expect this option will solve your problem.

best regards

2020년 10월 21일 수요일 오전 1시 20분 28초 UTC+9에 ale2...@gmail.com님이 작성:
Reply all
Reply to author
Forward
0 new messages