diff --git a/cmake/FindADIOS2.cmake b/cmake/FindADIOS2.cmake index 56ce89317..bc27ad258 100644 --- a/cmake/FindADIOS2.cmake +++ b/cmake/FindADIOS2.cmake @@ -69,8 +69,8 @@ string(REGEX REPLACE set(MIN_VALID_ADIOS2_VERSION 2.10.0) set(MAX_VALID_ADIOS2_VERSION 2.10.10) #if( ${SKIP_ADIOS2_VERSION_CHECK} ) - message(STATUS "Skipping ADIOS2 version check." - " This may result in undefined behavior") +# message(STATUS "Skipping ADIOS2 version check." +# " This may result in undefined behavior") #elseif( (ADIOS2_DOT_VERSION VERSION_LESS MIN_VALID_ADIOS2_VERSION) OR # (ADIOS2_DOT_VERSION VERSION_GREATER MAX_VALID_ADIOS2_VERSION) ) # MESSAGE(FATAL_ERROR @@ -82,34 +82,15 @@ message(STATUS "Building with ADIOS2 ${ADIOS2_DOT_VERSION}") set(ADIOS2_LIBS "") if (Omega_h_USE_MPI) - set(ADIOS2_LIB_NAMES -adios2_core_mpi -adios2_evpath -adios2_hello_inlineMixedLang -adios2_atl -adios2_cxx11 -adios2_ffs -adios2_plugins_exampleReadPlugin -adios2_c -adios2_cxx11_mpi -adios2_plugins_exampleWritePlugin -adios2_c_mpi -adios2_dill -adios2_core -adios2_enet -adios2_h5vol +set(ADIOS2_LIB_NAMES + adios2_core_mpi + adios2_cxx11_mpi ) else() - set(ADIOS2_LIB_NAMES - adios2_atl - adios2_core - adios2_c - adios2_cxx11 - adios2_dill - adios2_enet - adios2_evpath - adios2_ffs - ) +set(ADIOS2_LIB_NAMES + adios2_core + adios2_cxx11 +) endif() adios2LibCheck("${ADIOS2_LIB_NAMES}" TRUE) @@ -118,7 +99,6 @@ adios2LibCheck("${ADIOS2_LIB_NAMES}" TRUE) # if all listed variables are TRUE find_package_handle_standard_args(ADIOS2 DEFAULT_MSG ADIOS2_LIBS ADIOS2_INCLUDE_DIR - ) +) -mark_as_advanced(ADIOS2_INCLUDE_DIR ADIOS2_LIBS - ) +mark_as_advanced(ADIOS2_INCLUDE_DIR ADIOS2_LIBS) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d918fafbc..a40b6ff5c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,7 +36,6 @@ set(Omega_h_SOURCES Omega_h_fail.cpp Omega_h_fence.cpp Omega_h_file.cpp - Omega_h_adios2.cpp Omega_h_filesystem.cpp Omega_h_finite_automaton.cpp Omega_h_fix.cpp @@ -171,8 +170,9 @@ if(Omega_h_USE_SimModSuite) "${CMAKE_CURRENT_BINARY_DIR}/Omega_h_simConfig.h") endif() +message(STATUS "Omega_h_USE_ADIOS2: ${Omega_h_USE_ADIOS2}") if(Omega_h_USE_ADIOS2) - message(STATUS "Omega_h_USE_ADIOS2: ${Omega_h_USE_ADIOS2}") + list(APPEND Omega_h_SOURCES Omega_h_adios2.cpp) #Is there a better way? I assume CMAKE_MODULE_PATH was purposely not set in # the top level CMakeLists.txt set(OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) @@ -234,15 +234,14 @@ if(Omega_h_USE_SimModSuite) endif() if(Omega_h_USE_ADIOS2) - set(ADIOS_REQUIRED_VERSION 2.10) -if (Omega_h_USE_MPI) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADIOS2_USE_MPI") - # message("CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}") - target_include_directories(omega_h PUBLIC "${ADIOS2_INCLUDE_DIR}") - target_link_libraries(omega_h PUBLIC "${ADIOS2_LIBS}") -else() - message("set Omega_h_USE_MPI to use ADIOS2") -endif() + set(ADIOS_REQUIRED_VERSION 2.10) + if (Omega_h_USE_MPI) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADIOS2_USE_MPI") + target_include_directories(omega_h PUBLIC "${ADIOS2_INCLUDE_DIR}") + target_link_libraries(omega_h PUBLIC "${ADIOS2_LIBS}") + else() + message("set Omega_h_USE_MPI to use ADIOS2") + endif() endif() bob_link_dependency(omega_h PUBLIC SEACASExodus) @@ -633,12 +632,12 @@ if(BUILD_TESTING) endif() if (Omega_h_USE_ADIOS2) - osh_add_util(bp2osh) - osh_add_util(osh2bp) - osh_add_exe(adios2_io) - test_basefunc(adios2_io 1 ./adios2_io - ${CMAKE_SOURCE_DIR}/meshes/unitbox_cutTriCube_1k.osh - output.bp) + osh_add_util(bp2osh) + osh_add_util(osh2bp) + osh_add_exe(adios2_io) + test_basefunc(adios2_io 1 ./adios2_io + ${CMAKE_SOURCE_DIR}/meshes/unitbox_cutTriCube_1k.osh + output.bp) endif() endif() @@ -673,7 +672,6 @@ set(Omega_h_HEADERS Omega_h_fence.hpp Omega_h_few.hpp Omega_h_file.hpp - Omega_h_adios2.hpp Omega_h_filesystem.hpp Omega_h_finite_automaton.hpp Omega_h_for.hpp @@ -756,6 +754,10 @@ else() list(APPEND Omega_h_HEADERS Omega_h_array_default.hpp) endif() +if(Omega_h_USE_ADIOS2) + list(APPEND Omega_h_HEADERS Omega_h_adios2.hpp) +endif() + install(FILES ${Omega_h_HEADERS} DESTINATION include) if (Omega_h_USE_pybind11) diff --git a/src/adios2_io.cpp b/src/adios2_io.cpp index ac030b03f..975b3b2f1 100644 --- a/src/adios2_io.cpp +++ b/src/adios2_io.cpp @@ -93,14 +93,6 @@ int main(int argc, char *argv[]) cout<<"\n\n--- Mesh loaded back from \""<