Skip to content

Commit

Permalink
move EncryptionOperator to plugins dir
Browse files Browse the repository at this point in the history
  • Loading branch information
caitlinross committed Feb 23, 2022
1 parent 2f089cb commit d6e434d
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 36 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ adios_option(Fortran "Enable support for Fortran bindings" AUTO)
adios_option(SysVShMem "Enable support for SysV Shared Memory IPC on *NIX" AUTO)
adios_option(Profiling "Enable support for profiling" AUTO)
adios_option(Endian_Reverse "Enable support for Little/Big Endian Interoperability" AUTO)
adios_option(Sodium "Enable support for Sodium for encryption" AUTO)
include(${PROJECT_SOURCE_DIR}/cmake/DetectOptions.cmake)

if(ADIOS2_HAVE_CUDA)
Expand Down Expand Up @@ -221,7 +222,7 @@ endif()


set(ADIOS2_CONFIG_OPTS
BP5 DataMan DataSpaces HDF5 HDF5_VOL MHS SST CUDA Fortran MPI Python Blosc BZip2 LIBPRESSIO MGARD PNG SZ ZFP DAOS IME O_DIRECT SysVShMem ZeroMQ Profiling Endian_Reverse
BP5 DataMan DataSpaces HDF5 HDF5_VOL MHS SST CUDA Fortran MPI Python Blosc BZip2 LIBPRESSIO MGARD PNG SZ ZFP DAOS IME O_DIRECT SysVShMem ZeroMQ Profiling Endian_Reverse Sodium
)

GenerateADIOSHeaderConfig(${ADIOS2_CONFIG_OPTS})
Expand Down Expand Up @@ -286,6 +287,11 @@ add_subdirectory(source)
#------------------------------------------------------------------------------#
add_subdirectory(bindings)

#------------------------------------------------------------------------------#
# Plugins
#------------------------------------------------------------------------------#
add_subdirectory(plugins)

#------------------------------------------------------------------------------#
# Examples
#------------------------------------------------------------------------------#
Expand Down
10 changes: 10 additions & 0 deletions cmake/DetectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,16 @@ if(ADIOS2_USE_Endian_Reverse STREQUAL ON)
set(ADIOS2_HAVE_Endian_Reverse TRUE)
endif()

# Sodium for EncryptionOperator
if(ADIOS2_USE_Sodium STREQUAL AUTO)
find_package(Sodium)
elseif(ADIOS2_USE_Sodium)
find_package(Sodium REQUIRED)
endif()
if(Sodium_FOUND)
set(ADIOS2_HAVE_Sodium TRUE)
endif()

# Multithreading
find_package(Threads REQUIRED)

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions cmake/adios2-config-common.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ if(NOT @BUILD_SHARED_LIBS@)
find_dependency(HDF5 COMPONENTS C)
endif()

set(ADIOS2_HAVE_Sodium @ADIOS2_HAVE_Sodium@)
if(ADIOS2_HAVE_Sodium)
find_dependency(Sodium)
endif()

adios2_add_thirdparty_target(pugixml)
set(ADIOS2_USE_EXTERNAL_PUGIXML @ADIOS2_USE_EXTERNAL_PUGIXML@)
if(ADIOS2_USE_EXTERNAL_PUGIXML)
Expand Down
9 changes: 0 additions & 9 deletions examples/plugins/operator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#

list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR})
find_package(Sodium 1.8 REQUIRED)

add_library(EncryptionOperator
EncryptionOperator.cpp
)
target_link_libraries(EncryptionOperator adios2::cxx11 adios2_core sodium)

add_executable(exampleOperatorPlugin_write
examplePluginOperator_write.cpp
)
Expand Down
16 changes: 16 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#

if(ADIOS2_HAVE_Sodium)
add_library(EncryptionOperator
EncryptionOperator.cpp
)
target_link_libraries(EncryptionOperator adios2_core sodium)
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
)
endif()
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion testing/install/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,7 @@ if(NOT WIN32)
endif()
endif()

add_install_cmake_test(plugin)
add_install_cmake_test(EnginePlugin)
if(ADIOS2_HAVE_Sodium)
add_install_cmake_test(EncryptionOperator)
endif()
32 changes: 32 additions & 0 deletions testing/install/EncryptionOperator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#------------------------------------------------------------------------------#
# Distributed under the OSI-approved Apache License, Version 2.0. See
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#

cmake_minimum_required(VERSION 3.6)
project(adios_operator_plugin_test CXX)
enable_testing()

find_package(adios2 REQUIRED)

option(BUILD_SHARED_LIBS "build shared libs" ON)

set(ENV{ADIOS2_PLUGIN_PATH} "${adios2_DIR}/../../")

#---------- Operator Plugin Tests

# add write test
add_executable(adios_plugin_operator_write_test
../../../examples/plugins/operator/examplePluginOperator_write.cpp
)
target_link_libraries(adios_plugin_operator_write_test adios2::cxx11)
add_test(NAME adios_plugin_operator_write_test COMMAND adios_plugin_operator_write_test)

# add read test
add_executable(adios_plugin_operator_read_test
../../../examples/plugins/operator/examplePluginOperator_read.cpp
)
target_link_libraries(adios_plugin_operator_read_test adios2::cxx11)
add_test(NAME adios_plugin_operator_read_test COMMAND adios_plugin_operator_read_test)
set_tests_properties(adios_plugin_operator_read_test PROPERTIES
DEPENDS adios_plugin_operator_write_test)
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,3 @@ add_test(NAME adios_plugin_engine_read_test COMMAND adios_plugin_engine_read_tes
set_tests_properties(adios_plugin_engine_read_test PROPERTIES
DEPENDS adios_plugin_engine_write_test)

#---------- Operator Plugin Tests

list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_SOURCE_DIR}/../../../examples/plugins/operator)
find_package(Sodium 1.8 REQUIRED)

add_library(EncryptionOperator
../../../examples/plugins/operator/EncryptionOperator.cpp
)
target_link_libraries(EncryptionOperator adios2::cxx11 adios2::core sodium)

# add write test
add_executable(adios_plugin_operator_write_test
../../../examples/plugins/operator/examplePluginOperator_write.cpp
)
target_link_libraries(adios_plugin_operator_write_test adios2::cxx11)
add_test(NAME adios_plugin_operator_write_test COMMAND adios_plugin_operator_write_test)

# add read test
add_executable(adios_plugin_operator_read_test
../../../examples/plugins/operator/examplePluginOperator_read.cpp
)
target_link_libraries(adios_plugin_operator_read_test adios2::cxx11)
add_test(NAME adios_plugin_operator_read_test COMMAND adios_plugin_operator_read_test)
set_tests_properties(adios_plugin_operator_read_test PROPERTIES
DEPENDS adios_plugin_operator_write_test)

0 comments on commit d6e434d

Please sign in to comment.