From 6b3d475500ba6722f622db90b096a0f433dacb0d Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Thu, 9 Jan 2025 15:32:16 -0500 Subject: [PATCH] encryptionoperator: add adios2 prefix and soname --- CMakeLists.txt | 2 ++ .../operator/examplePluginOperatorRead.cpp | 2 +- .../operator/examplePluginOperatorWrite.cpp | 2 +- examples/plugins/operator/example_operator.xml | 4 ++-- plugins/engines/CMakeLists.txt | 5 ++--- plugins/operators/CMakeLists.txt | 16 ++++++++-------- testing/install/CMakeLists.txt | 1 + .../install/CatalystEnginePlugin/CMakeLists.txt | 2 +- .../install/EncryptionOperator/CMakeLists.txt | 2 +- testing/install/run_cmake.cmake | 1 + 10 files changed, 20 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05736294f7..b9f9536600 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -339,6 +339,8 @@ endif() #------------------------------------------------------------------------------# # Plugins #------------------------------------------------------------------------------# +set(ADIOS2_INSTALL_PLUGIN_LIBDIR ${CMAKE_INSTALL_BINDIR}/adios2-modules-${ADIOS2_LIBRARY_SOVERSION} CACHE STRING "") +set(ADIOS2_INSTALL_PLUGIN_BINDIR ${CMAKE_INSTALL_LIBDIR}/adios2-modules-${ADIOS2_LIBRARY_SOVERSION} CACHE STRING "") add_subdirectory(plugins) #------------------------------------------------------------------------------# diff --git a/examples/plugins/operator/examplePluginOperatorRead.cpp b/examples/plugins/operator/examplePluginOperatorRead.cpp index 1430b7cd96..08683859fc 100644 --- a/examples/plugins/operator/examplePluginOperatorRead.cpp +++ b/examples/plugins/operator/examplePluginOperatorRead.cpp @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) * other parameters, they can be passed in here as well. */ adios2::Params params; params["PluginName"] = "MyOperator"; - params["PluginLibrary"] = "EncryptionOperator"; + params["PluginLibrary"] = "adios2_encryption_operator"; params["SecretKeyFile"] = "test-key"; var.AddOperation("plugin", params); } diff --git a/examples/plugins/operator/examplePluginOperatorWrite.cpp b/examples/plugins/operator/examplePluginOperatorWrite.cpp index 2909b28bf7..f57777cc70 100644 --- a/examples/plugins/operator/examplePluginOperatorWrite.cpp +++ b/examples/plugins/operator/examplePluginOperatorWrite.cpp @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) * other parameters, they can be passed in here as well. */ adios2::Params params; params["PluginName"] = "MyOperator"; - params["PluginLibrary"] = "EncryptionOperator"; + params["PluginLibrary"] = "adios2_encryption_operator"; params["SecretKeyFile"] = "test-key"; var.AddOperation("plugin", params); } diff --git a/examples/plugins/operator/example_operator.xml b/examples/plugins/operator/example_operator.xml index 7b8af9c575..7bdc032346 100644 --- a/examples/plugins/operator/example_operator.xml +++ b/examples/plugins/operator/example_operator.xml @@ -13,7 +13,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/plugins/engines/CMakeLists.txt b/plugins/engines/CMakeLists.txt index 794a57ee95..8e27c1fc68 100644 --- a/plugins/engines/CMakeLists.txt +++ b/plugins/engines/CMakeLists.txt @@ -12,8 +12,7 @@ if(ADIOS2_HAVE_Catalyst) PRIVATE catalyst::catalyst) install(TARGETS ParaViewADIOSInSituEngine EXPORT adios2Exports - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT adios2_core-runtime - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT adios2_core-libraries NAMELINK_COMPONENT adios2_core-development - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT adios2_core-development + RUNTIME DESTINATION ${ADIOS2_INSTALL_PLUGIN_BINDIR} COMPONENT adios2_core-runtime + LIBRARY DESTINATION ${ADIOS2_INSTALL_PLUGIN_LIBDIR} COMPONENT adios2_core-libraries NAMELINK_COMPONENT adios2_core-development ) endif() diff --git a/plugins/operators/CMakeLists.txt b/plugins/operators/CMakeLists.txt index abea93e0dc..69c6b42d70 100644 --- a/plugins/operators/CMakeLists.txt +++ b/plugins/operators/CMakeLists.txt @@ -4,16 +4,16 @@ #------------------------------------------------------------------------------# if(ADIOS2_HAVE_Sodium) - add_library(EncryptionOperator MODULE + add_library(adios2_encryption_operator MODULE EncryptionOperator.cpp ) - target_link_libraries(EncryptionOperator adios2_core sodium) + target_link_libraries(adios2_encryption_operator adios2_core sodium) if (NOT CMAKE_SKIP_INSTALL_RPATH) - set_target_properties(EncryptionOperator PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) + set_target_properties(adios2_encryption_operator PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE) endif() - install(TARGETS EncryptionOperator EXPORT adios2Exports - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT adios2_core-runtime - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT adios2_core-libraries NAMELINK_COMPONENT adios2_core-development - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT adios2_core-development -) + + install(TARGETS adios2_encryption_operator EXPORT adios2Exports + RUNTIME DESTINATION ${ADIOS2_INSTALL_PLUGIN_BINDIR} COMPONENT adios2_core-runtime + LIBRARY DESTINATION ${ADIOS2_INSTALL_PLUGIN_LIBDIR} COMPONENT adios2_core-libraries NAMELINK_COMPONENT adios2_core-development + ) endif() diff --git a/testing/install/CMakeLists.txt b/testing/install/CMakeLists.txt index a3ad5321b8..facdae22be 100644 --- a/testing/install/CMakeLists.txt +++ b/testing/install/CMakeLists.txt @@ -24,6 +24,7 @@ function(add_install_cmake_test name) "-DBUILD_TYPE=$" "-DMPIEXEC_EXECUTABLE=${MPIEXEC_EXECUTABLE}" "-DMPIEXEC_EXTRA_FLAGS=${MPIEXEC_EXTRA_FLAGS}" + "-DADIOS2_INSTALL_PLUGIN_LIBDIR=${ADIOS2_INSTALL_PLUGIN_LIBDIR}" -P "${CMAKE_CURRENT_SOURCE_DIR}/run_cmake.cmake" ) set_tests_properties(Install.CMake.${name} PROPERTIES diff --git a/testing/install/CatalystEnginePlugin/CMakeLists.txt b/testing/install/CatalystEnginePlugin/CMakeLists.txt index cbfbb1e2c5..39bdaa370e 100644 --- a/testing/install/CatalystEnginePlugin/CMakeLists.txt +++ b/testing/install/CatalystEnginePlugin/CMakeLists.txt @@ -21,7 +21,7 @@ add_executable(adios_plugin_engine_catalyst_test testCatalystEngine.cpp ) target_link_libraries(adios_plugin_engine_catalyst_test adios2::cxx11) -set(ENV{ADIOS2_PLUGIN_PATH} ${adios2_DIR}/../../) +set(ENV{ADIOS2_PLUGIN_PATH} "${adios2_DIR}/../../../${ADIOS2_INSTALL_PLUGIN_LIBDIR}") configure_file(test-catalyst-config.xml ${CMAKE_CURRENT_BINARY_DIR} COPYONLY) add_test(NAME adios_plugin_engine_catalyst_test COMMAND adios_plugin_engine_catalyst_test test-catalyst-config.xml) diff --git a/testing/install/EncryptionOperator/CMakeLists.txt b/testing/install/EncryptionOperator/CMakeLists.txt index aca5c62e68..5225495911 100644 --- a/testing/install/EncryptionOperator/CMakeLists.txt +++ b/testing/install/EncryptionOperator/CMakeLists.txt @@ -11,7 +11,7 @@ find_package(adios2 REQUIRED) option(BUILD_SHARED_LIBS "build shared libs" ON) -set(ENV{ADIOS2_PLUGIN_PATH} "${adios2_DIR}/../../") +set(ENV{ADIOS2_PLUGIN_PATH} "${adios2_DIR}/../../../${ADIOS2_INSTALL_PLUGIN_LIBDIR}") #---------- Operator Plugin Tests diff --git a/testing/install/run_cmake.cmake b/testing/install/run_cmake.cmake index 57f3f90962..e7a37d21d6 100644 --- a/testing/install/run_cmake.cmake +++ b/testing/install/run_cmake.cmake @@ -26,6 +26,7 @@ execute_process(COMMAND "${CMAKE_CTEST_COMMAND}" "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}" "-DMPIEXEC_EXECUTABLE=${MPIEXEC_EXECUTABLE}" "-DMPIEXEC_EXTRA_FLAGS=${MPIEXEC_EXTRA_FLAGS}" + "-DADIOS2_INSTALL_PLUGIN_LIBDIR=${ADIOS2_INSTALL_PLUGIN_LIBDIR}" --test-command "${CMAKE_CTEST_COMMAND}" -V -C "${BUILD_TYPE}" RESULT_VARIABLE result