# SlicerCAT build stops without finishing

**URL:** <https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700>\
**Category:** Support\
**Created:** [March 22, 2021, 7:56pm UTC](https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700 "2021-03-22T19:56:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [March 22, 2021, 7:56pm UTC](https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700/1 "2021-03-22T19:56:03Z")

</div>

Hi,

I’ve started to develop custom [slicer app for geoscience](https://github.com/TierraColada/Colada). I follow SlicerCAT strategy and as examples I use [aevaSlicer](https://gitlab.kitware.com/aeva/aevaslicer/-/tree/master/) and [SlicerAstro](https://github.com/Punzo/SlicerAstro)

My slicerCAT has two additional dependencies:

- [h5geo](https://github.com/TierraColada/h5geo) is a C++ library
- [GDAL](https://pypi.org/project/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:

```auto
--------------- 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](https://drive.google.com/file/d/1CmpIO28eknsqFYoNudoC7cKZg6VYGkxF/view?usp=sharing) and [snippet of python error](https://drive.google.com/file/d/1jl2W-LBXZhBqhiFD-I_dAZKa1ew8CSxh/view?usp=sharing).

Windows 10, MSVC 2019 x64, Qt 5.15.2

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 23, 2021, 5:44am UTC](https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700/2 "2021-03-23T05:44:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [March 23, 2021, 10:31am UTC](https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700/3 "2021-03-23T10:31:59Z")

</div>

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

```auto
# 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:

```auto
  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.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 23, 2021, 12:09pm UTC](https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700/4 "2021-03-23T12:09:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [March 23, 2021, 10:07pm UTC](https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700/5 "2021-03-23T22:07:39Z")

</div>

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

```auto
    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?

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [March 23, 2021, 10:28pm UTC](https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700/6 "2021-03-23T22:28:05Z")

</div>

I’ve just found that `std::binary_function` is [removed in C++17](https://en.cppreference.com/w/cpp/utility/functional/binary_function)  
So this is the problem.

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

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 24, 2021, 4:15pm UTC](https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700/7 "2021-03-24T16:15:42Z")

</div>

> [@keri](#):
>
> So this is the problem.

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

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [March 25, 2021, 7:17pm UTC](https://discourse.slicer.org/t/slicercat-build-stops-without-finishing/16700/8 "2021-03-25T19:17:29Z")

</div>

With [pull request](https://github.com/Slicer/Slicer/pull/5548) I could compile Slicer with C++17 enabled
