diff --git a/CMakeLists.txt b/CMakeLists.txt index 24cbfe29..a48cfb04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -335,14 +335,10 @@ if (USE_PYTHON) endif (USE_PYTHON) ####################################################################### -add_library(netgen_mpi INTERFACE) add_library(netgen_metis INTERFACE) if (USE_MPI) set(MPI_DETERMINE_LIBRARY_VERSION TRUE) find_package(MPI REQUIRED) - target_include_directories(netgen_mpi INTERFACE ${MPI_CXX_INCLUDE_PATH}) - target_link_libraries(netgen_mpi INTERFACE ${MPI_mpi_LIBRARY} ${MPI_CXX_LIBRARIES} ) - target_compile_definitions(netgen_mpi INTERFACE PARALLEL ) find_package(METIS REQUIRED) target_include_directories(netgen_metis INTERFACE ${METIS_INCLUDE_DIR}) @@ -357,7 +353,7 @@ if (USE_MPI) message(STATUS "Found mpi4py: ${MPI4PY_INCLUDE_DIR}") endif(USE_MPI4PY AND USE_PYTHON) endif (USE_MPI) -install(TARGETS netgen_mpi netgen_metis ${NG_INSTALL_DIR}) +install(TARGETS netgen_metis ${NG_INSTALL_DIR}) ####################################################################### add_library(occ_libs INTERFACE IMPORTED) diff --git a/libsrc/core/CMakeLists.txt b/libsrc/core/CMakeLists.txt index d6966117..cdf3642d 100644 --- a/libsrc/core/CMakeLists.txt +++ b/libsrc/core/CMakeLists.txt @@ -141,6 +141,10 @@ if(USE_MPI) set(MPICH_INCLUDE_DIR ${MPI_C_INCLUDE_PATH}) endif() + if(MPI_C_LIBRARY_VERSION_STRING MATCHES "Intel.*") + set(INTEL_MPI_INCLUDE_DIR ${MPI_C_INCLUDE_PATH}) + endif() + if(OPENMPI_INCLUDE_DIR) build_mpi_variant(openmpi ${OPENMPI_INCLUDE_DIR}) endif() diff --git a/libsrc/core/ng_mpi_wrapper.cpp b/libsrc/core/ng_mpi_wrapper.cpp index 208fb69d..f1c8b9f2 100644 --- a/libsrc/core/ng_mpi_wrapper.cpp +++ b/libsrc/core/ng_mpi_wrapper.cpp @@ -72,8 +72,10 @@ void InitMPI(std::optional mpi_lib_path) { vendor = "Open MPI"; else if (version.substr(0, 5) == "MPICH") vendor = "MPICH"; - else if (version.substr(0, 5) == "Microsoft MPI") + else if (version.substr(0, 13) == "Microsoft MPI") vendor = "Microsoft MPI"; + else if (version.substr(0, 12) == "Intel(R) MPI") + vendor = "Intel MPI"; else throw std::runtime_error( std::string("Unknown MPI version: " + version)); @@ -102,7 +104,9 @@ void InitMPI(std::optional mpi_lib_path) { else if (vendor == "MPICH") ng_lib_name = "ng_mpich"; else if (vendor == "Microsoft MPI") - ng_lib_name = "ng_msmpi"; + ng_lib_name = "ng_microsoft_mpi"; + else if (vendor == "Intel MPI") + ng_lib_name = "ng_intel_mpi"; else throw std::runtime_error("Unknown MPI vendor: " + vendor); diff --git a/ng/CMakeLists.txt b/ng/CMakeLists.txt index 2acecf34..b5a1985b 100644 --- a/ng/CMakeLists.txt +++ b/ng/CMakeLists.txt @@ -37,7 +37,7 @@ endif(USE_GUI) if(USE_PYTHON) add_library(ngpy SHARED netgenpy.cpp) target_link_libraries( ngpy PUBLIC nglib PRIVATE "$" ) - target_link_libraries( ngpy PRIVATE ${MPI_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns ) + target_link_libraries( ngpy PRIVATE ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns ) if(APPLE) set_target_properties( ngpy PROPERTIES SUFFIX ".so") elseif(WIN32) diff --git a/nglib/CMakeLists.txt b/nglib/CMakeLists.txt index b1036ea1..aa9c101b 100644 --- a/nglib/CMakeLists.txt +++ b/nglib/CMakeLists.txt @@ -11,7 +11,7 @@ if(EMSCRIPTEN) target_include_directories(nglib PUBLIC $) else(EMSCRIPTEN) target_link_libraries(nglib PUBLIC ngcore) - target_link_libraries( nglib PRIVATE ${MPI_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns ) + target_link_libraries( nglib PRIVATE ${CMAKE_THREAD_LIBS_INIT} ${JPEG_LIBRARIES} ${MKL_LIBRARIES} ${ZLIB_LIBRARIES} occ_libs netgen_cgns ) endif(EMSCRIPTEN) install(TARGETS nglib netgen_cgns ${NG_INSTALL_DIR})