mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Revert "CMake uses FindMPI module for CMake v3.10+"
This reverts commit 3d28f5ccd3.
This commit is contained in:
parent
3d28f5ccd3
commit
a859c9ff19
1 changed files with 6 additions and 15 deletions
|
|
@ -29,16 +29,10 @@ option(dagmc "Enable support for DAGMC (CAD) geometry" OFF)
|
|||
# MPI for distributed-memory parallelism
|
||||
#===============================================================================
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.10)
|
||||
# This sets MPI_CXX_FOUND
|
||||
find_package(MPI COMPONENTS CXX)
|
||||
else()
|
||||
if(${CMAKE_CXX_COMPILER} MATCHES "(mpi[^/]*|CC)$")
|
||||
message(STATUS "Detected MPI wrapper: ${CMAKE_CXX_COMPILER}")
|
||||
set(MPI_CXX_FOUND TRUE)
|
||||
else()
|
||||
set(MPI_CXX_FOUND FALSE)
|
||||
endif()
|
||||
set(MPI_ENABLED FALSE)
|
||||
if(${CMAKE_CXX_COMPILER} MATCHES "(mpi[^/]*|CC)$")
|
||||
message(STATUS "Detected MPI wrapper: ${CMAKE_CXX_COMPILER}")
|
||||
set(MPI_ENABLED TRUE)
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
|
|
@ -67,7 +61,7 @@ endif()
|
|||
|
||||
find_package(HDF5 REQUIRED COMPONENTS C HL)
|
||||
if(HDF5_IS_PARALLEL)
|
||||
if(NOT MPI_CXX_FOUND)
|
||||
if(NOT MPI_ENABLED)
|
||||
message(FATAL_ERROR "Parallel HDF5 must be used with MPI.")
|
||||
endif()
|
||||
message(STATUS "Using parallel HDF5")
|
||||
|
|
@ -350,7 +344,7 @@ target_compile_options(libopenmc PRIVATE ${cxxflags})
|
|||
if (HDF5_IS_PARALLEL)
|
||||
target_compile_definitions(libopenmc PRIVATE -DPHDF5)
|
||||
endif()
|
||||
if (MPI_CXX_FOUND)
|
||||
if (MPI_ENABLED)
|
||||
target_compile_definitions(libopenmc PUBLIC -DOPENMC_MPI)
|
||||
endif()
|
||||
|
||||
|
|
@ -370,9 +364,6 @@ endif()
|
|||
# linker flags. Thus, we can pass both linker flags and libraries together.
|
||||
target_link_libraries(libopenmc ${ldflags} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}
|
||||
pugixml faddeeva xtensor gsl-lite-v1 fmt::fmt)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.10 AND MPI_CXX_FOUND)
|
||||
target_link_libraries(libopenmc MPI::MPI_CXX)
|
||||
endif()
|
||||
|
||||
if(dagmc)
|
||||
target_compile_definitions(libopenmc PRIVATE DAGMC)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue