Fail to install SimpleElastix due to multiple definition

I follow the instruction from the official website

$ git clone https://github.com/SuperElastix/SimpleElastix
$ mkdir build
$ cd build
$ cmake ../SimpleElastix/SuperBuild
$ make -j4

the make -j4 instructions did not work, and the error seems that the error happened during the linking stage.

Linking CXX shared module _SimpleITK.so
/usr/bin/ld.gold: error: /home/xxx/build/ITK-prefix/lib/libITKCommon-5.1.a(itkNumericTraits.cxx.o): multiple definition of 'itk::NumericTraits<unsigned char>::Zero'
/usr/bin/ld.gold: ../../lib/libSimpleITK_ITKSuperPixel-2.0.a(sitkSLICImageFilter.cxx.o): previous definition here
collect2: error: ld returned 1 exit status
make[5]: *** [Wrapping/Python/CMakeFiles/SimpleITK_PYTHON.dir/build.make:740: Wrapping/Python/_SimpleITK.so] Error 1
make[4]: *** [CMakeFiles/Makefile2:3381: Wrapping/Python/CMakeFiles/SimpleITK_PYTHON.dir/all] Error 2
make[3]: *** [Makefile:166: all] Error 2
make[2]: *** [CMakeFiles/SimpleITK.dir/build.make:88: SimpleITK-prefix/src/SimpleITK-stamp/SimpleITK-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:325:CMakeFiles/SimpleITK.dir/all] Error2
*** [Makefile:91: all] Error 2

I have no idea how to solve the error.

Any help would be greatly appreciated :slight_smile:

Hello @Siji-chl,

SimpleElastix is now built via the SimpleITK SuperBuild and turning the SimpleITK_USE_ELASTIX flag on. For prerequisites and system requirements see here.