SlicerCAT build stops without finishing

Hi,

I’ve started to develop custom slicer app for geoscience. I follow SlicerCAT strategy and as examples I use aevaSlicer and SlicerAstro

My slicerCAT has two additional dependencies:

  • h5geo is a C++ library
  • GDAL is a C++ library but I’m trying to install it with python (it has python bindings and it is supposed to be used in both C++ and python)

I also turn on C++17 flag (h5geo needs it) and turn VTK 9 (as I remember there were problems with VTK 8.2.0 and C++17) as it is done in aevaSlicer.

I build it with commands:

  • mkdir C:\C\d

  • cd C:\C\d

  • “C:/Qt/Tools/CMake_64/bin/cmake.exe” -G “Visual Studio 16 2019” -A x64 -DQt5_DIR:PATH=C:/Qt/5.15.2/msvc2019_64/lib/cmake/Qt5 C:/C/Colada

  • “C:/Qt/Tools/CMake_64/bin/cmake.exe” --build . --config Debug

The build process has errors while building python but it continues building. After some more packages are successfully built (including h5geo) the building process stops:

--------------- snippet output ------------------
  -- Up-to-date: C:/C/d/h5geo-install/lib/h5geo.dll
  Completed 'h5geo'
  Generate version-jqPlot.txt and license-jqPlot.txt
  Completed 'jqPlot'
  Performing update step for 'vtkAddon'
  Generate version-vtkAddon.txt and license-vtkAddon.txt
  No patch step for 'vtkAddon'
  No configure step for 'vtkAddon'
  No build step for 'vtkAddon'
  No install step for 'vtkAddon'
  Completed 'vtkAddon'

C:\C\d>

Thus some libraries were not built (as VTK for example) and thus the building process can’t seem to be finished successfully.
What may be the reason of that?

I attach full build log and snippet of python error.

Windows 10, MSVC 2019 x64, Qt 5.15.2

Was the build successful when you built the default template (without adding h5geo and gdal)?

@lassoan I’ve just tried to clean build (delete all and try slicerCAT again) it without my dependencies but with C++17 enbaled, Slicer_BUILD_DICOM_SUPPORT disabled and two strings added:

# Force VTK9
set(Slicer_VTK_VERSION_MAJOR 9 CACHE STRING "VTK major version (8 or 9)")
mark_as_superbuild(Slicer_VTK_VERSION_MAJOR)

The behaviour is the same.
Last lines of output are:

  Creating directories for 'vtkAddon'
  Performing download step (git clone) for 'vtkAddon'
  Cloning into 'vtkAddon'...
  Note: switching to '4a5061920f6f72a2ddff6932176f7de2661b5f76'.

  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by switching back to a branch.

  If you want to create a new branch to retain commits you create, you may
  do so (now or later) by using -c with the switch command. Example:

    git switch -c <new-branch-name>

  Or undo this operation with:

    git switch -

  Turn off this advice by setting config variable advice.detachedHead to false

  HEAD is now at 4a50619 BUG: Fix tests execution on windows adding "vtkAddon_LAUNCH_COMMAND" option
  Performing update step for 'vtkAddon'
  Generate version-vtkAddon.txt and license-vtkAddon.txt
  No patch step for 'vtkAddon'
  No configure step for 'vtkAddon'
  No build step for 'vtkAddon'
  No install step for 'vtkAddon'
  Completed 'vtkAddon'
  Building Custom Rule C:/C/d/slicersources-src/CMakeLists.txt

C:\C\d>

Few weeks ago there were not any problems building SlicerCAT but with C++11 and without VTK 9 enabled.
So I suppose the problem is connected with it.

Please retry the build, making one change at a time and let us know if you run into an issue that you don’t know how to resolve.

1 Like

This time I only enabled C++17 and the compilation was successful for about 7 hours and then I got errors:

    vtkOrientedImageData.cxx
    vtkOrientedImageDataResample.cxx
    vtkSegment.cxx
    vtkSegmentation.cxx
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(60,53): error C2143: syntax error: missing ',' be
fore '<' [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] [C:\C\d\slicersources-build\Slicer.
vcxproj]
  C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(67): message : see reference to class template
  instantiation 'MapValueCompare<T>' being compiled [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.v
  cxproj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(60,24): error C2518: keyword 'typename' is invali
d in a base class list; expected a class name [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj
] [C:\C\d\slicersources-build\Slicer.vcxproj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(60,78): error C2518: keyword 'typename' is invali
d in a base class list; expected a class name [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj
] [C:\C\d\slicersources-build\Slicer.vcxproj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(471,58): error C2039: 'bind2nd': is not a member
of 'std' [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] [C:\C\d\slicersources-build\Slicer.
vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\sstream(20): message
  : see declaration of 'std' [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(60,38): error C2039: 'binary_function': is not a
member of 'std' [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] [C:\C\d\slicersources-build\
Slicer.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\sstream(20): message
  : see declaration of 'std' [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj]
  C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(471): message : see reference to class template
   instantiation 'MapValueCompare<vtkSegmentation::SegmentMap>' being compiled [C:\C\d\Slicer-build\Libs\vtkSegmentatio
  nCore\vtkSegmentationCore.vcxproj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(60,24): error C2504: 'binary_function': base clas
s undefined [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] [C:\C\d\slicersources-build\Slic
er.vcxproj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(471,65): error C3861: 'bind2nd': identifier not f
ound [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] [C:\C\d\slicersources-build\Slicer.vcxp
roj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(538,56): error C2039: 'bind2nd': is not a member
of 'std' [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] [C:\C\d\slicersources-build\Slicer.
vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\sstream(20): message
  : see declaration of 'std' [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(538,63): error C3861: 'bind2nd': identifier not f
ound [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] [C:\C\d\slicersources-build\Slicer.vcxp
roj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(837,56): error C2039: 'bind2nd': is not a member
of 'std' [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] [C:\C\d\slicersources-build\Slicer.
vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\sstream(20): message
  : see declaration of 'std' [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj]
C:\C\d\slicersources-src\Libs\vtkSegmentationCore\vtkSegmentation.cxx(837,63): error C3861: 'bind2nd': identifier not f
ound [C:\C\d\Slicer-build\Libs\vtkSegmentationCore\vtkSegmentationCore.vcxproj] [C:\C\d\slicersources-build\Slicer.vcxp
roj]

Were there attempts to build Slicer with C++17?

I’ve just found that std::binary_function is removed in C++17
So this is the problem.

Could you recommend me something if my external dependencies need to use C++17 ?

This should not be a problem. You can rewrite that part of the code and send a pull request with the proposed change.

1 Like

With pull request I could compile Slicer with C++17 enabled