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

prepare for integration into FS #12

Merged
merged 2 commits into from
Mar 13, 2024
Merged

prepare for integration into FS #12

merged 2 commits into from
Mar 13, 2024

Conversation

yhuang43
Copy link
Contributor

handle ARM64 Mac build

  handle ARM64 Mac build
@ste93ste
Copy link
Collaborator

The PR is causing the CI to stall for Mac OS.
Do we need to add additional flags in https://github.com/freesurfer/samseg/blob/dev/.github/workflows/macos_build.sh?

@yhuang43
Copy link
Contributor Author

I added this section to CMakeLists.txt. But if CMAKE_C_COMPILER and CMAKE_CXX_COMPILER are not passed, it goes into infinite configuration loop. Any suggestions? Maybe change setup.py to detect the platform, and hard-coded there?

if(APPLE)
set(CMAKE_C_COMPILER "/usr/bin/clang")
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")

set -DAPPLE_ARM64=ON on cmake command line for arm64 build

if(APPLE_ARM64)
set(CMAKE_OSX_ARCHITECTURES "arm64")
add_definitions(-DARM64 -DDarwin -DPNG_ARM_NEON_OPT=0)
endif()
endif()

@yhuang43
Copy link
Contributor Author

darwin_x86_64 works fine w/o the addition. I think I will just change the condition to the top condition to 'if(APPLE_ARM64)' instead of 'if(APPLE)'. But it will be using a different compiler than Freesurfer to compile the bindings.

  fix infinite cmake configuration loop on Mac build
  when building with freesurfer, CMAKE_C_COMPILER and CMAKE_CXX_COMPILER will be specified on the cmake command line
@ste93ste ste93ste merged commit 8087e69 into freesurfer:dev Mar 13, 2024
3 checks passed
@ste93ste
Copy link
Collaborator

Thanks for fixing it!

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

Successfully merging this pull request may close these issues.

2 participants