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.
1 Like
Hello,
Thank you very much for your answer and I apologize for the long delay. I found a way around the issue by downloading pre-compiled Python wheels but I always wanted to go back to this issue as it is much more convenient to be able to compile the wrappings locally.
I tried to compile CastXML locally, but I failed to do so (I got many different errors, and did not manage to finish the compilation, I can give more details if needed). Then I decided to try the castxml
Fedora package, which is I believe at the latest version (0.6.11). However I still get the same error messages.
In the meantime, I cannot compile with GCC 13 anymore, but this is a different issue I believe.
Any pointers would be greatly appreciated. And thank you very much once again for your kind help!
Hi,
The Linux binaries here, even though though have ubuntu in the filename, should work on Fedora. And apply ITK_USE_SYSTEM_CASTXML
and CASTXML_EXECUTABLE
.
Hello,
Thank you very much for your answer! Unfortunately using the Linux binary as you suggested does not help. I still get the same error message.
I noticed my issue looks similar to that one, which I just found. I have only a limited understanding of the comments that were made about this issue, could it be the same underlying problem?
Hello @acoussat ,
I am not certain that this is the source of your issue, but make sure to:
- Use the
castxml
0.6.11 binary from the Fedora package.
- Either do not try to change the C++ standard version for the ITK build or set it with the cmake option CMAKE_CXX_STANDARD.
HTH