# Custom build Slicer failed

**URL:** <https://discourse.slicer.org/t/custom-build-slicer-failed/6523>\
**Category:** Development\
**Tags:** build\
**Created:** [April 17, 2019, 9:50am UTC](https://discourse.slicer.org/t/custom-build-slicer-failed/6523 "2019-04-17T09:50:00Z")\
**Posts on this page:** 6\
**Page:** 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:** [July 30, 2023, 1:48pm UTC](https://discourse.slicer.org/t/custom-build-slicer-failed/6523/21 "2023-07-30T13:48:14Z")

</div>

Thanks a lot for these tests and feedbacks, they are very useful.

> [@jhlegarreta](#):
>
> so Python is necessary to build Slicer.

Python is not required to build Slicer. If you get a build error when Python is turned off then that is a bug that we’ll fix. It would be nice if you could submit a bug report to track it.

> [@jhlegarreta](#):
>
> Past that point I run into
> 
> ```auto
> CMake Error at Libs/vtkTeem/CMakeLists.txt:151 (vtkMacroKitPythonWrap):
> Unknown CMake command "vtkMacroKitPythonWrap".
> 
> ```

vtkAddon is a required dependency. Have you somewhere disabled vtkAddon? Or it was missed from some extension/module template or the custom application template?

> [@slicer365](#):
>
> For example, I want to change the name of my custom software

Making some parameters modifiable without rebuild or even starting from a clean build may require very significant amount of development work. In cases where the parameter is not meant to be frequently modified, requiring a rebuild is reasonable.

Do you have a good use case for frequently changing the application name? Do you find that a top-level build after changing the CMake variable is not sufficient to change the application name?

---

<div class="post-metadata">

**Author:** ![slicer365](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/slicer365/32/67549_2.png) [@slicer365](https://discourse.slicer.org/u/slicer365)\
**Post date:** [July 30, 2023, 1:58pm UTC](https://discourse.slicer.org/t/custom-build-slicer-failed/6523/22 "2023-07-30T13:58:26Z")

</div>

In fact, I may help users develop different slicer-based software, but the basic functions of these software are the same, and of course there are some things that need to be changed.  
And the name of each software is different, because it is developed for different users, but in order to change the name of the software, I need to recompile the whole program, which is really a waste of time.  
I tried to change the cmake file, but it didn’t work.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 30, 2023, 2:04pm UTC](https://discourse.slicer.org/t/custom-build-slicer-failed/6523/23 "2023-07-30T14:04:08Z")

</div>

thanks for the feedback on your use cases @slicer365.

An alternative to consider is different launch scripts for different customized Slicer versions. The launch script can have a custom name, but re-use the Slicer system under the hood. If people develop only using Python they don’t even need to compile Slicer at all.

It’s true that rebuilding from scratch can be time consuming, but adding more configuration options makes it harder to test and therefore more likely that people will experience build failures.

---

<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:** [July 30, 2023, 2:09pm UTC](https://discourse.slicer.org/t/custom-build-slicer-failed/6523/24 "2023-07-30T14:09:41Z")

</div>

> [@slicer365](#):
>
> , I may help users develop different slicer-based software

In this case I would recommend to maintain a separate build tree for each application.

If you need very fast build then you can consider switching to use Linux, as default build tools on Linux can do parallel builds correctly and very efficiently. With a 3-year-old computer with i9 CPU and fast disk, Slicer is built from scratch (not a rebuild but a clean build from source, with all dependencies) in 30 minutes. Rebuild after some CMake variable changes may take a minute or so.

---

<div class="post-metadata">

**Author:** ![jhlegarreta](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jhlegarreta/32/66542_2.png) [@jhlegarreta](https://discourse.slicer.org/u/jhlegarreta)\
**Post date:** [July 30, 2023, 5:45pm UTC](https://discourse.slicer.org/t/custom-build-slicer-failed/6523/25 "2023-07-30T17:45:32Z")

</div>

> [@lassoan](#):
>
> Python is not required to build Slicer. If you get a build error when Python is turned off then that is a bug that we’ll fix. It would be nice if you could submit a bug report to track it.

[Slicer build fails if `Slicer_USE_PYTHONQT` is turned off · Issue #7136 · Slicer/Slicer · GitHub](https://github.com/Slicer/Slicer/issues/7136)

> [@lassoan](#):
>
> vtkAddon is a required dependency. Have you somewhere disabled vtkAddon? Or it was missed from some extension/module template or the custom application template?

I turned it off. If it is required, then wondering why it should be exposed/users can turn it off:  
[ENH: Add GitHub actions build, test workflow file for CI · jhlegarreta/SlicerDMRI@a20943a · GitHub](https://github.com/jhlegarreta/SlicerDMRI/actions/runs/5701134575/job/15451559662#step:6:24)

Build failure:  
[ENH: Add GitHub actions build, test workflow file for CI · jhlegarreta/SlicerDMRI@a20943a · GitHub](https://github.com/jhlegarreta/SlicerDMRI/actions/runs/5701134575/job/15451559662#step:6:43108)

---

<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:** [July 30, 2023, 6:08pm UTC](https://discourse.slicer.org/t/custom-build-slicer-failed/6523/26 "2023-07-30T18:08:42Z")

</div>

Thanks for submitting the issue.

> [@jhlegarreta](#):
>
> If it is required, then wondering why it should be exposed/users can turn it off

I don’t think there should be a build option for it, as it contains code that should be part of VTK, which is a required dependency. @jcfr is there a specific reason for having a `Slicer_BUILD_vtkAddon` build option?

[Previous page](https://discourse.slicer.org/t/custom-build-slicer-failed/6523.md?page=1)
