Skip to content

Commit

Permalink
CMAKE: Remove unneeded MPI_CXX dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Vicente Adolfo Bolea Sanchez <[email protected]>
  • Loading branch information
vicentebolea committed Jul 8, 2021
1 parent 53b5d8b commit 2667f44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bindings/CXX11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,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_CXX)
target_link_libraries(adios2_cxx11_mpi PUBLIC adios2_cxx11 PRIVATE adios2_core_mpi PUBLIC MPI::MPI_C)
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
6 changes: 5 additions & 1 deletion testing/install/CXX11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ 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(src main_mpi.cxx)
set(mpilib MPI::MPI_CXX)
set(mpiexec ${MPIEXEC_EXECUTABLE} ${MPIEXEC_EXTRA_FLAGS})
add_compile_definitions(OMPI_SKIP_MPICXX MPICH_SKIP_MPICXX)

# Test using mpi C++11 bindings through adios2::cxx11_mpi target.
add_executable(adios_cxx11_mpi_test main_mpi.cxx)
Expand Down

0 comments on commit 2667f44

Please sign in to comment.