CMake - improve how MPI is found and linked#203
Merged
Conversation
Replace the hand-rolled SetupMPI.cmake and the soft-warn IF(MPI_C_FOUND) fallback with a single find_package(MPI REQUIRED COMPONENTS C), and attach MPI to the ROSS target via target_link_libraries(ROSS PUBLIC MPI::MPI_C). MPI is PUBLIC because core/ross.h does #include <mpi.h>, so the include path must propagate to consumers. Adds target_link_libraries(ROSS PRIVATE m) for libm and replaces the now-empty ROSS_EXTERNAL_LIBS plumbing. After this, ROSS configures cleanly with the system C compiler — no CC=mpicc or -DCMAKE_C_COMPILER=mpicc required. For non-standard MPI installs, hint with -DMPI_HOME=... or `module load <mpi>` before configuring. CLAUDE.md updated accordingly.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #203 +/- ##
=======================================
Coverage 47.86% 47.86%
=======================================
Files 37 37
Lines 4745 4745
Branches 857 857
=======================================
Hits 2271 2271
Misses 2469 2469
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
-Walland-WextraDocumentation/dev/, unless the change is invisible to anyone outside the PR (test refactors, internal renames, comment-only tweaks)