Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/enable development files installation #1285

Conversation

RafaelPalomar
Copy link

Hello. Here some patches to make development files installable.

@pieper
Copy link
Member

pieper commented Dec 12, 2019

Hi - What's the context for wanting the developer files? Does this also package them? (i.e. make them part of the installer?)

@jcfr
Copy link
Member

jcfr commented Dec 12, 2019

Thanks for your contribution 🙏

In the coming days, I will carefully review your changes and start to selectively integrate them. If any, I will post questions here.

Note: If by Tuesday evening, I have not posted an update. Make sure to comment back on this issue to remind us.

@lassoan
Copy link
Contributor

lassoan commented Dec 12, 2019

Will this allow building C++ loadable modules without building Slicer?

Rafael Palomar added 14 commits December 13, 2019 07:07
Currently the Slicer_INSTALL_DEVELOPMENT option is set to OFF. These
changes will enable Slicer_INSTALL_DEVELOPMENT as an option that can
be set ON/OFF.
With the following options:

		-DSlicer_SUPERBUILD=OFF
		-DBUILD_TESTING=OFF
		-DSlicer_BUILD_EXTENSIONMANAGER_SUPPORT=OFF
		-DSlicer_BUILD_CLI_SUPPORT=OFF
		-DSlicer_BUILD_CLI=OFF
		-DCMAKE_CXX_STANDARD=11
		-DSlicer_REQUIRED_QT_VERSION=5
		-DSlicer_BUILD_DICOM_SUPPORT=OFF
		-DSlicer_BUILD_ITKPython=OFF
		-DSlicer_BUILD_QTLOADABLEMODULES=OFF
		-DSlicer_BUILD_QT_DESIGNER_PLUGINS=OFF
		-DSlicer_USE_CTKAPPLAUNCHER=OFF
		-DSlicer_USE_PYTHONQT=OFF
		-DSlicer_USE_QtTesting=OFF
		-DSlicer_USE_SimpleITK=OFF
		-DSlicer_VTK_RENDERING_BACKEND=OpenGL2
		-DSlicer_VTK_VERSION_MAJOR=8
		-DSlicer_INSTALL_DEVELOPMENT=ON
		-DCMAKE_INSTALL_RPATH=/usr/lib64/Slicer-4.11:/usr/lib64/ctk-0.1:/usr/lib64/Slicer-4.11/qt-loadable-modules:/usr/lib64/ITK-5.1.0
		-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
		-DSlicer_USE_SYSTEM_LibArchive=ON
		-DTeem_DIR=/usr/lib64
		-DjqPlot_DIR=/usr/share/jqPlot

The following error raises:

[100%] Built target SlicerApp
Install the project...
-- Install configuration: "Gentoo"
CMake Error at cmake_install.cmake:41 (file):
  file INSTALL cannot find
  "/var/tmp/portage/sci-medical/3DSlicer-9999/work/3DSlicer-9999/vtkSlicerConfigure.h".

This is due an error on the specification of the origin/destination paths.
With the following configuration:

		-DSlicer_SUPERBUILD=OFF
		-DBUILD_TESTING=OFF
		-DSlicer_BUILD_EXTENSIONMANAGER_SUPPORT=OFF
		-DSlicer_BUILD_CLI_SUPPORT=OFF
		-DSlicer_BUILD_CLI=OFF
		-DCMAKE_CXX_STANDARD=11
		-DSlicer_REQUIRED_QT_VERSION=5
		-DSlicer_BUILD_DICOM_SUPPORT=OFF
		-DSlicer_BUILD_ITKPython=OFF
		-DSlicer_BUILD_QTLOADABLEMODULES=OFF
		-DSlicer_BUILD_QT_DESIGNER_PLUGINS=OFF
		-DSlicer_USE_CTKAPPLAUNCHER=OFF
		-DSlicer_USE_PYTHONQT=OFF
		-DSlicer_USE_QtTesting=OFF
		-DSlicer_USE_SimpleITK=OFF
		-DSlicer_VTK_RENDERING_BACKEND=OpenGL2
		-DSlicer_VTK_VERSION_MAJOR=8
		-DSlicer_INSTALL_DEVELOPMENT=ON
		-DCMAKE_INSTALL_RPATH=/usr/lib64/Slicer-4.11:/usr/lib64/ctk-0.1:/usr/lib64/Slicer-4.11/qt-loadable-modules:/usr/lib64/ITK-5.1.0
		-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
		-DSlicer_USE_SYSTEM_LibArchive=ON
		-DTeem_DIR=/usr/lib64
		-DjqPlot_DIR=/usr/share/jqPlot

the following error raises:

CMake Error at Base/QTCore/Testing/Python/cmake_install.cmake:41 (file):
  file INSTALL cannot find
  "/var/tmp/portage/sci-medical/3DSlicer-9999/work/3DSlicer-9999_build/Base/QTCore/Testing/Python/qSlicerModuleGenericTest.py.in".
Call Stack (most recent call first):
  Base/QTCore/Testing/cmake_install.cmake:43 (include)
  Base/QTCore/cmake_install.cmake:88 (include)
  Base/cmake_install.cmake:43 (include)
  cmake_install.cmake:165 (include)

This can be solved by introducing a condition for adding the Python
subdirectory in QTCore/Tesitng.
Using the following configuration:

		-DSlicer_SUPERBUILD=OFF
		-DBUILD_TESTING=OFF
		-DSlicer_BUILD_EXTENSIONMANAGER_SUPPORT=OFF
		-DSlicer_BUILD_CLI_SUPPORT=OFF
		-DSlicer_BUILD_CLI=OFF
		-DCMAKE_CXX_STANDARD=11
		-DSlicer_REQUIRED_QT_VERSION=5
		-DSlicer_BUILD_DICOM_SUPPORT=OFF
		-DSlicer_BUILD_ITKPython=OFF
		-DSlicer_BUILD_QTLOADABLEMODULES=OFF
		-DSlicer_BUILD_QT_DESIGNER_PLUGINS=OFF
		-DSlicer_USE_CTKAPPLAUNCHER=OFF
		-DSlicer_USE_PYTHONQT=OFF
		-DSlicer_USE_QtTesting=OFF
		-DSlicer_USE_SimpleITK=OFF
		-DSlicer_VTK_RENDERING_BACKEND=OpenGL2
		-DSlicer_VTK_VERSION_MAJOR=8
		-DSlicer_INSTALL_DEVELOPMENT=ON
		-DCMAKE_INSTALL_RPATH=/usr/lib64/Slicer-4.11:/usr/lib64/ctk-0.1:/usr/lib64/Slicer-4.11/qt-loadable-modules:/usr/lib64/ITK-5.1.0
		-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
		-DSlicer_USE_SYSTEM_LibArchive=ON
		-DTeem_DIR=/usr/lib64
		-DjqPlot_DIR=/usr/share/jqPlot

raises the following error:

CMake Error at Base/QTGUI/Testing/Cxx/cmake_install.cmake:41 (file):
  file INSTALL cannot find
  "/var/tmp/portage/sci-medical/3DSlicer-9999/work/3DSlicer-9999_build/Base/QTGUI/Testing/Cxx/qSlicerUtilsTest1.cxx.in".
Call Stack (most recent call first):
  Base/QTGUI/Testing/cmake_install.cmake:42 (include)
  Base/QTGUI/cmake_install.cmake:142 (include)
  Base/cmake_install.cmake:44 (include)
  cmake_install.cmake:165 (include)

This can be solved by changing the path of qSlicerUtilsTest1.cxx.in
specified as source for the install command
While there is an option to skip this
SlicerBlockAdditionalLauncherSettins, having
Slicer_BUILD_CTKAPPLAUNCHER=OFF should also skip it.
Some SlicerBaseQT libraries generate ui_*.h files. With this, these
files will be also installed with the rest of development files
@RafaelPalomar
Copy link
Author

Hi. Thank all you for your quick reply.

@pieper this is in the context of getting the development files installed along the install tree and develops on the use of the Slicer_INSTALL_DEVELOPMENT flag already existing in 3D Slicer. This is useful if one distributes 3D Slicer as an installable binary package that developers could use (e.g., creating new modules). In Debian-based distributions, for instance, this applies to packages ending in "-dev" which contain files needed for development.

@pieper These patches uses CMake infrastructure similar to that used for installing libraries and applications. I would think that, at least, these patches gets us closer to that functionality that you mentioned, but I have not tried since I'm not very familiar with CPack. At least, I built 3D Slicer with Slicer_SUPERBUILD=OFF and Slicer_INSTALL_DEVELOPMENT=ON. After make install I could build loadable modules separately, based on the install tree.

@jcfr I see the tests are not passed (that was unexpected). I will try to fix it before you do the integration. I'll message you when this is done.

@lassoan You have to build Slicer, or at least have the binaries distributed somehow, e.g., install tree in the system directories, since you need to link to some 3D Slicer libraries.

@RafaelPalomar RafaelPalomar force-pushed the feature/enable_development_files_installation branch from bf80d1f to d573573 Compare December 13, 2019 11:13
@pieper
Copy link
Member

pieper commented Dec 13, 2019

Hi @RafaelPalomar - thanks for the extra context. It's a good goal and it would really help developers if we could provide a -dev version of Slicer for easy installation and testing. We have always struggled to integrate Slicer's build with standard packaging for linux because we often find that we need to patch our dependencies (e.g. have a customized version of VTK or ITK with a few fixes).

@RafaelPalomar
Copy link
Author

Hi @jcfr @pieper @lassoan. Here just a reminder as suggested by @jcfr.
I'm planning to join the Project Week in January. If you have the time, we could have a chat and I could show you what I'm up to with these changes.

@pieper
Copy link
Member

pieper commented Dec 18, 2019

Yes @RafaelPalomar, a chat a project week is perfect. Please an entry to the project list under Infrastructure so we can flesh out ideas on a project page and link to this PR. https://projectweek.na-mic.org/PW33_2020_GranCanaria/

set(Slicer_INSTALL_CLIMODULES_BIN_DIR "${Slicer_INSTALL_ROOT}${Slicer_BUNDLE_EXTENSIONS_LOCATION}${Slicer_CLIMODULES_BIN_DIR}")
set(Slicer_INSTALL_CLIMODULES_LIB_DIR "${Slicer_INSTALL_ROOT}${Slicer_BUNDLE_EXTENSIONS_LOCATION}${Slicer_CLIMODULES_LIB_DIR}")
set(Slicer_INSTALL_CLIMODULES_SHARE_DIR "${Slicer_INSTALL_ROOT}${Slicer_BUNDLE_EXTENSIONS_LOCATION}${Slicer_CLIMODULES_SHARE_DIR}")
set(Slicer_INSTALL_CLIMODULES_BIN_DIR "${Slicer_HOME}${Slicer_BUNDLE_EXTENSIONS_LOCATION}${Slicer_CLIMODULES_BIN_DIR}")
Copy link
Member

@jcfr jcfr Jan 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -68,7 +68,7 @@ configure_file(
# Install headers
# --------------------------------------------------------------------------
if(NOT DEFINED ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
set(${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT ON)
set(${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT ${Slicer_INSTALL_NO_DEVELOPMENT})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

endif()
if(NOT ${PROJECT_NAME}_INSTALL_NO_DEVELOPMENT)
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
install(
FILES ${headers}
DESTINATION include/${PROJECT_NAME} COMPONENT Development)

install(FILES
${MRMLWidgets_UI_CXX}
Copy link
Member

@jcfr jcfr Jan 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should revisit this. I don't think these are needed to build modules.

@@ -14,19 +14,19 @@ if(NOT Slicer_INSTALL_NO_DEVELOPMENT)
)

file(GLOB PNGFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.png")
foreach(pngfile ${PNGFILES})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need to keep some version of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants