Skip to content

Commit

Permalink
Merge pull request #65 from SENSEI-insitu/fix_install_issues
Browse files Browse the repository at this point in the history
bug fixes that address issues when installing or using the install. tested with AMReX and their tutorials
  • Loading branch information
burlen authored May 12, 2022
2 parents 40ca4fd + 45d5ae5 commit e0ae9a9
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 28 deletions.
44 changes: 29 additions & 15 deletions CMake/SENSEIConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -97,9 +96,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)
11 changes: 11 additions & 0 deletions CMake/SENSEIConfigVersion.cmake.in
Original file line number Diff line number Diff line change
@@ -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()
6 changes: 5 additions & 1 deletion CMake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 2 additions & 1 deletion CMake/vtk.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 4 additions & 6 deletions sensei/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion utils/SVTK/CMake/svtkInstallCMakePackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion utils/SVTK/CMake/svtkModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
4 changes: 2 additions & 2 deletions utils/pysvtk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()

Expand Down

0 comments on commit e0ae9a9

Please sign in to comment.