From 74b39a2795dc2d8638afb3c71a5547d2c1569e14 Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Mon, 2 Dec 2024 01:32:20 -0500 Subject: [PATCH 1/5] CI: Add some CI debug info --- .github/workflows/wheels_faster.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/wheels_faster.yml b/.github/workflows/wheels_faster.yml index 779a2fac..9af42bd5 100644 --- a/.github/workflows/wheels_faster.yml +++ b/.github/workflows/wheels_faster.yml @@ -14,28 +14,28 @@ jobs: # Have to specify python version twice so that the same python is used to build and test # Need to quote decimal versions as string to avoid the "Norway problem" - # Windows 64-bit - - os: windows-latest - python: '3.11' - cibw_python: 311 - platform_id: win_amd64 + # Windows 64-bit - broken due to ITK issues + # - os: windows-latest + # python: '3.12' + # cibw_python: 312 + # platform_id: win_amd64 # Linux 64-bit - os: ubuntu-latest - python: '3.11' - cibw_python: 311 + python: '3.12' + cibw_python: 312 platform_id: manylinux_x86_64 # macOS on Intel 64-bit - os: macos-13 - python: '3.11' - cibw_python: 311 + python: '3.12' + cibw_python: 312 arch: x86_64 platform_id: macosx_x86_64 # macOS on Apple M1 64-bit, supported for Python 3.10 and later - os: macos-14 - python: '3.11' + python: '3.12' cibw_python: 311 arch: arm64 platform_id: macosx_arm64 @@ -77,6 +77,14 @@ jobs: run: | macos_version=$(sw_vers -productVersion | awk -F '.' '{print $1".0"}') echo "MACOSX_DEPLOYMENT_TARGET=${macos_version}" >> $GITHUB_ENV + echo -n "clang version : " + clang --version + echo -n "xcode version : " + xcode-select -p + echo -n "cmake version : " + cmake --version + echo -n "env : " + env - name: Build wheels env: From 53dd482f7543770be2d8c384cbd924a743ece31c Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Mon, 2 Dec 2024 01:34:23 -0500 Subject: [PATCH 2/5] CI: Fix python version --- .github/workflows/wheels_faster.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels_faster.yml b/.github/workflows/wheels_faster.yml index 9af42bd5..ac2093da 100644 --- a/.github/workflows/wheels_faster.yml +++ b/.github/workflows/wheels_faster.yml @@ -36,7 +36,7 @@ jobs: # macOS on Apple M1 64-bit, supported for Python 3.10 and later - os: macos-14 python: '3.12' - cibw_python: 311 + cibw_python: 312 arch: arm64 platform_id: macosx_arm64 From 9875bbe9abe13792192b55d60f60764953486a70 Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Mon, 2 Dec 2024 02:08:10 -0500 Subject: [PATCH 3/5] COMP: Set CMAKE_OSX_SYSROOT --- CMakeLists.txt | 12 ++++++------ scripts/configure_ITK.sh | 13 +++++-------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ba0e0f1..572a755f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.16.3...3.26) project(ants LANGUAGES CXX) +# Set the macOS SDK root +if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(CMAKE_OSX_SYSROOT "$(xcrun --show-sdk-path)") + message(STATUS "Using macOS SDK: ${CMAKE_OSX_SYSROOT}") +endif() + set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Try to import all Python components potentially needed by nanobind @@ -25,12 +31,6 @@ set(ITK_DIR "./itkbuild") find_package(ITK REQUIRED) include(${ITK_USE_FILE}) -if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") - include_directories(/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1) - set(ENV{PATH} "$ENV{PATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1") - add_compile_options(-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1) -endif() - # ANTS add_library(antsUtilities STATIC src/antscore/antsUtilities.cxx src/antscore/antsCommandLineOption.cxx src/antscore/antsCommandLineParser.cxx src/antscore/ReadWriteData.cxx src/antscore/ANTsVersion.cxx) add_library(registrationUtilities STATIC src/antscore/antsRegistrationTemplateHeader.cxx diff --git a/scripts/configure_ITK.sh b/scripts/configure_ITK.sh index b38f8c23..d8d9a9b2 100755 --- a/scripts/configure_ITK.sh +++ b/scripts/configure_ITK.sh @@ -38,25 +38,22 @@ cd ../ echo "Dependency;GitTag" > ./data/softwareVersions.csv echo "ITK;${itktag}" >> ./data/softwareVersions.csv -# if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") -# include_directories(/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1) -## set(ENV{PATH} "$ENV{PATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1") -# add_compile_options(-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1) -# endif() - mkdir -p itkbuild cd itkbuild compflags=" -Wno-c++11-long-long -fPIC -O2 -DNDEBUG " +osx_sysroot="" if [[ `uname` == 'Darwin' ]] ; then - compflags=" -Wno-c++11-long-long -fPIC -O2 -DNDEBUG -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 -stdlib=libc++ " + osx_sysroot=$(xcrun --sdk macosx --show-sdk-path) fi + cmake \ -G"${ADD_G}" \ -DITK_USE_SYSTEM_PNG=ON \ -DCMAKE_SH:BOOL=OFF \ -DCMAKE_BUILD_TYPE:STRING="${CMAKE_BUILD_TYPE}" \ - -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} -Wno-c++11-long-long -fPIC -O2 -DNDEBUG "\ + -DCMAKE_OSX_SYSROOT="${osx_sysroot}" \ + -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS} ${compflags}"\ -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} ${compflags} "\ -DITK_USE_GIT_PROTOCOL:BOOL=OFF \ -DBUILD_SHARED_LIBS:BOOL=OFF \ From 52d31096d20c19988f41f0399a5a4baf0e554c24 Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Mon, 2 Dec 2024 08:56:14 -0500 Subject: [PATCH 4/5] BUG: wrong use of bash subshell in cmake file --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 572a755f..a12dda6f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,12 @@ project(ants LANGUAGES CXX) # Set the macOS SDK root if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set(CMAKE_OSX_SYSROOT "$(xcrun --show-sdk-path)") + execute_process( + COMMAND xcrun --show-sdk-path + OUTPUT_VARIABLE SDK_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + set(CMAKE_OSX_SYSROOT ${SDK_PATH}) message(STATUS "Using macOS SDK: ${CMAKE_OSX_SYSROOT}") endif() From 08fcc1412bef39ea5959910a157306ecbc9f49b9 Mon Sep 17 00:00:00 2001 From: Philip Cook Date: Mon, 2 Dec 2024 11:40:24 -0500 Subject: [PATCH 5/5] CI: Turn Windows build back on --- .github/workflows/wheels_faster.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/wheels_faster.yml b/.github/workflows/wheels_faster.yml index ac2093da..dc807f33 100644 --- a/.github/workflows/wheels_faster.yml +++ b/.github/workflows/wheels_faster.yml @@ -14,11 +14,11 @@ jobs: # Have to specify python version twice so that the same python is used to build and test # Need to quote decimal versions as string to avoid the "Norway problem" - # Windows 64-bit - broken due to ITK issues - # - os: windows-latest - # python: '3.12' - # cibw_python: 312 - # platform_id: win_amd64 + # Windows 64-bit + - os: windows-latest + python: '3.12' + cibw_python: 312 + platform_id: win_amd64 # Linux 64-bit - os: ubuntu-latest