New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XS test failing when compiling on Debian Wheezy because of old GCC version (4.7.2) #1965
Comments
Hm, not nice. It compiles and tests fine on all my OS X machines, various systems using clang and gcc. Will test on Ubuntu, crossing fingers... |
Tried on another debian machine(same cc version), exactly same result ... |
Another bad news - building XS with |
Works with -Os, -O1, -O1 with all -f<> optimizations of O2 enabled ... Current workaround is placing
into |
:-/ |
Bad news: compilation and XS tests succeed on my Ubuntu x86_64 with gcc 4.6.3... |
It succeeds also on a Ubuntu i386 with same gcc 4.6.3... |
If I were able to reproduce the issue I would try to write a simple C++ executable test case. |
Hmm :-( |
Isn't "-O1 with all -f<> optimizations of O2 enabled" equal to -O2? |
No, it isn't (according to google and stack overflow). Some optimizations are only affected by -O level and not exported otherwise (by design). |
Thanks to @ledvinap's research: https://svn.boost.org/trac/boost/ticket/8695 Just compile code from ticket in xs/src directory (attached, just use Also kicad folks had been bitten too: |
here is the test file: https://drive.google.com/file/d/0B9HM4UOKDQBLQXlnMHFlYXc4bHM/edit?usp=sharing |
To summarize the problem, a bug introduced in GCC 4.7.0 and fixed in 4.7.3 prevents Boost.Polygon from returning correct results when -O2 or -O3 are used. The bug was reported to Boost.Polygon maintainers in https://svn.boost.org/trac/boost/ticket/8695 but they closed it as worksforme since it can't be reproduced with an updated version of GCC. I reported the bug to Debian maintainers in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=746261 but it's unlikely they will upgrade GCC or backport a patch for it. I tried using a #pragma GCC optimize ("O0") Available options are:
|
Simplest solution is probably detecting 4.7.[0-2] gcc in Build.PL and use -O1 + enable all optimization options that have command line option and are enabled in -O2
|
Could someone test slicing speed difference on working gcc? I can't do it simply myself ... |
|
What about having the O3 -f optimizations added too? Have you tried? |
Bad news. ExtUtils::CBuilder forces the same optimization options used when compiling perl. I guess this is sane behavior, since the compiled library wouldn't be linkable to perl if they used different flags. |
…l with some versions of GCC like the one provided by Boost.Polygon. #1965
New get_trapezoids2() in place. It doesn't use Boost.Polygon anymore. Not too slow. |
BTW: here is (vary badly designed) test slicing bunny-flatfoot.stl from #1916. Ten runs were made for each optimization level on slightly loaded server, only user time reported:
Nothing representative (maybe it would be nice to add some test cases to slic3r repository for benchmarking), but quick conclusion is that c optimization after O1 is not something that matters much ... (the -O0 case is interresting ... ) |
Interesting. Those tests are a very useful reference. Unfortunately it looks like we can't use different optimizations settings than the ones used when compiling perl ( |
I think this can be closed now as it was fixed by replacing Boost.Polygon with another algorithm. No further action can be taken regarding -O flags... |
Thank you @ledvinap for your help troubleshooting this one. |
BTW: how does |
I just did a test on the test Debian machine, and that does not work either. This is the generated command: cc -I/usr/lib/perl/5.14/CORE -fPIC -xc++ -D_FILE_OFFSET_BITS=64 -D_GLIBCXX_USE_C99 -DHAS_BOOL -DNOGDI -DSLIC3RXS -O1 -fcaller-saves -fcrossjumping -fcse-follow-jumps -fdevirtualize -fexpensive-optimizations -fgcse -findirect-inlining -finline-small-functions -fipa-cp -fipa-sra -foptimize-register-move -foptimize-sibling-calls -foptimize-strlen -fpartial-inlining -fpeephole2 -free -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -fschedule-insns2 -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftree-builtin-call-dce -ftree-pre -ftree-switch-conversion -ftree-tail-merge -ftree-vrp -Isrc -Ibuildtmp -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -o src/ClipperUtils.o src/ClipperUtils.cpp ExtUtils::CBuilder hard-codes $Config{optimize} at the end of the command ( |
So there is no way to override $Config{optimize} inside Build.PL as if it is done from command line? I am a bit lost, CBuilder is totally new to me (and I am not too keen on learning it) |
Actually, even when supplying it on command line it doesn't override $Config{optimize}... I was referring exactly to that test in the previous message... |
Are you passing |
Yay! Got feedback from Boost devs: |
I confirm |
Sorry for digging old issue here, but I'm building a fresh new install with:
and I get an error (non-blocking) because of this fix (command not found in french):
While this has no impact in my build, maybe we need a cleanup here? |
there seems to be some problem in trapezoid code in master.
get_trapezoids returns empty list. Tracing the code everything is fine until passing polygon to boost::polygon::get_trapezoids() call, but this function returns empty list.
maybe assign is problem after
assign(ps, polygon_set);
:The template magic in boost is out of my reach ...
testing on debian stable,
The text was updated successfully, but these errors were encountered: