From 4bf29b72979082feb570d1d96976d6fe429a179a Mon Sep 17 00:00:00 2001 From: Vicente Adolfo Bolea Sanchez Date: Mon, 22 Jul 2024 15:21:57 -0400 Subject: [PATCH] cmake: use MPI_CXX for targets of CXX sources --- bindings/C/CMakeLists.txt | 2 +- bindings/CXX11/CMakeLists.txt | 2 +- bindings/Fortran/CMakeLists.txt | 4 ++-- cmake/DetectOptions.cmake | 2 +- cmake/adios2-config-common.cmake.in | 7 ------- cmake/install/post/adios2-config-dummy/CMakeLists.txt | 2 +- docs/user_guide/source/faq/faq.rst | 2 +- docs/user_guide/source/setting_up/linking.rst | 2 +- examples/basics/globalArrayND/CMakeLists.txt | 2 +- examples/basics/joinedArray/CMakeLists.txt | 2 +- examples/basics/localArray/CMakeLists.txt | 2 +- examples/basics/queryWorker/CMakeLists.txt | 2 +- examples/basics/values/CMakeLists.txt | 2 +- examples/basics/variablesShapes/CMakeLists.txt | 4 ++-- examples/campaign/CMakeLists.txt | 2 +- examples/hello/bpAttributeWriteRead/CMakeLists.txt | 2 +- examples/hello/bpFWriteCRead/CMakeLists.txt | 4 ++-- examples/hello/bpFlushWriter/CMakeLists.txt | 2 +- examples/hello/bpOperatorSZWriter/CMakeLists.txt | 2 +- examples/hello/bpReader/CMakeLists.txt | 6 +++--- examples/hello/bpStepsWriteRead/CMakeLists.txt | 2 +- examples/hello/bpStepsWriteReadKokkos/CMakeLists.txt | 4 ++-- examples/hello/bpWriter/CMakeLists.txt | 6 +++--- examples/hello/datamanKokkos/CMakeLists.txt | 4 ++-- examples/hello/datamanReader/CMakeLists.txt | 2 +- examples/hello/datamanWriter/CMakeLists.txt | 2 +- examples/hello/dataspacesReader/CMakeLists.txt | 2 +- examples/hello/dataspacesWriter/CMakeLists.txt | 2 +- examples/hello/hdf5Reader/CMakeLists.txt | 2 +- examples/hello/hdf5SubFile/CMakeLists.txt | 2 +- examples/hello/hdf5Writer/CMakeLists.txt | 2 +- examples/hello/helloWorld/CMakeLists.txt | 4 ++-- examples/hello/inlineReaderWriter/CMakeLists.txt | 2 +- examples/hello/skeleton/CMakeLists.txt | 4 ++-- examples/hello/sstReader/CMakeLists.txt | 2 +- examples/hello/sstWriter/CMakeLists.txt | 2 +- examples/simulations/gray-scott-kokkos/CMakeLists.txt | 2 +- examples/simulations/gray-scott-struct/CMakeLists.txt | 4 ++-- examples/simulations/gray-scott/CMakeLists.txt | 4 ++-- .../simulations/heatTransfer/inline/CMakeLists.txt | 2 +- examples/simulations/heatTransfer/read/CMakeLists.txt | 2 +- .../heatTransfer/readFileOnly/CMakeLists.txt | 2 +- examples/simulations/heatTransfer/write/CMakeLists.txt | 10 +++++----- examples/useCases/insituGlobalArrays/CMakeLists.txt | 4 ++-- source/adios2/CMakeLists.txt | 10 +++++++--- source/utils/adios_iotest/CMakeLists.txt | 2 +- testing/CMakeLists.txt | 2 +- testing/adios2/bindings/fortran/CMakeLists.txt | 2 +- testing/adios2/engine/common/CMakeLists.txt | 2 +- testing/adios2/engine/skeleton/CMakeLists.txt | 4 ++-- testing/adios2/engine/staging-common/CMakeLists.txt | 2 +- testing/adios2/performance/metadata/CMakeLists.txt | 2 +- testing/install/CXX11/CMakeLists.txt | 5 +---- testing/utils/changingshape/CMakeLists.txt | 2 +- 54 files changed, 78 insertions(+), 84 deletions(-) diff --git a/bindings/C/CMakeLists.txt b/bindings/C/CMakeLists.txt index 52eba4f1e1..b757d60c25 100644 --- a/bindings/C/CMakeLists.txt +++ b/bindings/C/CMakeLists.txt @@ -33,7 +33,7 @@ if(ADIOS2_HAVE_MPI) ) set_property(TARGET adios2_c_mpi PROPERTY EXPORT_NAME c_mpi) set_property(TARGET adios2_c_mpi PROPERTY OUTPUT_NAME adios2${ADIOS2_LIBRARY_SUFFIX}_c_mpi) - target_link_libraries(adios2_c_mpi PUBLIC adios2_c PRIVATE adios2_core_mpi PUBLIC MPI::MPI_C) + target_link_libraries(adios2_c_mpi PUBLIC adios2_c PRIVATE adios2_core_mpi_c PUBLIC MPI::MPI_C) target_compile_definitions(adios2_c_mpi INTERFACE ADIOS2_USE_MPI) add_library(adios2::c_mpi ALIAS adios2_c_mpi) set(maybe_adios2_c_mpi adios2_c_mpi) diff --git a/bindings/CXX11/CMakeLists.txt b/bindings/CXX11/CMakeLists.txt index 76cf76120b..22fb7eb288 100644 --- a/bindings/CXX11/CMakeLists.txt +++ b/bindings/CXX11/CMakeLists.txt @@ -51,7 +51,7 @@ if(ADIOS2_HAVE_MPI) ) set_property(TARGET adios2_cxx11_mpi PROPERTY EXPORT_NAME cxx11_mpi) set_property(TARGET adios2_cxx11_mpi PROPERTY OUTPUT_NAME adios2${ADIOS2_LIBRARY_SUFFIX}_cxx11_mpi) - target_link_libraries(adios2_cxx11_mpi PUBLIC adios2_cxx11 PRIVATE adios2_core_mpi PUBLIC MPI::MPI_C) + target_link_libraries(adios2_cxx11_mpi PUBLIC adios2_cxx11 PRIVATE adios2_core_mpi PUBLIC MPI::MPI_CXX) set(maybe_adios2_cxx11_mpi adios2_cxx11_mpi) target_compile_definitions(adios2_cxx11_mpi INTERFACE ADIOS2_USE_MPI) add_library(adios2::cxx11_mpi ALIAS adios2_cxx11_mpi) diff --git a/bindings/Fortran/CMakeLists.txt b/bindings/Fortran/CMakeLists.txt index 20c8407c5e..cfc84e2744 100644 --- a/bindings/Fortran/CMakeLists.txt +++ b/bindings/Fortran/CMakeLists.txt @@ -104,7 +104,7 @@ if(ADIOS2_HAVE_MPI) adios2_fortran PRIVATE adios2_c_mpi - adios2_core_mpi + adios2_core_mpi_c INTERFACE MPI::MPI_Fortran ) @@ -119,7 +119,7 @@ if(ADIOS2_HAVE_MPI) add_library(adios2_fortran_mpi INTERFACE) target_link_libraries(adios2_fortran_mpi INTERFACE adios2_fortran MPI::MPI_Fortran) target_sources(adios2_fortran PRIVATE ${adios2_fortran_mpi_srcs}) - target_link_libraries(adios2_fortran PRIVATE adios2_c_mpi adios2_core_mpi) + target_link_libraries(adios2_fortran PRIVATE adios2_c_mpi adios2_core_mpi_c) endif() set_property(TARGET adios2_fortran_mpi PROPERTY EXPORT_NAME fortran_mpi) diff --git a/cmake/DetectOptions.cmake b/cmake/DetectOptions.cmake index e609bb0fc2..4aba568960 100644 --- a/cmake/DetectOptions.cmake +++ b/cmake/DetectOptions.cmake @@ -461,7 +461,7 @@ if(ADIOS2_USE_SST AND NOT WIN32) message(STATUS "Libfabric support for the HPE CXI provider: ${ADIOS2_SST_HAVE_CRAY_CXI}") endif() if(ADIOS2_HAVE_MPI AND NOT "${ADIOS2_SST_HAVE_MPI_DP}") - set(CMAKE_REQUIRED_LIBRARIES "MPI::MPI_C;Threads::Threads") + set(CMAKE_REQUIRED_LIBRARIES "MPI::MPI_CXX;Threads::Threads") include(CheckCXXSourceRuns) check_cxx_source_runs([=[ #include diff --git a/cmake/adios2-config-common.cmake.in b/cmake/adios2-config-common.cmake.in index ad5319181c..dc936a2c46 100644 --- a/cmake/adios2-config-common.cmake.in +++ b/cmake/adios2-config-common.cmake.in @@ -230,13 +230,6 @@ if(NOT TARGET adios2::core) list(FILTER _adios2_link_libs EXCLUDE REGEX "^adios2::(c|c_mpi)$") set_property(TARGET adios2::adios2 PROPERTY INTERFACE_LINK_LIBRARIES "${_adios2_link_libs}") unset(_adios2_link_libs) - if(TARGET adios2::core_mpi) - # Since C is not available, use MPI through MPI_CXX instead. - get_property(_adios2_link_libs TARGET adios2::core_mpi PROPERTY INTERFACE_LINK_LIBRARIES) - string(REGEX REPLACE "MPI::MPI_C(;|>|$)" "MPI::MPI_CXX\\1" _adios2_link_libs "${_adios2_link_libs}") - set_property(TARGET adios2::core_mpi PROPERTY INTERFACE_LINK_LIBRARIES "${_adios2_link_libs}") - unset(_adios2_link_libs) - endif() endif() if(NOT CMAKE_CXX_COMPILER_LOADED) # Since CXX is not available, take out CXX bindings from legacy library. diff --git a/cmake/install/post/adios2-config-dummy/CMakeLists.txt b/cmake/install/post/adios2-config-dummy/CMakeLists.txt index 83db648edd..0161f84f27 100644 --- a/cmake/install/post/adios2-config-dummy/CMakeLists.txt +++ b/cmake/install/post/adios2-config-dummy/CMakeLists.txt @@ -42,7 +42,7 @@ if(ADIOS2_HAVE_MPI) target_link_libraries(mpi_with_C adios2::c_mpi adios2::c MPI::MPI_C) add_executable(mpi_without_CXX foo.cxx main.cxx) - target_link_libraries(mpi_without_CXX MPI::MPI_C) + target_link_libraries(mpi_without_CXX MPI::MPI_CXX) add_executable(mpi_with_CXX foo.cxx main.cxx) target_compile_definitions(mpi_with_CXX PRIVATE WITH_ADIOS2) target_link_libraries(mpi_with_CXX adios2::cxx11_mpi adios2::cxx11 MPI::MPI_CXX) diff --git a/docs/user_guide/source/faq/faq.rst b/docs/user_guide/source/faq/faq.rst index 4745609749..a21a434428 100644 --- a/docs/user_guide/source/faq/faq.rst +++ b/docs/user_guide/source/faq/faq.rst @@ -61,7 +61,7 @@ If using cmake, there are different targets to build parallel find_package(ADIOS2 REQUIRED) #... add_library(my_library src1.cxx src2.cxx) - target_link_libraries(my_library PRIVATE adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(my_library PRIVATE adios2::cxx11_mpi MPI::MPI_CXX) #... add_library(my_f_library src1.F90 src2.F90) target_link_libraries(my_f_library PRIVATE adios2::fortran_mpi adios2::fortran MPI::MPI_Fortran) diff --git a/docs/user_guide/source/setting_up/linking.rst b/docs/user_guide/source/setting_up/linking.rst index 3df8cd8e82..6f5015ae9e 100644 --- a/docs/user_guide/source/setting_up/linking.rst +++ b/docs/user_guide/source/setting_up/linking.rst @@ -17,7 +17,7 @@ ADIOS exports a CMake package configuration file that allows its targets to be d find_package(ADIOS2 REQUIRED) #... add_library(my_library src1.cxx src2.cxx) - target_link_libraries(my_library PRIVATE adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(my_library PRIVATE adios2::cxx11_mpi MPI::MPI_CXX) When configuring your project you can then set the ``ADIOS2_ROOT`` or ``ADIOS2_DIR`` environment variables to the install prefix of ADIOS2. diff --git a/examples/basics/globalArrayND/CMakeLists.txt b/examples/basics/globalArrayND/CMakeLists.txt index f1d131c5fa..de7d8b65fa 100644 --- a/examples/basics/globalArrayND/CMakeLists.txt +++ b/examples/basics/globalArrayND/CMakeLists.txt @@ -26,6 +26,6 @@ install(TARGETS adios2_basics_globalArrayNDWrite RUNTIME DESTINATION ${CMAKE_INS if(ADIOS2_HAVE_MPI) add_executable(adios2_basics_globalArrayNDWrite_mpi globalArrayNDWrite.cpp) - target_link_libraries(adios2_basics_globalArrayNDWrite_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_basics_globalArrayNDWrite_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_basics_globalArrayNDWrite_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/basics/joinedArray/CMakeLists.txt b/examples/basics/joinedArray/CMakeLists.txt index a342d75293..f9945cc0cf 100644 --- a/examples/basics/joinedArray/CMakeLists.txt +++ b/examples/basics/joinedArray/CMakeLists.txt @@ -26,6 +26,6 @@ install(TARGETS adios2_basics_joinedArrayWrite RUNTIME DESTINATION ${CMAKE_INSTA if(ADIOS2_HAVE_MPI) add_executable(adios2_basics_joinedArrayWrite_mpi joinedArrayWrite.cpp) - target_link_libraries(adios2_basics_joinedArrayWrite_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_basics_joinedArrayWrite_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_basics_joinedArrayWrite_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/basics/localArray/CMakeLists.txt b/examples/basics/localArray/CMakeLists.txt index a43a61550f..657e963408 100644 --- a/examples/basics/localArray/CMakeLists.txt +++ b/examples/basics/localArray/CMakeLists.txt @@ -30,6 +30,6 @@ install(TARGETS adios2_basics_localArrayRead RUNTIME DESTINATION ${CMAKE_INSTALL if(ADIOS2_HAVE_MPI) add_executable(adios2_basics_localArrayWrite_mpi localArrayWrite.cpp) - target_link_libraries(adios2_basics_localArrayWrite_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_basics_localArrayWrite_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_basics_localArrayWrite_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/basics/queryWorker/CMakeLists.txt b/examples/basics/queryWorker/CMakeLists.txt index 7cce9e5c4c..aca41669a8 100644 --- a/examples/basics/queryWorker/CMakeLists.txt +++ b/examples/basics/queryWorker/CMakeLists.txt @@ -22,7 +22,7 @@ endif() if(ADIOS2_HAVE_MPI) add_executable(adios2_basics_queryWorker queryWorker.cpp) - target_link_libraries(adios2_basics_queryWorker adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_basics_queryWorker adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_basics_queryWorker RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/basics/values/CMakeLists.txt b/examples/basics/values/CMakeLists.txt index f37b7da6ab..e3a64a2564 100644 --- a/examples/basics/values/CMakeLists.txt +++ b/examples/basics/values/CMakeLists.txt @@ -36,7 +36,7 @@ install(TARGETS adios2_basics_valuesWrite RUNTIME DESTINATION ${CMAKE_INSTALL_BI if(ADIOS2_HAVE_MPI) add_executable(adios2_basics_valuesWrite_mpi valuesWrite.cpp) - target_link_libraries(adios2_basics_valuesWrite_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_basics_valuesWrite_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_basics_valuesWrite_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) if(ADIOS2_HAVE_Fortran) diff --git a/examples/basics/variablesShapes/CMakeLists.txt b/examples/basics/variablesShapes/CMakeLists.txt index 2dbd92f4fd..cca6c1e5f3 100644 --- a/examples/basics/variablesShapes/CMakeLists.txt +++ b/examples/basics/variablesShapes/CMakeLists.txt @@ -30,10 +30,10 @@ install(TARGETS adios2_basics_variablesShapes_hl RUNTIME DESTINATION ${CMAKE_INS if(ADIOS2_HAVE_MPI) add_executable(adios2_basics_variablesShapes_mpi variablesShapes.cpp) - target_link_libraries(adios2_basics_variablesShapes_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_basics_variablesShapes_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_basics_variablesShapes_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_basics_variablesShapes_hl_mpi variablesShapes_hl.cpp) - target_link_libraries(adios2_basics_variablesShapes_hl_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_basics_variablesShapes_hl_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_basics_variablesShapes_hl_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/campaign/CMakeLists.txt b/examples/campaign/CMakeLists.txt index 0ec67ac102..092cb1f0dd 100644 --- a/examples/campaign/CMakeLists.txt +++ b/examples/campaign/CMakeLists.txt @@ -5,5 +5,5 @@ if(ADIOS2_HAVE_MPI) add_executable(adios2_campaign_write_mpi campaign_write.cpp) - target_link_libraries(adios2_campaign_write_mpi adios2::cxx11_mpi adios2_core MPI::MPI_C) + target_link_libraries(adios2_campaign_write_mpi adios2::cxx11_mpi adios2_core MPI::MPI_CXX) endif() diff --git a/examples/hello/bpAttributeWriteRead/CMakeLists.txt b/examples/hello/bpAttributeWriteRead/CMakeLists.txt index cfc777fef2..5c7d3312b4 100644 --- a/examples/hello/bpAttributeWriteRead/CMakeLists.txt +++ b/examples/hello/bpAttributeWriteRead/CMakeLists.txt @@ -26,6 +26,6 @@ install(TARGETS adios2_hello_bpAttributeWriteRead RUNTIME DESTINATION ${CMAKE_IN if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_bpAttributeWriteRead_mpi bpAttributeWriteRead.cpp) - target_link_libraries(adios2_hello_bpAttributeWriteRead_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpAttributeWriteRead_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpAttributeWriteRead_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/bpFWriteCRead/CMakeLists.txt b/examples/hello/bpFWriteCRead/CMakeLists.txt index 759d6919c6..fb44956a06 100644 --- a/examples/hello/bpFWriteCRead/CMakeLists.txt +++ b/examples/hello/bpFWriteCRead/CMakeLists.txt @@ -32,11 +32,11 @@ endif() if (ADIOS2_HAVE_MPI) add_executable(adios2_hello_CppWriter CppWriter.cpp) - target_link_libraries(adios2_hello_CppWriter adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_CppWriter adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_CppWriter RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_CppReader CppReader.cpp) - target_link_libraries(adios2_hello_CppReader adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_CppReader adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_CppReader RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) if(ADIOS2_HAVE_Fortran) diff --git a/examples/hello/bpFlushWriter/CMakeLists.txt b/examples/hello/bpFlushWriter/CMakeLists.txt index 61c78ebc7b..483900e579 100644 --- a/examples/hello/bpFlushWriter/CMakeLists.txt +++ b/examples/hello/bpFlushWriter/CMakeLists.txt @@ -26,6 +26,6 @@ install(TARGETS adios2_hello_bpFlushWriter RUNTIME DESTINATION ${CMAKE_INSTALL_B if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_bpFlushWriter_mpi bpFlushWriter.cpp) - target_link_libraries(adios2_hello_bpFlushWriter_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpFlushWriter_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpFlushWriter_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/bpOperatorSZWriter/CMakeLists.txt b/examples/hello/bpOperatorSZWriter/CMakeLists.txt index c54aadf81e..2cb6ed93b5 100644 --- a/examples/hello/bpOperatorSZWriter/CMakeLists.txt +++ b/examples/hello/bpOperatorSZWriter/CMakeLists.txt @@ -30,7 +30,7 @@ if(ADIOS2_HAVE_SZ) if (ADIOS2_HAVE_MPI) add_executable(adios2_hello_bpOperatorSZWriter_mpi bpOperatorSZWriter.cpp) - target_link_libraries(adios2_hello_bpOperatorSZWriter_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpOperatorSZWriter_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpOperatorSZWriter_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif () endif() diff --git a/examples/hello/bpReader/CMakeLists.txt b/examples/hello/bpReader/CMakeLists.txt index 47a5140944..00f5d804f9 100644 --- a/examples/hello/bpReader/CMakeLists.txt +++ b/examples/hello/bpReader/CMakeLists.txt @@ -36,15 +36,15 @@ install(TARGETS adios2_hello_bpReader RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_bpReader_mpi bpReader.cpp) - target_link_libraries(adios2_hello_bpReader_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpReader_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpReader_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_bpReaderHeatMap2D bpReaderHeatMap2D.cpp) - target_link_libraries(adios2_hello_bpReaderHeatMap2D adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpReaderHeatMap2D adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpReaderHeatMap2D RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_bpReaderHeatMap3D bpReaderHeatMap3D.cpp) - target_link_libraries(adios2_hello_bpReaderHeatMap3D adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpReaderHeatMap3D adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpReaderHeatMap3D RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/bpStepsWriteRead/CMakeLists.txt b/examples/hello/bpStepsWriteRead/CMakeLists.txt index 6acf9698dd..932fae9b03 100644 --- a/examples/hello/bpStepsWriteRead/CMakeLists.txt +++ b/examples/hello/bpStepsWriteRead/CMakeLists.txt @@ -26,6 +26,6 @@ install(TARGETS adios2_hello_bpStepsWriteRead RUNTIME DESTINATION ${CMAKE_INSTAL if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_bpStepsWriteRead_mpi bpStepsWriteRead.cpp) - target_link_libraries(adios2_hello_bpStepsWriteRead_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpStepsWriteRead_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpStepsWriteRead_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/bpStepsWriteReadKokkos/CMakeLists.txt b/examples/hello/bpStepsWriteReadKokkos/CMakeLists.txt index 6f0025efde..521eb2729c 100644 --- a/examples/hello/bpStepsWriteReadKokkos/CMakeLists.txt +++ b/examples/hello/bpStepsWriteReadKokkos/CMakeLists.txt @@ -49,7 +49,7 @@ find_package(flcl QUIET) add_executable(adios2_hello_bpStepsWriteReadKokkos bpStepsWriteReadKokkos.cpp) kokkos_compilation(SOURCE bpStepsWriteReadKokkos.cpp) if(ADIOS2_HAVE_MPI) - target_link_libraries(adios2_hello_bpStepsWriteReadKokkos adios2::cxx11_mpi MPI::MPI_C Kokkos::kokkos) + target_link_libraries(adios2_hello_bpStepsWriteReadKokkos adios2::cxx11_mpi MPI::MPI_CXX Kokkos::kokkos) else() target_link_libraries(adios2_hello_bpStepsWriteReadKokkos adios2::cxx11 Kokkos::kokkos) endif() @@ -59,7 +59,7 @@ install(TARGETS adios2_hello_bpStepsWriteReadKokkos RUNTIME DESTINATION ${CMAKE_ add_executable(adios2_hello_bpWriteReadKokkosView bpWriteReadKokkosView.cpp) kokkos_compilation(SOURCE bpStepsWriteReadKokkos.cpp) if(ADIOS2_HAVE_MPI) - target_link_libraries(adios2_hello_bpWriteReadKokkosView adios2::cxx11_mpi MPI::MPI_C Kokkos::kokkos) + target_link_libraries(adios2_hello_bpWriteReadKokkosView adios2::cxx11_mpi MPI::MPI_CXX Kokkos::kokkos) else() target_link_libraries(adios2_hello_bpWriteReadKokkosView adios2::cxx11 Kokkos::kokkos) endif() diff --git a/examples/hello/bpWriter/CMakeLists.txt b/examples/hello/bpWriter/CMakeLists.txt index 9eb0fbf91a..aaecb332a9 100644 --- a/examples/hello/bpWriter/CMakeLists.txt +++ b/examples/hello/bpWriter/CMakeLists.txt @@ -54,7 +54,7 @@ endif() if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_bpWriter_mpi bpWriter.cpp) - target_link_libraries(adios2_hello_bpWriter_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpWriter_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpWriter_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_bpWriter_c_mpi bpWriter.c) @@ -62,11 +62,11 @@ if(ADIOS2_HAVE_MPI) install(TARGETS adios2_hello_bpWriter_c_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_bpPutDeferred_mpi bpPutDeferred.cpp) - target_link_libraries(adios2_hello_bpPutDeferred_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpPutDeferred_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpPutDeferred_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_bpSubStreams_mpi bpSubStreams.cpp) - target_link_libraries(adios2_hello_bpSubStreams_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_bpSubStreams_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_bpSubStreams_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) if(ADIOS2_HAVE_Fortran) diff --git a/examples/hello/datamanKokkos/CMakeLists.txt b/examples/hello/datamanKokkos/CMakeLists.txt index 9bbe1a2a3e..3767eb09f7 100644 --- a/examples/hello/datamanKokkos/CMakeLists.txt +++ b/examples/hello/datamanKokkos/CMakeLists.txt @@ -33,10 +33,10 @@ endif() if(ADIOS2_HAVE_MPI AND ADIOS2_HAVE_DataMan) add_executable(adios2_hello_datamanWriterKokkos dataManWriterKokkos.cpp) - target_link_libraries(adios2_hello_datamanWriterKokkos adios2::cxx11_mpi MPI::MPI_C Kokkos::kokkos) + target_link_libraries(adios2_hello_datamanWriterKokkos adios2::cxx11_mpi MPI::MPI_CXX Kokkos::kokkos) install(TARGETS adios2_hello_datamanWriterKokkos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_datamanReaderKokkos dataManReaderKokkos.cpp) - target_link_libraries(adios2_hello_datamanReaderKokkos adios2::cxx11_mpi MPI::MPI_C Kokkos::kokkos) + target_link_libraries(adios2_hello_datamanReaderKokkos adios2::cxx11_mpi MPI::MPI_CXX Kokkos::kokkos) install(TARGETS adios2_hello_datamanReaderKokkos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/datamanReader/CMakeLists.txt b/examples/hello/datamanReader/CMakeLists.txt index 656bacefac..37b8cc7048 100644 --- a/examples/hello/datamanReader/CMakeLists.txt +++ b/examples/hello/datamanReader/CMakeLists.txt @@ -24,7 +24,7 @@ endif() if(ADIOS2_HAVE_MPI AND ADIOS2_HAVE_DataMan) add_executable(adios2_hello_datamanReader dataManReader.cpp) - target_link_libraries(adios2_hello_datamanReader adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_datamanReader adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_datamanReader RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/datamanWriter/CMakeLists.txt b/examples/hello/datamanWriter/CMakeLists.txt index 0bc0789ac6..6838043094 100644 --- a/examples/hello/datamanWriter/CMakeLists.txt +++ b/examples/hello/datamanWriter/CMakeLists.txt @@ -24,6 +24,6 @@ endif() if(ADIOS2_HAVE_MPI AND ADIOS2_HAVE_DataMan) add_executable(adios2_hello_datamanWriter dataManWriter.cpp) - target_link_libraries(adios2_hello_datamanWriter adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_datamanWriter adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_datamanWriter RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/dataspacesReader/CMakeLists.txt b/examples/hello/dataspacesReader/CMakeLists.txt index 11e8e3ff13..3ac686a273 100644 --- a/examples/hello/dataspacesReader/CMakeLists.txt +++ b/examples/hello/dataspacesReader/CMakeLists.txt @@ -29,7 +29,7 @@ if(ADIOS2_HAVE_DataSpaces) if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_dataSpacesReader_mpi dataSpacesReader.cpp) - target_link_libraries(adios2_hello_dataSpacesReader_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_dataSpacesReader_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_dataSpacesReader_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() endif() diff --git a/examples/hello/dataspacesWriter/CMakeLists.txt b/examples/hello/dataspacesWriter/CMakeLists.txt index 32a1bb4673..abfad5abd1 100644 --- a/examples/hello/dataspacesWriter/CMakeLists.txt +++ b/examples/hello/dataspacesWriter/CMakeLists.txt @@ -29,7 +29,7 @@ if(ADIOS2_HAVE_DataSpaces) if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_dataSpacesWriter_mpi dataSpacesWriter.cpp) - target_link_libraries(adios2_hello_dataSpacesWriter_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_dataSpacesWriter_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_dataSpacesWriter_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() endif() diff --git a/examples/hello/hdf5Reader/CMakeLists.txt b/examples/hello/hdf5Reader/CMakeLists.txt index ebfcb9ad7b..9555e64e46 100644 --- a/examples/hello/hdf5Reader/CMakeLists.txt +++ b/examples/hello/hdf5Reader/CMakeLists.txt @@ -29,7 +29,7 @@ if(ADIOS2_HAVE_HDF5) if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_hdf5Reader_mpi hdf5Reader.cpp) - target_link_libraries(adios2_hello_hdf5Reader_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_hdf5Reader_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_hdf5Reader_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() endif() diff --git a/examples/hello/hdf5SubFile/CMakeLists.txt b/examples/hello/hdf5SubFile/CMakeLists.txt index 81e494fa1b..ee4d9c895b 100644 --- a/examples/hello/hdf5SubFile/CMakeLists.txt +++ b/examples/hello/hdf5SubFile/CMakeLists.txt @@ -24,7 +24,7 @@ endif() if(ADIOS2_HAVE_MPI AND ADIOS2_HAVE_HDF5 AND HDF5_VERSION VERSION_GREATER_EQUAL 1.14) add_executable(adios2_hello_hdf5Subfile hdf5SubFile.cpp) - target_link_libraries(adios2_hello_hdf5Subfile adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_hdf5Subfile adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_hdf5Subfile RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/hdf5Writer/CMakeLists.txt b/examples/hello/hdf5Writer/CMakeLists.txt index b1fd2bcdcf..ba370ad4c0 100644 --- a/examples/hello/hdf5Writer/CMakeLists.txt +++ b/examples/hello/hdf5Writer/CMakeLists.txt @@ -29,7 +29,7 @@ if(ADIOS2_HAVE_HDF5) if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_hdf5Writer_mpi hdf5Writer.cpp) - target_link_libraries(adios2_hello_hdf5Writer_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_hdf5Writer_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_hdf5Writer_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() endif() diff --git a/examples/hello/helloWorld/CMakeLists.txt b/examples/hello/helloWorld/CMakeLists.txt index 416d0d5b26..14b538078f 100644 --- a/examples/hello/helloWorld/CMakeLists.txt +++ b/examples/hello/helloWorld/CMakeLists.txt @@ -38,10 +38,10 @@ if(ADIOS2_HAVE_MPI) install(TARGETS adios2_hello_helloWorld_c_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_helloWorld_mpi hello-world.cpp) - target_link_libraries(adios2_hello_helloWorld_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_helloWorld_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_helloWorld_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_helloWorld_hl_mpi hello-world-hl.cpp) - target_link_libraries(adios2_hello_helloWorld_hl_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_helloWorld_hl_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_helloWorld_hl_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/inlineReaderWriter/CMakeLists.txt b/examples/hello/inlineReaderWriter/CMakeLists.txt index cf76d4d0e6..faff3f5fc3 100644 --- a/examples/hello/inlineReaderWriter/CMakeLists.txt +++ b/examples/hello/inlineReaderWriter/CMakeLists.txt @@ -26,6 +26,6 @@ install(TARGETS adios2_hello_inlineReaderWriter RUNTIME DESTINATION ${CMAKE_INST if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_inlineReaderWriter_mpi inlineReaderWriter.cpp) - target_link_libraries(adios2_hello_inlineReaderWriter_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_inlineReaderWriter_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_inlineReaderWriter_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/skeleton/CMakeLists.txt b/examples/hello/skeleton/CMakeLists.txt index 4c6ead50ab..5827eb084c 100644 --- a/examples/hello/skeleton/CMakeLists.txt +++ b/examples/hello/skeleton/CMakeLists.txt @@ -30,10 +30,10 @@ install(TARGETS adios2_hello_skeletonReader RUNTIME DESTINATION ${CMAKE_INSTALL_ if(ADIOS2_HAVE_MPI) add_executable(adios2_hello_skeletonWriter_mpi skeletonWriter.cpp SkeletonArgs.cpp) - target_link_libraries(adios2_hello_skeletonWriter_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_skeletonWriter_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_skeletonWriter_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_hello_skeletonReader_mpi skeletonReader.cpp SkeletonArgs.cpp) - target_link_libraries(adios2_hello_skeletonReader_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_skeletonReader_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_hello_skeletonReader_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/hello/sstReader/CMakeLists.txt b/examples/hello/sstReader/CMakeLists.txt index be46aab22c..e9426aeded 100644 --- a/examples/hello/sstReader/CMakeLists.txt +++ b/examples/hello/sstReader/CMakeLists.txt @@ -27,7 +27,7 @@ endif() if(ADIOS2_HAVE_SST) add_executable(adios2_hello_sstReader sstReader.cpp) if(ADIOS2_HAVE_MPI) - target_link_libraries(adios2_hello_sstReader adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_sstReader adios2::cxx11_mpi MPI::MPI_CXX) else() target_link_libraries(adios2_hello_sstReader adios2::cxx11) endif() diff --git a/examples/hello/sstWriter/CMakeLists.txt b/examples/hello/sstWriter/CMakeLists.txt index 3636ddd5c7..b887bcd2e2 100644 --- a/examples/hello/sstWriter/CMakeLists.txt +++ b/examples/hello/sstWriter/CMakeLists.txt @@ -27,7 +27,7 @@ endif() if(ADIOS2_HAVE_SST) add_executable(adios2_hello_sstWriter sstWriter.cpp) if(ADIOS2_HAVE_MPI) - target_link_libraries(adios2_hello_sstWriter adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_hello_sstWriter adios2::cxx11_mpi MPI::MPI_CXX) else() target_link_libraries(adios2_hello_sstWriter adios2::cxx11) endif() diff --git a/examples/simulations/gray-scott-kokkos/CMakeLists.txt b/examples/simulations/gray-scott-kokkos/CMakeLists.txt index b43362cf3f..989f4174eb 100644 --- a/examples/simulations/gray-scott-kokkos/CMakeLists.txt +++ b/examples/simulations/gray-scott-kokkos/CMakeLists.txt @@ -42,6 +42,6 @@ if(ADIOS2_HAVE_MPI AND ADIOS2_HAVE_Kokkos) restart.cpp ) kokkos_compilation(SOURCE gray-scott.cpp) - target_link_libraries(adios2_simulations_gray-scott-kokkos adios2::cxx11_mpi MPI::MPI_C Kokkos::kokkos) + target_link_libraries(adios2_simulations_gray-scott-kokkos adios2::cxx11_mpi MPI::MPI_CXX Kokkos::kokkos) install(TARGETS adios2_simulations_gray-scott-kokkos RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/simulations/gray-scott-struct/CMakeLists.txt b/examples/simulations/gray-scott-struct/CMakeLists.txt index 5d67c49447..761401a484 100644 --- a/examples/simulations/gray-scott-struct/CMakeLists.txt +++ b/examples/simulations/gray-scott-struct/CMakeLists.txt @@ -28,11 +28,11 @@ if(ADIOS2_HAVE_MPI) simulation/writer.cpp simulation/restart.cpp ) - target_link_libraries(adios2_simulations_gray-scott-struct adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_simulations_gray-scott-struct adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_simulations_gray-scott-struct RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_simulations_gray-scott-struct_pdf-calc analysis/pdf-calc.cpp) - target_link_libraries(adios2_simulations_gray-scott-struct_pdf-calc adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_simulations_gray-scott-struct_pdf-calc adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_simulations_gray-scott-struct_pdf-calc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES "adios2.xml" "adios2-inline-plugin.xml" diff --git a/examples/simulations/gray-scott/CMakeLists.txt b/examples/simulations/gray-scott/CMakeLists.txt index c39444698a..4d8789db7c 100644 --- a/examples/simulations/gray-scott/CMakeLists.txt +++ b/examples/simulations/gray-scott/CMakeLists.txt @@ -28,11 +28,11 @@ if(ADIOS2_HAVE_MPI) simulation/writer.cpp simulation/restart.cpp ) - target_link_libraries(adios2_simulations_gray-scott adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_simulations_gray-scott adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_simulations_gray-scott RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_simulations_gray-scott_pdf-calc analysis/pdf-calc.cpp) - target_link_libraries(adios2_simulations_gray-scott_pdf-calc adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_simulations_gray-scott_pdf-calc adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_simulations_gray-scott_pdf-calc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES "adios2.xml" "adios2-inline-plugin.xml" diff --git a/examples/simulations/heatTransfer/inline/CMakeLists.txt b/examples/simulations/heatTransfer/inline/CMakeLists.txt index 4e41311ce9..409697788c 100644 --- a/examples/simulations/heatTransfer/inline/CMakeLists.txt +++ b/examples/simulations/heatTransfer/inline/CMakeLists.txt @@ -29,6 +29,6 @@ if(ADIOS2_HAVE_MPI AND Threads_FOUND) ../write/HeatTransfer.cpp ../write/Settings.cpp ) - target_link_libraries(adios2_simulations_heatTransferInline adios2::cxx11_mpi MPI::MPI_C ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(adios2_simulations_heatTransferInline adios2::cxx11_mpi MPI::MPI_CXX ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS adios2_simulations_heatTransferInline RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/simulations/heatTransfer/read/CMakeLists.txt b/examples/simulations/heatTransfer/read/CMakeLists.txt index fcc241a2fe..588f2ed47e 100644 --- a/examples/simulations/heatTransfer/read/CMakeLists.txt +++ b/examples/simulations/heatTransfer/read/CMakeLists.txt @@ -26,6 +26,6 @@ if(ADIOS2_HAVE_MPI) PrintDataStep.h ReadSettings.cpp ) - target_link_libraries(adios2_simulations_heatTransferRead adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_simulations_heatTransferRead adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_simulations_heatTransferRead RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/examples/simulations/heatTransfer/readFileOnly/CMakeLists.txt b/examples/simulations/heatTransfer/readFileOnly/CMakeLists.txt index 5cb5dd3c4d..20717776c8 100644 --- a/examples/simulations/heatTransfer/readFileOnly/CMakeLists.txt +++ b/examples/simulations/heatTransfer/readFileOnly/CMakeLists.txt @@ -22,6 +22,6 @@ endif() if(ADIOS2_HAVE_MPI) add_executable(adios2_simulations_heatTransferReadFileOnly heatReadFileOnly.cpp PrintData.h) - target_link_libraries(adios2_simulations_heatTransferReadFileOnly adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_simulations_heatTransferReadFileOnly adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_simulations_heatTransferReadFileOnly RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif () diff --git a/examples/simulations/heatTransfer/write/CMakeLists.txt b/examples/simulations/heatTransfer/write/CMakeLists.txt index 7f1378c982..573bd8c67f 100644 --- a/examples/simulations/heatTransfer/write/CMakeLists.txt +++ b/examples/simulations/heatTransfer/write/CMakeLists.txt @@ -29,7 +29,7 @@ if (ADIOS2_HAVE_MPI AND Threads_FOUND) Settings.cpp IO_adios2.cpp ) - target_link_libraries(adios2_simulations_heatTransferWrite adios2::cxx11_mpi MPI::MPI_C ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(adios2_simulations_heatTransferWrite adios2::cxx11_mpi MPI::MPI_CXX ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS adios2_simulations_heatTransferWrite RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_simulations_heatTransferWrite_ascii @@ -38,7 +38,7 @@ if (ADIOS2_HAVE_MPI AND Threads_FOUND) Settings.cpp IO_ascii.cpp ) - target_link_libraries(adios2_simulations_heatTransferWrite_ascii MPI::MPI_C ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(adios2_simulations_heatTransferWrite_ascii MPI::MPI_CXX ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS adios2_simulations_heatTransferWrite_ascii RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) if(ADIOS2_HAVE_HDF5) @@ -50,7 +50,7 @@ if (ADIOS2_HAVE_MPI AND Threads_FOUND) ) target_include_directories(adios2_simulations_heatTransferWrite_hdf5 PRIVATE ${HDF5_C_INCLUDE_DIRS}) target_link_libraries(adios2_simulations_heatTransferWrite_hdf5 - ${HDF5_C_LIBRARIES} MPI::MPI_C ${CMAKE_THREAD_LIBS_INIT}) + ${HDF5_C_LIBRARIES} MPI::MPI_CXX ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS adios2_simulations_heatTransferWrite_hdf5 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) if(HDF5_IS_PARALLEL) @@ -62,7 +62,7 @@ if (ADIOS2_HAVE_MPI AND Threads_FOUND) ) target_include_directories(adios2_simulations_heatTransferWrite_ph5 PRIVATE ${HDF5_C_INCLUDE_DIRS}) target_link_libraries(adios2_simulations_heatTransferWrite_ph5 - ${HDF5_C_LIBRARIES} MPI::MPI_C ${CMAKE_THREAD_LIBS_INIT}) + ${HDF5_C_LIBRARIES} MPI::MPI_CXX ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS adios2_simulations_heatTransferWrite_ph5 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() @@ -74,7 +74,7 @@ if (ADIOS2_HAVE_MPI AND Threads_FOUND) IO_h5mixer.cpp ) target_link_libraries(adios2_simulations_heatTransferWrite_h5mixer - adios2::cxx11_mpi MPI::MPI_C ${CMAKE_THREAD_LIBS_INIT}) + adios2::cxx11_mpi MPI::MPI_CXX ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS adios2_simulations_heatTransferWrite_h5mixer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() endif() diff --git a/examples/useCases/insituGlobalArrays/CMakeLists.txt b/examples/useCases/insituGlobalArrays/CMakeLists.txt index 281c687b7e..e903b34655 100644 --- a/examples/useCases/insituGlobalArrays/CMakeLists.txt +++ b/examples/useCases/insituGlobalArrays/CMakeLists.txt @@ -31,10 +31,10 @@ install(TARGETS adios2_useCases_insituGlobalArraysReaderNxN RUNTIME DESTINATION if(ADIOS2_HAVE_MPI) add_executable(adios2_useCases_insituGlobalArraysWriter_mpi insituGlobalArraysWriter.cpp) - target_link_libraries(adios2_useCases_insituGlobalArraysWriter_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_useCases_insituGlobalArraysWriter_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_useCases_insituGlobalArraysWriter_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(adios2_useCases_insituGlobalArraysReaderNxN_mpi insituGlobalArraysReaderNxN.cpp) - target_link_libraries(adios2_useCases_insituGlobalArraysReaderNxN_mpi adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(adios2_useCases_insituGlobalArraysReaderNxN_mpi adios2::cxx11_mpi MPI::MPI_CXX) install(TARGETS adios2_useCases_insituGlobalArraysReaderNxN_mpi RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/source/adios2/CMakeLists.txt b/source/adios2/CMakeLists.txt index 6e810c300b..e49900d208 100644 --- a/source/adios2/CMakeLists.txt +++ b/source/adios2/CMakeLists.txt @@ -290,8 +290,12 @@ if(ADIOS2_HAVE_MPI) ) set_property(TARGET adios2_core_mpi PROPERTY EXPORT_NAME core_mpi) set_property(TARGET adios2_core_mpi PROPERTY OUTPUT_NAME adios2${ADIOS2_LIBRARY_SUFFIX}_core_mpi) - target_link_libraries(adios2_core_mpi PUBLIC adios2_core MPI::MPI_C PRIVATE adios2::thirdparty::perfstubs-interface) + target_link_libraries(adios2_core_mpi PUBLIC adios2_core MPI::MPI_CXX PRIVATE adios2::thirdparty::perfstubs-interface) target_compile_definitions(adios2_core_mpi PUBLIC "$") + + add_library(adios2_core_mpi_c INTERFACE) + set_property(TARGET adios2_core_mpi_c PROPERTY EXPORT_NAME core_mpi_c) + target_link_libraries(adios2_core_mpi_c INTERFACE adios2_core_mpi MPI::MPI_C) endif() if(ADIOS2_HAVE_SysVShMem) @@ -427,7 +431,7 @@ if(ADIOS2_HAVE_HDF5) foreach(lib IN LISTS adios2_hdf5_objs) target_link_libraries(${lib} PRIVATE ${HDF5_C_LIBRARIES}) if(HDF5_IS_PARALLEL) - target_link_libraries(${lib} PRIVATE $) + target_link_libraries(${lib} PRIVATE $) endif() if(BUILD_SHARED_LIBS) set_property(TARGET ${lib} PROPERTY POSITION_INDEPENDENT_CODE 1) @@ -468,7 +472,7 @@ endif() if(ADIOS2_HAVE_MPI) set(maybe_adios2_c_mpi adios2_c_mpi) set(maybe_adios2_cxx11_mpi adios2_cxx11_mpi) - set(maybe_adios2_core_mpi adios2_core_mpi) + set(maybe_adios2_core_mpi adios2_core_mpi adios2_core_mpi_c) else() set(maybe_adios2_c_mpi) set(maybe_adios2_cxx11_mpi) diff --git a/source/utils/adios_iotest/CMakeLists.txt b/source/utils/adios_iotest/CMakeLists.txt index 1eeba20f5a..5cf7312a6d 100644 --- a/source/utils/adios_iotest/CMakeLists.txt +++ b/source/utils/adios_iotest/CMakeLists.txt @@ -8,7 +8,7 @@ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/iotest-config ) add_executable(adios_iotest settings.cpp decomp.cpp processConfig.cpp ioGroup.cpp stream.cpp adiosStream.cpp adios_iotest.cpp) -target_link_libraries(adios_iotest adios2::cxx11_mpi MPI::MPI_C adios2_core_mpi) +target_link_libraries(adios_iotest adios2::cxx11_mpi MPI::MPI_CXX adios2_core_mpi) if(WIN32) target_link_libraries(adios_iotest getopt) endif() diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index c2292d2809..f92421d744 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -82,7 +82,7 @@ function(gtest_add_tests_helper testname mpi src_pfx tst_pfx tst_sfx) if(NOT TARGET ${tgt}) add_executable(${tgt} Test${src_pfx}${testname}.cpp) - target_link_libraries(${tgt} adios2::cxx11_mpi adios2::c_mpi adios2_core_mpi MPI::MPI_C adios2::thirdparty::gtest) + target_link_libraries(${tgt} adios2::cxx11_mpi adios2::c_mpi adios2_core_mpi MPI::MPI_CXX adios2::thirdparty::gtest) endif() gtest_add_tests(TARGET ${tgt} diff --git a/testing/adios2/bindings/fortran/CMakeLists.txt b/testing/adios2/bindings/fortran/CMakeLists.txt index f1664f3d1f..0cdec63b85 100644 --- a/testing/adios2/bindings/fortran/CMakeLists.txt +++ b/testing/adios2/bindings/fortran/CMakeLists.txt @@ -73,7 +73,7 @@ if(ADIOS2_HAVE_MPI) TestF2C_BPReadFBlocks.cpp ) target_link_libraries(Test.Bindings.Fortran.F2C.BPReadFBlocks - adios2 adios2::thirdparty::gtest MPI::MPI_C + adios2 adios2::thirdparty::gtest MPI::MPI_CXX ) add_test(NAME Bindings.Fortran.F2C.BPReadFBlocks COMMAND diff --git a/testing/adios2/engine/common/CMakeLists.txt b/testing/adios2/engine/common/CMakeLists.txt index e19392d424..a8ce07e3f0 100644 --- a/testing/adios2/engine/common/CMakeLists.txt +++ b/testing/adios2/engine/common/CMakeLists.txt @@ -8,7 +8,7 @@ find_package(Threads REQUIRED) add_executable(Test.Engine.Common.MPI TestEngineCommon.cpp) target_link_libraries(Test.Engine.Common.MPI PRIVATE adios2::cxx11_mpi - MPI::MPI_C + MPI::MPI_CXX adios2::thirdparty::gtest ${CMAKE_THREAD_LIBS_INIT} ) diff --git a/testing/adios2/engine/skeleton/CMakeLists.txt b/testing/adios2/engine/skeleton/CMakeLists.txt index 366f4de5e5..0b8def456c 100644 --- a/testing/adios2/engine/skeleton/CMakeLists.txt +++ b/testing/adios2/engine/skeleton/CMakeLists.txt @@ -10,8 +10,8 @@ add_executable(Test.Engine.Skeleton.Writer TestSkeletonWriter.cpp) add_executable(Test.Engine.Skeleton.Reader TestSkeletonReader.cpp) if(ADIOS2_HAVE_MPI) - target_link_libraries(Test.Engine.Skeleton.Writer adios2::cxx11_mpi MPI::MPI_C) - target_link_libraries(Test.Engine.Skeleton.Reader adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(Test.Engine.Skeleton.Writer adios2::cxx11_mpi MPI::MPI_CXX) + target_link_libraries(Test.Engine.Skeleton.Reader adios2::cxx11_mpi MPI::MPI_CXX) set(cmd_executor ${MPIEXEC_EXECUTABLE} ${MPIEXEC_EXTRA_FLAGS} ${MPIEXEC_NUMPROC_FLAG} 1 ) diff --git a/testing/adios2/engine/staging-common/CMakeLists.txt b/testing/adios2/engine/staging-common/CMakeLists.txt index ee20d68b8c..4de98f20d8 100644 --- a/testing/adios2/engine/staging-common/CMakeLists.txt +++ b/testing/adios2/engine/staging-common/CMakeLists.txt @@ -51,7 +51,7 @@ foreach(helper ${PROGS} ) target_link_libraries(${helper} adios2::thirdparty::gtest ${Sst_LIBRARY}) if(ADIOS2_HAVE_MPI) - target_link_libraries(${helper} adios2::cxx11_mpi adios2_core_mpi MPI::MPI_C) + target_link_libraries(${helper} adios2::cxx11_mpi adios2_core_mpi MPI::MPI_CXX) else() target_link_libraries(${helper} adios2::cxx11 adios2_core) endif() diff --git a/testing/adios2/performance/metadata/CMakeLists.txt b/testing/adios2/performance/metadata/CMakeLists.txt index d0a3661800..fcd432a404 100644 --- a/testing/adios2/performance/metadata/CMakeLists.txt +++ b/testing/adios2/performance/metadata/CMakeLists.txt @@ -6,5 +6,5 @@ if(ADIOS2_HAVE_MPI) # just for executing manually for performance studies add_executable(PerfMetaData PerfMetaData.cpp) - target_link_libraries(PerfMetaData adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(PerfMetaData adios2::cxx11_mpi MPI::MPI_CXX) endif() diff --git a/testing/install/CXX11/CMakeLists.txt b/testing/install/CXX11/CMakeLists.txt index 7a01b6b252..4a7e335158 100644 --- a/testing/install/CXX11/CMakeLists.txt +++ b/testing/install/CXX11/CMakeLists.txt @@ -15,11 +15,8 @@ target_link_libraries(adios_cxx11_test adios2::cxx11) add_test(NAME adios_cxx11_test COMMAND adios_cxx11_test) if(ADIOS2_HAVE_MPI) - # Avoid using MPI::MPI_CXX - enable_language(C) - find_package(MPI REQUIRED) - set(mpilib MPI::MPI_C) + set(mpilib MPI::MPI_CXX) set(src main_mpi.cxx) set(mpiexec ${MPIEXEC_EXECUTABLE} ${MPIEXEC_EXTRA_FLAGS}) add_compile_definitions(OMPI_SKIP_MPICXX MPICH_SKIP_MPICXX) diff --git a/testing/utils/changingshape/CMakeLists.txt b/testing/utils/changingshape/CMakeLists.txt index ce76aa3aa4..d479af7b79 100644 --- a/testing/utils/changingshape/CMakeLists.txt +++ b/testing/utils/changingshape/CMakeLists.txt @@ -8,7 +8,7 @@ include(ADIOSFunctions) add_executable(Test.Utils.ChangingShape TestUtilsChangingShape.cpp) if(ADIOS2_HAVE_MPI) - target_link_libraries(Test.Utils.ChangingShape adios2::cxx11_mpi MPI::MPI_C) + target_link_libraries(Test.Utils.ChangingShape adios2::cxx11_mpi MPI::MPI_CXX) set(cmd_executor ${MPIEXEC_COMMAND} ${MPIEXEC_NUMPROC_FLAG} 1) else() target_link_libraries(Test.Utils.ChangingShape adios2::cxx11)