Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ The Axom project release numbers follow [Semantic Versioning](http://semver.org/
- Primal: Axom's polygon clipping was modified to handle some corner cases.

### Fixed
- MPI setup in exported Axom config only requires Fortran when Axom's MPI was set up with Fortran.
This is in support of configs that require Fortran and MPI, but not an MPI wrapper for Fortran.

### Removed

Expand Down
18 changes: 18 additions & 0 deletions src/cmake/AxomConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ if(AXOM_ENABLE_MPI AND ENABLE_FORTRAN)
endif()
endif()

# Allow user to selectively enable which languages have MPI targets
# based on enabled languages and whether they've supplied MPI_<lang>_COMPILER
if(AXOM_ENABLE_MPI)
set(_axom_required_mpi_components)
get_property(_axom_enabled_languages GLOBAL PROPERTY ENABLED_LANGUAGES)

if("C" IN_LIST _axom_enabled_languages AND MPI_C_COMPILER)
list(APPEND _axom_required_mpi_components C)
endif()
if("CXX" IN_LIST _axom_enabled_languages AND MPI_CXX_COMPILER)
list(APPEND _axom_required_mpi_components CXX)
endif()
if("Fortran" IN_LIST _axom_enabled_languages AND MPI_Fortran_COMPILER)
list(APPEND _axom_required_mpi_components Fortran)
endif()
set(AXOM_REQUIRED_MPI_COMPONENTS "${_axom_required_mpi_components}")
endif()


## Add a configuration define for each enabled axom component
foreach(comp ${AXOM_COMPONENTS_ENABLED})
Expand Down
11 changes: 10 additions & 1 deletion src/cmake/axom-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,16 @@ if(NOT AXOM_FOUND)

# Load mpi targets because we require the optional Conduit mpi targets
if(AXOM_USE_MPI)
find_package(MPI REQUIRED)
set(_axom_required_mpi_components "@AXOM_REQUIRED_MPI_COMPONENTS@")
if(NOT CMAKE_Fortran_COMPILER_LOADED)
list(REMOVE_ITEM _axom_required_mpi_components Fortran)
endif()

if(_axom_required_mpi_components)
find_package(MPI REQUIRED COMPONENTS ${_axom_required_mpi_components})
else()
find_package(MPI REQUIRED)
endif()
endif()

find_dependency(Conduit REQUIRED
Expand Down
2 changes: 1 addition & 1 deletion src/cmake/blt