diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6c446bdb1b..7269fc5c9b 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -245,13 +245,14 @@ else() endif() if(BUILD_MPI) + # do not include the (obsolete) MPI C++ bindings which makes + # for leaner object files and avoids namespace conflicts + set(MPI_CXX_SKIP_MPICXX TRUE) # We use a non-standard procedure to cross-compile with MPI on Windows if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING) - set(MPI_CXX_SKIP_MPICXX TRUE) include(MPI4WIN) target_link_libraries(lammps PUBLIC MPI::MPI_CXX) else() - set(MPI_CXX_SKIP_MPICXX TRUE) find_package(MPI REQUIRED) target_link_libraries(lammps PUBLIC MPI::MPI_CXX) option(LAMMPS_LONGLONG_TO_LONG "Workaround if your system or MPI version does not recognize 'long long' data types" OFF)