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

**URL:** <https://discourse.itk.org/t/cannot-compile-itk-with-python-wrappings-on-fedora-41-with-gcc-14-2-1/7436>\
**Category:** Engineering\
**Created:** [February 18, 2025, 7:55am UTC](https://discourse.itk.org/t/cannot-compile-itk-with-python-wrappings-on-fedora-41-with-gcc-14-2-1/7436 "2025-02-18T07:55:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![acoussat](https://discourse.itk.org/user_avatar/discourse.itk.org/acoussat/32/699_2.png) [@acoussat](https://discourse.itk.org/u/acoussat)\
**Post date:** [February 18, 2025, 7:55am UTC](https://discourse.itk.org/t/cannot-compile-itk-with-python-wrappings-on-fedora-41-with-gcc-14-2-1/7436/1 "2025-02-18T07:55:02Z")

</div>

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

```auto
/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

```auto
/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!

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [February 18, 2025, 4:41pm UTC](https://discourse.itk.org/t/cannot-compile-itk-with-python-wrappings-on-fedora-41-with-gcc-14-2-1/7436/2 "2025-02-18T16:41:41Z")

</div>

Hello,

A newer version of `castxml` may be required.

Please try the [recently released version](https://github.com/CastXML/CastXMLSuperbuild/releases/tag/v0.6.11.post1). Point your build to it with `ITK_USE_SYSTEM_CASTXML` and `CASTXML_EXECUTABLE` CMake variables.

---

<div class="post-metadata">

**Author:** ![acoussat](https://discourse.itk.org/user_avatar/discourse.itk.org/acoussat/32/699_2.png) [@acoussat](https://discourse.itk.org/u/acoussat)\
**Post date:** [March 26, 2025, 3:03pm UTC](https://discourse.itk.org/t/cannot-compile-itk-with-python-wrappings-on-fedora-41-with-gcc-14-2-1/7436/3 "2025-03-26T15:03:04Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [March 26, 2025, 4:11pm UTC](https://discourse.itk.org/t/cannot-compile-itk-with-python-wrappings-on-fedora-41-with-gcc-14-2-1/7436/4 "2025-03-26T16:11:11Z")

</div>

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`.

> **[Release CastXMLSuperbuild 0.6.11 Post 2 · CastXML/CastXMLSuperbuild](https://github.com/CastXML/CastXMLSuperbuild/releases/tag/v0.6.11.post2)**
>
> What's Changed
> 
> \[BUG\] macos ci.yml by @johnnynunez in #67
> 
> Full Changelog: v0.6.11.post1...v0.6.11.post2

---

<div class="post-metadata">

**Author:** ![acoussat](https://discourse.itk.org/user_avatar/discourse.itk.org/acoussat/32/699_2.png) [@acoussat](https://discourse.itk.org/u/acoussat)\
**Post date:** [March 27, 2025, 5:02pm UTC](https://discourse.itk.org/t/cannot-compile-itk-with-python-wrappings-on-fedora-41-with-gcc-14-2-1/7436/5 "2025-03-27T17:02:33Z")

</div>

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](https://github.com/InsightSoftwareConsortium/ITK/issues/2827), 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?

---

<div class="post-metadata">

**Author:** ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)\
**Post date:** [March 28, 2025, 7:15pm UTC](https://discourse.itk.org/t/cannot-compile-itk-with-python-wrappings-on-fedora-41-with-gcc-14-2-1/7436/6 "2025-03-28T19:15:50Z")

</div>

Hello @acoussat ,

I am not certain that this is the source of your issue, but make sure to:

1. Use the `castxml` 0.6.11 binary from the Fedora package.
2. 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
