Skip to content

CMake - improve how MPI is found and linked#203

Merged
caitlinross merged 1 commit into
ROSS-org:masterfrom
caitlinross:cmake-mpi
May 26, 2026
Merged

CMake - improve how MPI is found and linked#203
caitlinross merged 1 commit into
ROSS-org:masterfrom
caitlinross:cmake-mpi

Conversation

@caitlinross
Copy link
Copy Markdown
Member

@caitlinross caitlinross commented May 26, 2026


Checklist

  • Builds cleanly with -Wall and -Wextra
  • CI is green
  • Added a changelog fragment under Documentation/dev/, unless the change is invisible to anyone outside the PR (test refactors, internal renames, comment-only tweaks)
  • Confirmed nothing in CODES breaks. CI has a minimal CODES build that should be green before merging.
  • For new features: blog post on the ROSS website, with link in this PR

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
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.86%. Comparing base (6deb408) to head (500f1d0).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caitlinross caitlinross merged commit 427ed81 into ROSS-org:master May 26, 2026
5 checks passed
@caitlinross caitlinross deleted the cmake-mpi branch May 26, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant