From 18463ad1570c00373895e3a0ce85ffa3cd95b5a1 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Thu, 12 May 2022 13:25:13 -0700 Subject: [PATCH 1/5] svtk fix exported CMake configuration --- utils/SVTK/CMake/svtkInstallCMakePackage.cmake | 2 +- utils/SVTK/CMake/svtkModule.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/SVTK/CMake/svtkInstallCMakePackage.cmake b/utils/SVTK/CMake/svtkInstallCMakePackage.cmake index 45115a1f6..f0312eb27 100644 --- a/utils/SVTK/CMake/svtkInstallCMakePackage.cmake +++ b/utils/SVTK/CMake/svtkInstallCMakePackage.cmake @@ -166,5 +166,5 @@ install( svtk_module_export_find_packages( CMAKE_DESTINATION "${svtk_cmake_destination}" - FILE_NAME "SVTK-svtk-module-find-packages.cmake" + FILE_NAME "svtk-svtk-module-find-packages.cmake" MODULES ${svtk_modules}) diff --git a/utils/SVTK/CMake/svtkModule.cmake b/utils/SVTK/CMake/svtkModule.cmake index 70bc5b721..4a206b2f5 100644 --- a/utils/SVTK/CMake/svtkModule.cmake +++ b/utils/SVTK/CMake/svtkModule.cmake @@ -2198,7 +2198,7 @@ function (svtk_module_build) endif () if (NOT DEFINED _svtk_build_PACKAGE) - set(_svtk_build_PACKAGE "${CMAKE_PROJECT_NAME}") + set(_svtk_build_PACKAGE svtk) endif () get_property(_svtk_build_package_exists GLOBAL PROPERTY "_svtk_module_package_${_svtk_build_PACKAGE}" From ce2f05b2c2c07157884c3bdec4e8c13502e895d1 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Thu, 12 May 2022 13:26:19 -0700 Subject: [PATCH 2/5] pysvtk fix install location --- utils/pysvtk/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/pysvtk/CMakeLists.txt b/utils/pysvtk/CMakeLists.txt index a8a0958db..8ac26113b 100644 --- a/utils/pysvtk/CMakeLists.txt +++ b/utils/pysvtk/CMakeLists.txt @@ -67,8 +67,8 @@ if (ENABLE_PYTHON) "${CMAKE_BINARY_DIR}/${SVTK_PYTHON_DIR}/${python_file}" COPYONLY) - install(FILES "${CMAKE_BINARY_DIR}/${SVTK_PYTHON_DIR}/${python_file}" - DESTINATION "${CMAKE_BINARY_DIR}/${SVTK_PYTHON_DIR}") + install(FILES "${CMAKE_BINARY_DIR}/${SVTK_PYTHON_DIR}/${python_file}" + DESTINATION "${SVTK_PYTHON_DIR}") endforeach () From 3a5b369f0c30384521994bf428c9a6abf7ab3531 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Thu, 12 May 2022 13:36:51 -0700 Subject: [PATCH 3/5] cmake install fix python install issues * upate the cmake export after adopting cmake's SWIG code * add _pysvtk.so to the _PythonAlanysis.so RPATH * don't install tests in the Python module * fix install locations --- CMake/SENSEIConfig.cmake.in | 17 ++++++++++++++++- python/CMakeLists.txt | 2 +- sensei/CMakeLists.txt | 10 ++++------ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CMake/SENSEIConfig.cmake.in b/CMake/SENSEIConfig.cmake.in index 29e53f264..8fe9b0df0 100644 --- a/CMake/SENSEIConfig.cmake.in +++ b/CMake/SENSEIConfig.cmake.in @@ -97,9 +97,24 @@ if(ENABLE_ASCENT) find_dependency(Ascent NO_DEFAULT_PATH PATHS ${ASCENT_DIR}) include(sAscent) endif() + include(senseiCore) + if (ENABLE_PYTHON) + set(SENSEI_PYTHON_DIR "${CMAKE_CURRENT_LIST_DIR}/../../@SENSEI_PYTHON_DIR@") + include(sPython) - include(_PythonAnalysis) + + add_library(sPythonAnalysis SHARED IMPORTED) + set_property(TARGET sPythonAnalysis + PROPERTY IMPORTED_LOCATION + "${SENSEI_PYTHON_DIR}/_PythonAnalysis.so") + if (APPLE) + set_property(TARGET sPythonAnalysis + PROPERTY IMPORTED_SONAME "@rpath/_PythonAnalysis.so") + endif() + add_dependencies(sPythonAnalysis PythonAnalysis) + endif() + include(sensei) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index c14a9b40f..9aade5f43 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -37,7 +37,7 @@ if (ENABLE_PYTHON) COPYONLY) install(FILES "${CMAKE_BINARY_DIR}/${SENSEI_PYTHON_DIR}/__init__.py" - DESTINATION "${CMAKE_BINARY_DIR}/${SENSEI_PYTHON_DIR}") + DESTINATION "${SENSEI_PYTHON_DIR}") # capture python path for use in automated CI file(CONFIGURE OUTPUT "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/sensei-env.sh" diff --git a/sensei/CMakeLists.txt b/sensei/CMakeLists.txt index 0345f6298..c0afdbede 100644 --- a/sensei/CMakeLists.txt +++ b/sensei/CMakeLists.txt @@ -141,9 +141,9 @@ if (ENABLE_ADIOS2) # enables one not to have to set (DY)LD_LIBRARY_PATH prior to importing # sensei. if (APPLE) - set_target_properties(PythonAnalysis PROPERTIES INSTALL_RPATH "@loader_path/./") + set_target_properties(PythonAnalysis PROPERTIES INSTALL_RPATH "@loader_path/./:@loader_path/../svtk") elseif(UNIX) - set_target_properties(PythonAnalysis PROPERTIES INSTALL_RPATH "\$ORIGIN/./") + set_target_properties(PythonAnalysis PROPERTIES INSTALL_RPATH "\$ORIGIN/./:\$ORIGIN/../svtk") endif() add_library(sPythonAnalysis SHARED IMPORTED) @@ -156,17 +156,15 @@ if (ENABLE_ADIOS2) endif() add_dependencies(sPythonAnalysis PythonAnalysis) - # Python implementations + # install Python analyses set(python_analyses Histogram.py) foreach(python_analysis ${python_analyses}) configure_file(${python_analysis} "${CMAKE_BINARY_DIR}/${SENSEI_PYTHON_DIR}/${python_analysis}" COPYONLY) + install(FILES ${python_analysis} DESTINATION ${SENSEI_PYTHON_DIR}) endforeach() - install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" - DESTINATION ${SENSEI_PYTHON_DIR} FILES_MATCHING PATTERN "*.py") - # add to the sensei library so link info gets propagated list(APPEND sensei_libs sPythonAnalysis) endif() From e7d7fbd986cfb6d5cd1989f081295e0e00f754a1 Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Thu, 12 May 2022 14:29:57 -0700 Subject: [PATCH 4/5] cmake update for svtk to our cmake export --- CMake/SENSEIConfig.cmake.in | 27 +++++++++++++-------------- CMake/vtk.cmake | 3 ++- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CMake/SENSEIConfig.cmake.in b/CMake/SENSEIConfig.cmake.in index 8fe9b0df0..02063b9ab 100644 --- a/CMake/SENSEIConfig.cmake.in +++ b/CMake/SENSEIConfig.cmake.in @@ -7,12 +7,15 @@ set(SENSEI_VERSION_DEVEL "@SENSEI_VERSION_DEVEL@") include(CMakeFindDependencyMacro) if (NOT SENSEI_DIR) - # Use relocatable lookup for SENSEI_DIR + # NOTE: this is for the ECP spack based regression testing. set(SENSEI_DIR "${CMAKE_CURRENT_LIST_DIR}/../../") endif () list(APPEND CMAKE_MODULE_PATH "${SENSEI_DIR}") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/svtk-9.0") +find_package(svtk REQUIRED) + set(SENSEI_LIB_TYPE STATIC) if (@BUILD_SHARED_LIBS@) set(SENSEI_LIB_TYPE SHARED) @@ -42,27 +45,24 @@ set(ENABLE_VTKM @ENABLE_VTKM@) set(ENABLE_VTKM_RENDERING @ENABLE_VTKM_RENDERING@) set(ENABLE_ASCENT @ENABLE_ASCENT@) +include(thread) +include(sMPI) +include(sSVTK) +include(pugixml) +include(sDIY) + if (ENABLE_CATALYST) if (NOT ParaView_DIR) set(ParaView_DIR "@ParaView_DIR@") - find_dependency(ParaView) endif() -else() + find_dependency(ParaView) +elseif (ENABLE_VTK_CORE) if (NOT VTK_DIR) set(VTK_DIR "@VTK_DIR@") endif() - find_dependency(VTK) + find_dependency(vtk) endif() -include(thread) -include(sMPI) -include(sSVTK) -include(pugixml) -include(sDIY) - -if (ENABLE_VTK_CORE) - include(sVTK) -endif() if (ENABLE_VTKM) include(sVTKm) endif() @@ -77,7 +77,6 @@ if (ENABLE_ADIOS2) set(ADIOS2_DIR "@ADIOS2_DIR@") endif() find_dependency(ADIOS2) - list(APPEND CMAKE_MODULE_PATH "${SENSEI_DIR}") include(sADIOS2) endif() if (ENABLE_HDF5) diff --git a/CMake/vtk.cmake b/CMake/vtk.cmake index 403a8a807..5311864bc 100644 --- a/CMake/vtk.cmake +++ b/CMake/vtk.cmake @@ -1,8 +1,9 @@ +set(ENABLE_VTK_CORE OFF) if (ENABLE_VTK_MPI OR ENABLE_VTK_IO OR ENABLE_VTK_MPI OR ENABLE_VTK_RENDERING OR ENABLE_VTK_ACCELERATORS OR ENABLE_VTK_FILTERS) - set(ENABLE_VTK_CORE TRUE) + set(ENABLE_VTK_CORE ON) # lets build the list of modules for VTK pre-8.90 and post 8.90 set(sensei_vtk_components_legacy) From 45d5ae5531dc5f77dde78adff07b109bd74b6deb Mon Sep 17 00:00:00 2001 From: Burlen Loring Date: Thu, 12 May 2022 14:43:26 -0700 Subject: [PATCH 5/5] cmake added a version file for use w/ find_package --- CMake/SENSEIConfigVersion.cmake.in | 11 +++++++++++ CMake/config.cmake | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 CMake/SENSEIConfigVersion.cmake.in diff --git a/CMake/SENSEIConfigVersion.cmake.in b/CMake/SENSEIConfigVersion.cmake.in new file mode 100644 index 000000000..682678249 --- /dev/null +++ b/CMake/SENSEIConfigVersion.cmake.in @@ -0,0 +1,11 @@ +set(PACKAGE_VERSION "@SENSEI_VERSION_MAJOR@.@SENSEI_VERSION_MINOR@.@SENSEI_VERSION_PATCH@") + +# Check whether the requested PACKAGE_FIND_VERSION is compatible +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() diff --git a/CMake/config.cmake b/CMake/config.cmake index af3fca3e2..83bcb9838 100644 --- a/CMake/config.cmake +++ b/CMake/config.cmake @@ -7,5 +7,9 @@ set(SENSEI_BUILD OFF) configure_file(CMake/SENSEIConfig.cmake.in ${CMAKE_INSTALL_LIBDIR}/cmake/SENSEIConfig.cmake @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/lib/cmake/SENSEIConfig.cmake +configure_file(CMake/SENSEIConfigVersion.cmake.in + ${CMAKE_INSTALL_LIBDIR}/cmake/SENSEIConfigVersion.cmake @ONLY) + +install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/SENSEIConfig.cmake + ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}/cmake/SENSEIConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)