ITK DCMTK external build fails

Hello folks,

I’m currently building docker images for test automation and I’m facing an issue with the ITK-patched DCMTK external project. During the build I get this error (I’m building an image based on ubuntu 20.04 with gcc 9.3):

In file included from /root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/ofstd/include/dcmtk/ofstd/variadic/variant.h:19,
                 from /root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/ofstd/include/dcmtk/ofstd/ofvriant.h:379,
                 from /root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/dcmtls/include/dcmtk/dcmtls/tlsopt.h:28,
                 from /root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/dcmtls/libsrc/
/root/src/ITK/build/Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject/ofstd/include/dcmtk/ofstd/variadic/helpers.h:60:32: error: narrowing conversion of '-1' from 'int' to 'long unsigned int' [-Wnarrowing]
   60 | : OFintegral_constant<size_t,-1> {};
      |                                ^
make[5]: *** [dcmtls/libsrc/CMakeFiles/dcmtls.dir/build.make:89: dcmtls/libsrc/CMakeFiles/dcmtls.dir/] Error 1
make[4]: *** [CMakeFiles/Makefile2:2633: dcmtls/libsrc/CMakeFiles/dcmtls.dir/all] Error 2
make[3]: *** [Makefile:141: all] Error 2
make[2]: *** [Modules/ThirdParty/DCMTK/CMakeFiles/ITKDCMTK_ExtProject.dir/build.make:112: Modules/ThirdParty/DCMTK/ITKDCMTK_ExtProject-prefix/src/ITKDCMTK_ExtProject-stamp/ITKDCMTK_ExtProject-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:6355: Modules/ThirdParty/DCMTK/CMakeFiles/ITKDCMTK_ExtProject.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

It seems that this is a problem that was already encountered, as the last patch by @matt.mccormick was on this precise topic, but corrected only for “emscripten” builds ? Could that fix be extended for all build ?

@hjmjohnson it looks like

removed the required patches.

I’ve forgotten to precise that I was trying to build the 5.0.1 tag, which I think is not affected by this commit ?

5.1 RC 2 has this commit, which may address the build error (it has a different but related change).

That said, there were other patches on the ITK branch that may still be needed for other reasons, i.e. third-party integration, Emscripten.

1 Like