Skip to content

Commit

Permalink
cmake: use MPI_CXX for targets of CXX sources
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Jul 22, 2024
1 parent a338ecf commit 3665b46
Show file tree
Hide file tree
Showing 54 changed files with 78 additions and 84 deletions.
2 changes: 1 addition & 1 deletion bindings/C/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion bindings/CXX11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions bindings/Fortran/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/DetectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 <chrono>
Expand Down
7 changes: 0 additions & 7 deletions cmake/adios2-config-common.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmake/install/post/adios2-config-dummy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/source/faq/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/source/setting_up/linking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion examples/basics/globalArrayND/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/basics/joinedArray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/basics/localArray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/basics/queryWorker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

2 changes: 1 addition & 1 deletion examples/basics/values/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions examples/basics/variablesShapes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/campaign/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/hello/bpAttributeWriteRead/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions examples/hello/bpFWriteCRead/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/hello/bpFlushWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/hello/bpOperatorSZWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
6 changes: 3 additions & 3 deletions examples/hello/bpReader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion examples/hello/bpStepsWriteRead/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions examples/hello/bpStepsWriteReadKokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions examples/hello/bpWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ 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)
target_link_libraries(adios2_hello_bpWriter_c_mpi adios2::c_mpi MPI::MPI_C)
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)
Expand Down
4 changes: 2 additions & 2 deletions examples/hello/datamanKokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/hello/datamanReader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

2 changes: 1 addition & 1 deletion examples/hello/datamanWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/hello/dataspacesReader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/hello/dataspacesWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/hello/hdf5Reader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/hello/hdf5SubFile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

2 changes: 1 addition & 1 deletion examples/hello/hdf5Writer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions examples/hello/helloWorld/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion examples/hello/inlineReaderWriter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions examples/hello/skeleton/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Loading

0 comments on commit 3665b46

Please sign in to comment.