Compiling SimpleITK

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

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.

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

3 Likes

Excellent, all working and functioning now.

Thanks, Nick.