# Wrap Python CastXML compilation errors

**URL:** https://discourse.itk.org/t/wrap-python-castxml-compilation-errors/2876
**Category:** Engineering
**Tags:** python
**Created:** [March 27, 2020, 11:48pm UTC](https://discourse.itk.org/t/wrap-python-castxml-compilation-errors/2876 "2020-03-27T23:48:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![beastwood](https://discourse.itk.org/letter_avatar_proxy/v4/letter/b/ad7895/32.png) [@beastwood](https://discourse.itk.org/u/beastwood)
#### Post date: [March 27, 2020, 11:48pm UTC](https://discourse.itk.org/t/wrap-python-castxml-compilation-errors/2876/1 "2020-03-27T23:48:00Z")

</div>

I’m running into some ITK compilation errors when I try to build ITK with wrapped Python bindings that are I think related to CastXML. I’ve found a few threads referencing somewhat similar errors (e.g. [this one](https://discourse.itk.org/t/itk-4-13-0-python-wrapping-does-not-compile-with-vs-2017-15-7-4-with-v14-14-tools/1052)), but those seemed to have been resolved with code modifications already committed.

Environment:  
OS: Windows 10 Pro  
Compiler: MSVS Pro 2019, 16.5.1  
ITK: git commit b1237c6a7d052c354b234e86b46a413ebf0e3d5c  
Python: 3.7.6 via Anaconda, 64-bit

I’ve tried with and without ITKVtkGlue (VTK 8.2 compiled with Python wrapping), but get the same errors. (Am I right that ITK-VTK data transfer won’t work yet via Python?)

The first of the errors I get is copied below, with many similar syntax-like errors in projects with “CastXML” in the name. Does anyone know how to resolve these sorts of errors? I assume there must be some setting or version issue I’m missing.

Thanks,  
Brian

* * *

```
------ Build started: Project: ITKCommonCastXML, Configuration: Release x64 ------
Generating ../../itkFixedArray.xml
In file included from C:/Dev/build/itk-git/Wrapping/itkFixedArray.cxx:1:
In file included from C:/Dev/source/itk/itk-git/Modules/Core/Common/include\itkCommand.h:21:
In file included from C:/Dev/source/itk/itk-git/Modules/Core/Common/include/itkObject.h:31:
In file included from C:/Dev/source/itk/itk-git/Modules/Core/Common/include/itkLightObject.h:21:
In file included from C:/Dev/source/itk/itk-git/Modules/Core/Common/include/itkMacro.h:47:
In file included from C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.25.28610/include\string:11:
In file included from C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.25.28610/include\xstring:14:
In file included from C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.25.28610/include\xmemory:15:
In file included from C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.25.28610/include\xatomic.h:12:
C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.25.28610/include\intrin0.h(255,36): error G7F5978A3: constexpr declaration of '__builtin_assume_aligned' follows non-constexpr declaration
__MACHINE(constexpr void *__cdecl __builtin_assume_aligned(const void *, size_t, ...) noexcept)
                               ^
C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.25.28610/include\intrin0.h:255:36: note: previous declaration is here
```

---

<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, 2020, 12:26am UTC](https://discourse.itk.org/t/wrap-python-castxml-compilation-errors/2876/2 "2020-03-28T00:26:47Z")

</div>

Hi Brian,

There is work in progress to update CastXML to support the compilers that come with Visual Studio 2019 . I will follow-up once we have a PR.

> I’ve tried with and without ITKVtkGlue (VTK 8.2 compiled with Python wrapping), but get the same errors. (Am I right that ITK-VTK data transfer won’t work yet via Python?)

The ITK-VTK transfer works via Python with the most recent code in this repository:

> **[GitHub - InsightSoftwareConsortium/ITKVtkGlue: This module contains classes...](https://github.com/InsightSoftwareConsortium/ITKVtkGlue)**
>
> This module contains classes that bridge ITK image processing and VTK visualization pipelines. - GitHub - InsightSoftwareConsortium/ITKVtkGlue: This module contains classes that bridge ITK image pr...

Thanks,  
Matt

---

<div class="post-metadata">

### Author: ![beastwood](https://discourse.itk.org/letter_avatar_proxy/v4/letter/b/ad7895/32.png) [@beastwood](https://discourse.itk.org/u/beastwood)
#### Post date: [March 28, 2020, 12:43am UTC](https://discourse.itk.org/t/wrap-python-castxml-compilation-errors/2876/3 "2020-03-28T00:43:50Z")

</div>

Ah, OK. Thanks so much again, Matt!

---

<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: [April 1, 2020, 1:09am UTC](https://discourse.itk.org/t/wrap-python-castxml-compilation-errors/2876/4 "2020-04-01T01:09:16Z")

</div>

> [@matt.mccormick](#):
>
> There is work in progress to update CastXML to support the compilers that come with Visual Studio 2019 . I will follow-up once we have a PR.

Voila:

> <https://github.com/InsightSoftwareConsortium/ITK/pull/1740>
>
> Address:
> 
> C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/V…C/Tools/MSVC/14.25.28610/include\\intrin0.h(255,36): error G7F5978A3: constexpr declaration of '\_\_builtin\_assume\_aligned' follows non-constexpr declaration
> 
> With an update to CastXML 2020-03-31 Git master and LLVM 10.0.0.
