-
-
Notifications
You must be signed in to change notification settings - Fork 381
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
Illegal instruction 4 with old Mac #764
Comments
This has come up a couple of times for users lately. I think it may indirectly depend on the OS because different compilers might make a different guess about the optimizer flags, but the underlying issue is wrong optimization flags being set for the CPU. I don't think the command line options will work because the error arises in ITK, and command line CMake options don't get passed through to the external projects in a Superbuild. There is apparently a way to fix this |
To be clear, the devs believe the issue is that your CPU is older than corei7, which is what our default "arch" setting is: You can adjust this by adding "-march=native" to your compile options. |
Do we think any of the recent CMake changes have fixed this? |
No, the issue is that a commit from @hjmjohnson set the lowest level of instruction sets to "new" CPUs: ANTs/CMake/ITKSetStandardCompilerFlags.cmake Lines 241 to 247 in bcab744
The solution is the user can override these settings. |
I found a machine that produces this error, so I looked into it a bit. Adding
to the cmake call worked (using GCC 4.9.1 on Linux). I guess for portable builds one would want to replace "native" with "x86-64". It looks like "corei7" has been removed from the list of GCC supported architectures: https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html So I'm not sure what a modern GCC will do with "-march=corei7". |
Updated the Wiki, going to close this and related issues |
Just in case anybody else runs across this issue--
I have an old Mac Pro (Early 2009). Any binary from compiling the latest ANTs gives me the error "Illegal instruction: 4". I traced it to this change. Using the previous version of the file corrects this problem. Based on the commit message, I've tried changing the optimization flags to
and
but neither attempt caused things to work.
The text was updated successfully, but these errors were encountered: