Question to you posed by my team most interested in JC’s proposed solutions:
Can the Python used by a Slicer module be replaced by a runtime version and thereby replacing the Python libraries in the build?
Thanks
Question to you posed by my team most interested in JC’s proposed solutions:
Can the Python used by a Slicer module be replaced by a runtime version and thereby replacing the Python libraries in the build?
Thanks
yes but …
… since current packaging rules assumes Slicer built its own python, and expect to package it and find it as as such. Some work would be needed to improve Slicer to accommodate this use-case.
@lasson, @jcfr, @jamesobutler, @pieper
We are now starting the long cyclical process of elimination and testing to reduce the installation footprint. PLEASE, if you see potential dangers here, let me know. I’d appreciate it!
So far we’ve eliminated
Qt5WebEngineCore.dll: 92 MB
SciPy folder: So far things are still working, but would eliminate another 100 MB
Question: What are the “test” folders for? My lead thought because they were called “test”, eliminating them would have no effect. Surprise! They are needed…
You will likely be in uncharted territory if you are just deleting files in an install package and hoping things continue to work so I would suggest not to start here first.
Have you already deactivated Slicer build options that you don’t need? For example, if you don’t want Scipy, then you would turn off the “Slicer_USE_SCIPY” option. If you don’t need SimpleITK, turn off the “Slicer_USE_SimpleITK”.
Thanks @jamesobutler,
@jcfr, does the SlicerQREADS module need SimpleITK. I vaguely remember ITK was used for some DICOM or database issue.
Also, I am implementing volume cropping and the 3D volume rendering presets on my end that is not on GitHub. @jcfr, can you suggest other CMAKE options we might need to deactivate, or have you done that already?
Thanks
Here are your currently defined build options. SimpleITK is already set to off. Here is where you would turn off Scipy if you do not need it.
Hey @jamesobutler, my team is just curious. What are all of the test subfolders in many pf the paths used for? I notice that the BUILD_TESTING option is on. Do we need that?
Thanks
What are some examples of the full paths to the “test” directories that you are referring to?
From looking at your application the “BUILD_TESTING” option is enabled which may bring in items into the installed package.
@jamesobutler - Oh, sorry, you responded when I modified my previous message.
@jamesobutler
I know that I request a lot of your time and I really try to limit the time that you spend helping me. I just want you to know that we apprecaite it.
Here’s an example of the “test” folders. There are many in other folder paths…
re: skipping install of test files provided in python packages
Lib/distutils/tests
To address this specific use case, we should update this list of regex:
Update the relevant SuperBuild/External_python-<packageName>.cmake
file to do one of the following:
(1) List directory to include from installation and append the list to the regex listed referenced above.
(2) Update the INSTALL_COMMAND
in each external project to explicitly delete the unwanted folder after installation.
Thanks @jcfr ,
Just to be sure, when I go through and delete them manually, SlicerQREADS does not work properly. Will following your instructions behave better? I’m assuming SlicerQREADS will no longer expect the existence of test folders if we do your suggestion.
Assuming the changes I suggested are contributed to Slicer, they will be tested and validated.
Once this is done, the version of Slicer used SlicerQReads custom application may be updated and at that stage, I indeed expect SlicerQREADS to work properly.
To move forward with excluding Lib/distutils/tests
, I suggest you submit a pull request to Slicer. Once this is done, it could be backported to the fork of Slicer used in SlicerQReads.
I see this list in my SlicerBlockInstallPython.cmake. The list specifies “REGEX “/test/” EXCLUDE”. One would think this to mean that test folders would be excluded. But they are included in my installation packages. So, I don’t get it. What am I supposed to do with this information? Update to what? How?
Thanks!
The regex exclude /test/
, which means that it will not exclude Lib/distutils/tests
. To exclude that folder, you would need to add /tests
to the regexp.
Hello @jcfr or @jamesobutler, I’m trying to determine if my module (SlicerQREADS) needs Qt5WebEngine files such as Qt5WebEngineCore.dll, etc? Does SlicerQREADS need Qt5WebEngine as a dependency? It won’t launch when Qt5WebEngineCore.dll is deleted from the install package bin folder. Immediately, an error is displayed indicating Qt5WebEngineCore.dll is missing. This is confusing because, eliminating Qt5WebEngineCore.dll worked on my teammate’s system earlier this week. That why we were sure we could reduce the size by 100MB.
So again, is Qt5WebEngineCore.dll really a dependency?
Thanks
QWebEngine is needed for the extensions manager, data store, or for web-based authentication. Probably none of them are needed for you, so you can turn off WebEngine option when you build your custom application.
Do I turn it off in the CMakeList.text in my source folder?
option(Slicer_BUILD_DICOM_SUPPORT "Build application with DICOM support" ON)
option(Slicer_BUILD_DIFFUSION_SUPPORT "Build application with Diffusion support" OFF)
option(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT "Build application with ExtensionManager support" OFF)
option(Slicer_BUILD_MULTIVOLUME_SUPPORT "Build application with MultiVolume support" OFF)
option(Slicer_BUILD_PARAMETERSERIALIZER_SUPPORT "Build application with parameter serializer support" OFF)
option(Slicer_USE_PYTHONQT "Build application with Python support" ON)
option(Slicer_USE_QtTesting "Build application with QtTesting support" OFF)
option(Slicer_USE_SimpleITK "Build application with SimpleITK support" OFF)
option(Slicer_BUILD_BRAINSTOOLS "Build application with BRAINSTools module" OFF)
option(Slicer_BUILD_DataStore "Build application with DataStore module" OFF)
option(Slicer_BUILD_CompareVolumes "Build application with CompareVolumes module" OFF)
option(Slicer_BUILD_LandmarkRegistration "Build application with LandmarkRegistration module" OFF)
option(Slicer_BUILD_SurfaceToolbox "Build application with SurfaceToolbo
x module" OFF)
Do you know the syntax. What is the best way to find the correct syntax for switching on or off options.
I’d like to turn off webengine and scipy, but don’t know the syntax and where to insert them.
Thanks
Hi @jamesobutler,
How does someone learn the syntax? There is a cmakelist.txt file in my source folder. Looks like I will make the changes there. I guess I can guess the syntax, but not sure.
option(Slicer_USE_SciPy "Build application with SciPy support" OFF)
option(Slicer_USE_WEBEngine "Build application with WebEngine support" OFF)
How’s that? Is there a manual for Slicer CMake options?
Thanks
There isn’t a manual for Slicer CMake options but it is always best to use examples of things that do similar things. You are correct to modify those type entries in your CMakeLists.txt that I had linked above.
You’re on the right track with the example you provided. Just make sure the first item in the parenthesis is the correct build name option. This should match the items in the “Name” column in the screenshot I posted earlier of the CMake GUI.
You will see there is an option with WebEngine in the name which is the one you want. There is also a name entry for Scipy.