# Compiling SimpleITK

**URL:** https://discourse.itk.org/t/compiling-simpleitk/2930
**Category:** Beginner Questions
**Tags:** cmake, simpleitk
**Created:** [April 11, 2020, 4:21pm UTC](https://discourse.itk.org/t/compiling-simpleitk/2930 "2020-04-11T16:21:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![nppatt](https://discourse.itk.org/user_avatar/discourse.itk.org/nppatt/32/1359_2.png) [@nppatt](https://discourse.itk.org/u/nppatt)
#### Post date: [April 11, 2020, 4:21pm UTC](https://discourse.itk.org/t/compiling-simpleitk/2930/1 "2020-04-11T16:21:05Z")

</div>

Hi,

I have been trying to compile SimpleITK, the source code pulled from the Git repository. The build stops at about 58% with the following:-

In file included from /opt/SimpleITK/Code/Common/src/sitkTransform.cxx:20:  
/opt/SimpleITK/Code/Common/src/sitkPimpleTransform.hxx:152:51: error: no type named ‘TransformCategoryEnum’ in ‘itk::TransformBaseTemplate’; did you mean ‘TransformCategoryType’?  
typedef itk::TransformBaseTemplate::TransformCategoryEnum TransformCategoryEnum;  
~~~~~~~~~~~~~~~~~~^~~  
TransformCategoryType  
/usr/local/include/ITK-5.0/itkTransformBase.h:124:5: note: ‘TransformCategoryType’ declared here  
} TransformCategoryType;  
^  
[17%] Generating include/sitkLevelSetMotionRegistrationFilter.h  
In file included from /opt/SimpleITK/Code/Common/src/sitkBSplineTransform.cxx:19:  
/opt/SimpleITK/Code/Common/src/sitkPimpleTransform.hxx:152:51: error: no type named ‘TransformCategoryEnum’ in ‘itk::TransformBaseTemplate’; did you mean ‘TransformCategoryType’?  
typedef itk::TransformBaseTemplate::TransformCategoryEnum TransformCategoryEnum;  
~~~~~~~~~~~~~~~~~~^~~  
TransformCategoryType  
/usr/local/include/ITK-5.0/itkTransformBase.h:124:5: note: ‘TransformCategoryType’ declared here  
} TransformCategoryType;  
^  
In file included from /opt/SimpleITK/Code/Common/src/sitkDisplacementFieldTransform.cxx:34:  
/opt/SimpleITK/Code/Common/src/sitkPimpleTransform.hxx:152:51: error: no type named ‘TransformCategoryEnum’ in ‘itk::TransformBaseTemplate’; did you mean ‘TransformCategoryType’?  
typedef itk::TransformBaseTemplate::TransformCategoryEnum TransformCategoryEnum;  
~~~~~~~~~~~~~~~~~~^~~  
TransformCategoryType  
/usr/local/include/ITK-5.0/itkTransformBase.h:124:5: note: ‘TransformCategoryType’ declared here  
} TransformCategoryType;

I am completely stumped as to how to work around this. I am building against ITK-5.0 (On MacOS 10.15), I think that I have all the relevant ITK modules installed, but cannot seem to get past this build error.

Does anyone have any pointers?

Best regards, Nick

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [April 11, 2020, 6:34pm UTC](https://discourse.itk.org/t/compiling-simpleitk/2930/2 "2020-04-11T18:34:32Z")

</div>

There was a big refactoring of enum types in ITK recently, SimpleITK hasn’t caught up with it yet. Trying compiling a tagged version of SimpleITK, or compile against ITK 5.0.1.

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [April 11, 2020, 9:00pm UTC](https://discourse.itk.org/t/compiling-simpleitk/2930/3 "2020-04-11T21:00:37Z")

</div>

SimpleITK is up to date with ITK.

This is a case where SimpleITK is expecting the _NEW_ ITK 5.1 enum types and not the old. There have been incompatible changes and improvement with ITK 5.0, certain CMake compile flags can help with this. And a lot of things are changing with SimpleITK 2.0 development.

Generally you can look in the [Superbuild/External\_ITK.cmake](https://github.com/SimpleITK/SimpleITK/blob/master/SuperBuild/External_ITK.cmake#L26) file to get the expected ITK version.

In general it is recommended to use the Superbuild with SimpleITK so the correct ITK version is compiled. Instruction can be found here:  
[https://simpleitk.readthedocs.io/en/master/building.html#building-simpleitk](https://simpleitk.readthedocs.io/en/master/building.html#building-simpleitk)

---

<div class="post-metadata">

### Author: ![nppatt](https://discourse.itk.org/user_avatar/discourse.itk.org/nppatt/32/1359_2.png) [@nppatt](https://discourse.itk.org/u/nppatt)
#### Post date: [April 12, 2020, 10:06am UTC](https://discourse.itk.org/t/compiling-simpleitk/2930/4 "2020-04-12T10:06:14Z")

</div>

Excellent, all working and functioning now.

Thanks, Nick.
