From f70200e5aa7c0996d41b93ff7d342f342824000c Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 28 May 2024 12:43:27 +0200 Subject: [PATCH] Don't include MPI cxx symbols properly --- libsrc/core/CMakeLists.txt | 2 +- libsrc/core/ng_mpi.cpp | 3 +-- libsrc/core/ng_mpi.hpp | 1 + libsrc/core/ng_mpi_native.hpp | 21 --------------------- libsrc/core/ng_mpi_wrapper.cpp | 1 - 5 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 libsrc/core/ng_mpi_native.hpp diff --git a/libsrc/core/CMakeLists.txt b/libsrc/core/CMakeLists.txt index 69245779..6b60875d 100644 --- a/libsrc/core/CMakeLists.txt +++ b/libsrc/core/CMakeLists.txt @@ -93,7 +93,7 @@ install(FILES ngcore.hpp archive.hpp type_traits.hpp version.hpp ngcore_api.hpp xbool.hpp signal.hpp bitarray.hpp table.hpp hashtable.hpp ranges.hpp ngstream.hpp simd.hpp simd_avx.hpp simd_avx512.hpp simd_generic.hpp simd_sse.hpp simd_arm64.hpp register_archive.hpp autodiff.hpp autodiffdiff.hpp - ng_mpi.hpp ng_mpi_generated_declarations.hpp ng_mpi_native.hpp mpi4py_pycapi.h + ng_mpi.hpp ng_mpi_generated_declarations.hpp mpi4py_pycapi.h DESTINATION ${NG_INSTALL_DIR_INCLUDE}/core COMPONENT netgen_devel) if(ENABLE_CPP_CORE_GUIDELINES_CHECK) diff --git a/libsrc/core/ng_mpi.cpp b/libsrc/core/ng_mpi.cpp index 0cb2847f..bac75e47 100644 --- a/libsrc/core/ng_mpi.cpp +++ b/libsrc/core/ng_mpi.cpp @@ -1,9 +1,8 @@ #define OMPI_SKIP_MPICXX +#include #include "ng_mpi.hpp" -#include - #include #include "array.hpp" diff --git a/libsrc/core/ng_mpi.hpp b/libsrc/core/ng_mpi.hpp index 9843a516..36151c09 100644 --- a/libsrc/core/ng_mpi.hpp +++ b/libsrc/core/ng_mpi.hpp @@ -10,6 +10,7 @@ #include "ngcore_api.hpp" #ifndef NG_MPI_WRAPPER +#define OMPI_SKIP_MPICXX #include #endif // NG_MPI_WRAPPER diff --git a/libsrc/core/ng_mpi_native.hpp b/libsrc/core/ng_mpi_native.hpp deleted file mode 100644 index 6c8f40ce..00000000 --- a/libsrc/core/ng_mpi_native.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef NG_MPI_NATIVE_HPP -#define NG_MPI_NATIVE_HPP - -#include - -#include "mpi_wrapper.hpp" -#include "ng_mpi.hpp" - -namespace ngcore { - -MPI_Comm NG_MPI_Native(NG_MPI_Comm comm) { - return reinterpret_cast(comm.value); -} - -MPI_Comm NG_MPI_Native(NgMPI_Comm comm) { - return reinterpret_cast(static_cast(comm).value); -} - -} // namespace ngcore - -#endif // NG_MPI_NATIVE_HPP diff --git a/libsrc/core/ng_mpi_wrapper.cpp b/libsrc/core/ng_mpi_wrapper.cpp index eedaf1b4..835b0c31 100644 --- a/libsrc/core/ng_mpi_wrapper.cpp +++ b/libsrc/core/ng_mpi_wrapper.cpp @@ -14,7 +14,6 @@ using std::cout; using std::endl; #ifndef NG_MPI_WRAPPER -#include #define MPI4PY_LIMITED_API 1 #define MPI4PY_LIMITED_API_SKIP_MESSAGE 1 #define MPI4PY_LIMITED_API_SKIP_SESSION 1