Cannot compile ITK with Python wrappings on Fedora 41 with gcc 14.2.1

Dear ITK community,

I am trying to compile ITK with Python wrappings locally on my machine. I run Fedora Linux 41 with GCC version 14.2.1.

I simply run cmake -DITK_WRAP_PYTHON=ON ../ITK, where ../ITK is the path to ITK sources. cmake runs without any error. I then run make and get several errors, such as

/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/x86_64-redhat-linux/bits/c++config.h:2677:25: error: invalid suffix 'bf16' on floating constant
 2677 |   typedef __decltype(0.0bf16) __bfloat16_t;

or

/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/limits:1989:1: error: invalid suffix 'F32' on floating constant
 1989 | __glibcxx_float_n(32)

It looked to me like an issue with C++ standard, so I tried to play with -std=c++XX but it didn’t work.

However, compilation works fine when compiling with -DITK_WRAP_PYTON=OFF, or when compiling with GCC 13.3.1 that I installed on the same machine.

Did I do something wrong when setting up the compilation? Is there some caveat when compiling with GCC 14? Or perhaps it is a known bug? I tried to go through ITK issue tracker but did not find anything relevant.

Thank you very much!

Hello,

A newer version of castxml may be required.

Please try the recently released version. Point your build to it with ITK_USE_SYSTEM_CASTXML and CASTXML_EXECUTABLE CMake variables.