Skip to content
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

Build issue with ITK on Apple Silicon #1619

Open
dcoeurjo opened this issue Dec 7, 2021 · 7 comments
Open

Build issue with ITK on Apple Silicon #1619

dcoeurjo opened this issue Dec 7, 2021 · 7 comments

Comments

@dcoeurjo
Copy link
Member

dcoeurjo commented Dec 7, 2021

When build DGtal on a M1, there is no problem except when setting -DWITH_ITK=true which produces:

Consolidate compiler generated dependencies of target DGtal
[  1%] Building CXX object CMakeFiles/DGtal.dir/src/DGtal/base/Bits.cpp.o
In file included from /Users/davidcoeurjolly/Sources/DGtal/src/DGtal/base/Bits.cpp:30:
In file included from /Users/davidcoeurjolly/Sources/DGtal/src/DGtal/base/Bits.h:32:
In file included from /Users/davidcoeurjolly/Sources/DGtal/src/DGtal/base/Common.h:99:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/usr/include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
...

Ping @kerautret

@dcoeurjo
Copy link
Member Author

dcoeurjo commented Dec 7, 2021

Have you already experienced something like that @kerautret ?

@kerautret
Copy link
Member

yes I see it on the GitHub Actions when trying to activate ITK on MacOS build, it looks like that the include of cmath.h from Xcode build system find first the math.h of /usr/local/include before the one of Xcode Tools chain.

@kerautret
Copy link
Member

Same problem here trying to activate ITK and macos GitHub Actions: (with a cmake small try fix)
https://github.com/kerautret/DGtal/runs/4445372646?check_suite_focus=true

@kerautret
Copy link
Member

@dcoeurjo have you tried to use the the CommandLineTools SDK instead the XCode SDK, by using:
sudo xcode-select -s /Library/Developer/CommandLineTools
It looks to be better when using ITK from brew (I tested on my non M1 Mac it works while also failing with Xcode SDK)

@dcoeurjo
Copy link
Member Author

THanks for the tip, I'm not super fan of changing the SDK globally.. (I wasn't expecting that the command line has a different sdk than Xcode.. weird..)

@kerautret
Copy link
Member

kerautret commented Dec 17, 2021

THanks for the tip, I'm not super fan of changing the SDK globally.. (I wasn't expecting that the command line has a different sdk than Xcode.. weird..)

I am agree not ideal, for instance I detected that Unreal Engine was no more working by using this SDK! 😱

@kerautret
Copy link
Member

kerautret commented Dec 17, 2021

@dcoeurjo I tested a simple ITK helloworld project and it fails from the same errors so the problem is not related to DGtal itself but more from brew/ITK/osXSDK. I try to ask it on the ITK dev forum if they get a good workaround to fix it :). (since just test using #include and no errors).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants