when it build, “ctkAbstractPythonManager.h”: No such file or directory [D:\t2\Slicer-build\Base\QTGUI\qSlicerBaseQTGUI.vcxproj] Slicer D:\Projects\Slicer\Base\QTCore\qSlicerCorePythonManager.h 25
the error appears
I want to know if it is the right way to let slicer lighter , and the right way to build costum slicer
To help address the issue and better understand the context (which options were exactly enabled or disabled, …), here are few suggestions:
could you check that the version of Slicer found at the top of the CMakeLists.txt is a recent one. If not, I suggest you update it to be the most recent one. See https://github.com/Slicer/Slicer/commits/master. This will ensure the most recent fixes are included.
could you try to configure and build the project using the command line.
(1) remove all files from the build directories
(2) Open windows command line terminal
(3) configure the project with a command like this one cmake.exe -DSlicer_USE_XYZ:BOOL=OFF ... -G "Visual Studio 14 2015" D:\Projects\Slicer. This will allow to easily reproduce the problem.
(4) build the project using a command line like cmake --build D:\t2\Slicer-build --config Release -- /m. The /m allows to do a parallel build using Visual Studio.
Most likely the problem is that the source code path (“D:\Projects\Slicer”) is too long. Try to use “D:\S4” instead.
You can modify any Slicer build options. What options would you like to change?
You can turn off all features that you don’t need. You can search for the name of the option in Slicer source code to see what the impact of turning it off.
Disable all modules that you don’t need will make building and running Slicer much faster.
Note that build time should not be a concern, since a complete build takes only a few hours on a desktop computer (and maybe up to a day on a very slow laptop). After that, you’ll only need to modify and build your own custom modules, which should take just a couple of minutes for a rebuild and a few ten seconds for a regular build.
But I have a successful build with the same source code path with the fully slicer features, When I use the SlicerCustomAppTemplate and turn off some features, it doesn’t work.
Thanks, that is helpful. Looks like you are building with default options associated with the template (where python is disabled), we should be able to fix the issue.
Note that we will soon setup continuous integration for the SlicerCustomAppTemplate project itself, this should allow us to catch such regression.
when it build, “ctkAbstractPythonManager.h”: No such file or directory [D:\t2\Slicer-build\Base\QTGUI\qSlicerBaseQTGUI.vcxproj] Slicer D:\Projects\Slicer\Base\QTCore\qSlicerCorePythonManager.h 25
the error appears
That said, it is strange to see this error because with Slicer_USE_PYTHONQT set to OFF in your build tree, there should be no attempt to build the qSlicerCorePythonManager class.
Slicer_???MODULES_ENABLED can be used to disable entire class of modules. I would recommend to disable modules by name instead.
If you don’t need DICOM support at all, then disable Slicer_BUILD_DICOM_SUPPORT. If you want to have some DICOM reading/writing capabilities then enable it and just disable whatever DICOM related module you don’t need.
You can share the source between different build. Just be aware that the Git hash written in the CMakeLists.txt may not correspond to the source associated with a given build.
The options listed in the CMakeLists.txt of your custom application are a subset of the one found in the one of Slicer.
We only listed the most common one, but all the other option could be set similarly.
I mean that the CMakeList.txt in Slicer source root dir can get the full options? I want to know where can I get the other options.
And I still confuse about the difference option(Slicer_BUILD_xxxx_SUPPORT OFF/ON) and set(Slicer_CLIMODULES_ENABLED or DISABLED )
This allows to build Slicer without the capabilities of loading a type of modules. When the option is disabled, Slicer won’t even attempt to look for the type of modules.
Slicer_CLIMODULES_ENABLED or DISABLED
This allows to build Slicer with or without a specific list of modules of type CLI. But it will not prevent slicer from looking for CLI modules. For example, starting Slicer specifying --additional-module-paths /path/to/folder/with/modules will look for modules in /path/to/folder/with/modules.
I have tried to build the Slicer using the same options on another machine, it still failed with the same error.And When I Turn ON the Option Slicer_WITH_PYTHONQT, it can build successfully. So Maybe there is a BUG in somewhere?
In file included from /home/jcfr/Projects/Slicer-Qt5-VTK8/Base/QTGUI/qSlicerPythonManager.h:17:0,
from /home/jcfr/Projects/Slicer-Qt5-VTK8/Base/QTGUI/qSlicerWebPythonProxy.cxx:30:
/home/jcfr/Projects/Slicer-Qt5-VTK8/Base/QTCore/qSlicerCorePythonManager.h:25:39: fatal error: ctkAbstractPythonManager.h: No such file or directory
compilation terminated.
Thus, I assume Python if necessary to build Slicer. Am I right?
@jcfr I am trying to turn off as many CLI modules as possible to speed up building, but I guess I need to keep them enabled to later build the SlicerDMRI module? Let me know if I’m wrong; if this is not necessary, the command line argument flag to disable them all would be -DSlicer_CLIMODULES_DISABLED ?
Otherwise, what would be the correct command line argument flag to turn off the e.g. AddScalarVolumes CLI: -DSlicer_BUILD_AddScalarVolumes=OFF ?
Slicer is meant to be buildable without python, but it’s not tested regularly so dependencies may creep in. This is true of all cmake options that aren’t part of the standard preview builds, so changing any of the defaults may be expected to require some debugging. Once you have the CI set up, maybe we also want to pick some build paths that we want to test on a regular basis using github actions.
BTW, it’s probably easier/faster to experiment using a big multi-core machine rather than using the CI machines.
Yes, it is, but there is also a problem. For example, I want to change the name of my custom software. It seems that it should be rebuilt.Is there any way that I can change the name of the entire software without rebuilding?