-
-
Notifications
You must be signed in to change notification settings - Fork 383
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
Splinecage example crashes on OS X #273
Comments
@rainman110 FYI it also crashes on my old MacbookPro 2009 Snow Leopard. I'll try to compile with -O1 optimization flag to check your tweak is ok. I'm not sure it's a compiler issue, since clang/linux passes. I had a look at the |
@rainman110 The only call to
|
Wow, so OpenCASCADE exists since Matra datavision was working on a new version of Euclid ( ( late 70/80-ies ) written in Fortran ), called Euclid Quantum, which we now know as OCC. Possible this is a remnant of the ol' Euclid code base? @rainman110 , more practically, yes this does smell of a side-effect of a clang optimization. I usually am up to date with XCode, hence up to date with Clang ( not sure if this is an "advantage" with OCC ) I dont think this section of OCC ( however relevant... ) sees a lot of updates. Its quite possible that the OCCT team has overseen this issue while updating the codebase to work with recent clang compilers? |
@jf--- Maybe the OCCT team has overseen this issue. The splinecage example is too large to pinpoint the problem. It would be cool, if we could create a minimal C++ example and test it against both OCE (0.16) and the latest OCCT. The file |
By the way, this looks a lot like our problem: To be more correct, this IS our problem. It seems, that Roman Lygin found a workaround by applying
on the static functions of this file. To sum this bug up:
|
Wow, actual compiler bugs are pretty rare, interesting to see that... What's the best way to resolve things?
|
@jf--- I could test it with the newest xcode. Still I think this should be fixed inside the code - i.e. use Romans fix, in case someone compiles it with an older xcode/clang. Actually compiler bugs are not that rare. In particular my Fortran colleages have problems to find ANY fortran compiler that works correctly with the newer fortran (2003?) specification. They report compiler issues almost every week 😁 |
@tpaviot As this issue is OCE specific, we should do something on the OCE side. We could
|
@rainman110 of course, please open an issue on the oce issue tracker |
I can confirm, that both workarounds seem to work:
I'll produce new binaries with new new Xcode tool chain. |
@rainman110 happy to hear so, looking fwd & thanks in advance for the new build! |
@rainman110 I think we should include the Roman's fix into oce, in order to let oce compile/work on older xcode/clang versions. Could you create a PR on the oce repository ? |
I updated the oce conda package for OS X. The splinecage example now works on my machine. I close this issue, since the example works and work has to be done only for OCE. I'll make a PR for OCE. Until then, we'll leave the OCE related issue open. |
I know, @jf--- already brought this up, but I can't find the issue anymore.
The example crashes with an illegal instruction.
Steps to reproduce:
core_geometry_splinecage.py
from the examples directoryI analyzed it problem and have three observations:
src/AdvApp2Var/AdvApp2Var_ApproxF2var.cxx
(in particular the functionmma2fnc_
). Compiling this file only with optimization level -O1 "fixes" the problem - i.e. it does not crash then.I still need to understand, why the code crashes. The code looks really compilicated and might be automatically translated from fortran. Maybe the compiler (clang) gets a hickup if we let him optimize too much.
@jf--- In what machine did you develop this example code? Was is also on a Mac but it didn't crash on your machine? If yes, the problem might also depend again the compiler version.
The text was updated successfully, but these errors were encountered: