Skip to content

Conversation

@hjmjohnson
Copy link
Member

@hjmjohnson hjmjohnson commented Nov 18, 2025

castxml fails to configure ITK properly

FAILED: [code=1] Wrapping/Modules/ITKCommon/itkVersorPython.cpp Wrapping/Generators/Python/itk/itkVersorPython.py <ITK_BLD>/Wrapping/Modules/ITKCommon/itkVersorPython.cpp <ITK_BLD>/Wrapping/Generators/Python/itk/itkVersorPython.py

cd <ITK_BLD>/Wrapping/Typedefs/python && \
  /opt/homebrew/bin/ccache <ITK_BLD>/Wrapping/Generators/SwigInterface/swigmacos-arm64-2024-03-26-master/bin/swig \
  -c++ -python -fastdispatch -fvirtual -features autodoc=2 -doxygen -Werror -w302 -w303 -w312 -w314 -w361 -w362 -w350 -w383 -w384 -w389 -w394 -w395 -w467 -w508 -w509 \
  -o <ITK_BLD>/Wrapping/Modules/ITKCommon/itkVersorPython.cpp \
  -I<ITK_BLD>/Wrapping/Generators/SwigInterface/swigmacos-arm64-2024-03-26-master/share/swig/4.3.0/python -I<ITK_BLD>/Wrapping/Generators/SwigInterface/swigmacos-arm64-2024-03-26-master/share/swig/4.3.0 -I<ITK_SRC>/Wrapping/Generators -I<ITK_BLD>/Wrapping/Typedefs/python -I<ITK_BLD>/Wrapping/Typedefs \
  -outdir <ITK_BLD>/Wrapping/Generators/Python/itk <ITK_BLD>/Wrapping/Typedefs/itkVersor.i

The problem originates with the xml used to generate <ITK_BLD>/Wrapping/Modules/ITKCommon/itkVersorPython.cpp.

@github-actions github-actions bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots area:Python wrapping Python bindings for a class type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Registration Issues affecting the Registration module area:ThirdParty Issues affecting the ThirdParty module area:Numerics Issues affecting the Numerics module labels Nov 18, 2025
@N-Dekker
Copy link
Contributor

@hjmjohnson Please git rebase main! I guess your pull request should only have one commit, being the last one, right?

@github-actions github-actions bot removed type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Filtering Issues affecting the Filtering module area:IO Issues affecting the IO module area:Registration Issues affecting the Registration module area:ThirdParty Issues affecting the ThirdParty module area:Numerics Issues affecting the Numerics module labels Nov 18, 2025
@hjmjohnson hjmjohnson force-pushed the prevent-apple-clang-17-wrapping branch from 25ce8ef to b4f5f18 Compare November 18, 2025 12:56
@github-actions github-actions bot removed area:Python wrapping Python bindings for a class area:Core Issues affecting the Core module labels Nov 18, 2025
@hjmjohnson
Copy link
Member Author

@hjmjohnson Please git rebase main! I guess your pull request should only have one commit, being the last one, right?

You are correct. Sorry for the noise.

set(_castxml_url)
set(_castxml_hash)
set(_castxml_version 2025.09.03)
# castxml 2025.09.03 currently not compatible with AppleClang 17 (XCode 26)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bradking what is the source of this incompatibility?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea. I didn't write that, and no upstream CastXML issue has been opened.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hjmjohnson If you identified the issue, please submit it upstream: https://github.com/CastXML/CastXML/

Copy link
Member

@bradking bradking Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just built CastXML 0.6.13 against LLVM/Clang 21.1.6 on macOS. All the tests pass.

EDIT: Using Xcode 26.1 on macOS 26.1.

Copy link
Member

@dzenanz dzenanz Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python wrappings reliably fail to build on my Mac. A little bit more description here: #5540. But the summary is super clear: turn on ITK_WRAP_PYTHON on Mac, and you run into build error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am on MacOS Sequoia version 15.7.1.

ZukicM1:ITK-git dzenan.zukic$ clang --version
Apple clang version 17.0.0 (clang-1700.4.4.1)
Target: arm64-apple-darwin24.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
ZukicM1:ITK-git dzenan.zukic$

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #5540 (comment) for an explanation of the failure.

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "17")
message(
FATAL_ERROR
"Apple Clang ${CMAKE_CXX_COMPILER_VERSION} is not supported. Need AppleClang < 17."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this PR would fix #5540, in a sense that it would produce this user-friendly error message instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was only going for a user friedly error message early. I was frustrated that if I forgot to set my compilers explicitly, then 30 minutes of compilation would go by before the build failed.

@blowekamp
Copy link
Member

The OSX castxml binaries are linked against a zlib in the home-brew directory. Which make them unusable from me. Then forcing a local build, had the wrong git tag to clone in CMake ( patch coming )

After that I am able to build with clang 16 (Apple clang version 16.0.0 (clang-1600.0.26.6).

@hjmjohnson hjmjohnson force-pushed the prevent-apple-clang-17-wrapping branch from b4f5f18 to 1bb8dc1 Compare November 19, 2025 16:45
castxml fails to configure ITK properly

FAILED: [code=1] Wrapping/Modules/ITKCommon/itkVersorPython.cpp Wrapping/Generators/Python/itk/itkVersorPython.py <ITK_BLD>/Wrapping/Modules/ITKCommon/itkVersorPython.cpp <ITK_BLD>/Wrapping/Generators/Python/itk/itkVersorPython.py

cd <ITK_BLD>/Wrapping/Typedefs/python && \
  /opt/homebrew/bin/ccache <ITK_BLD>/Wrapping/Generators/SwigInterface/swigmacos-arm64-2024-03-26-master/bin/swig \
  -c++ -python -fastdispatch -fvirtual -features autodoc=2 -doxygen -Werror -w302 -w303 -w312 -w314 -w361 -w362 -w350 -w383 -w384 -w389 -w394 -w395 -w467 -w508 -w509 \
  -o <ITK_BLD>/Wrapping/Modules/ITKCommon/itkVersorPython.cpp \
  -I<ITK_BLD>/Wrapping/Generators/SwigInterface/swigmacos-arm64-2024-03-26-master/share/swig/4.3.0/python -I<ITK_BLD>/Wrapping/Generators/SwigInterface/swigmacos-arm64-2024-03-26-master/share/swig/4.3.0 -I<ITK_SRC>/Wrapping/Generators -I<ITK_BLD>/Wrapping/Typedefs/python -I<ITK_BLD>/Wrapping/Typedefs \
  -outdir <ITK_BLD>/Wrapping/Generators/Python/itk <ITK_BLD>/Wrapping/Typedefs/itkVersor.i

The problem originates with the xml used to generate
<ITK_BLD>/Wrapping/Modules/ITKCommon/itkVersorPython.cpp
@hjmjohnson hjmjohnson force-pushed the prevent-apple-clang-17-wrapping branch from 1bb8dc1 to a3ed835 Compare November 28, 2025 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants