Repository navigation
Add macOS arm64 job to CI - #4194
kavyawadhwa134 wants to merge 2 commits into
Conversation
|
I think #3820 should be resolved first. |
|
@GuySten thanks, agreed. I've changed this PR to run only the C++ tests and the unit tests on macOS for now, and left the regression tests out until #3820 is resolved. The unit tests all pass on macOS with #4196. I ran the commits of this PR together with #4196 and #4197 through the full CI on my fork, and everything passes, including both macOS jobs: https://github.com/kavyawadhwa134/openmc/actions/runs/38577581256 I also tested jtramm's CORE-MATH branch on macOS and Linux runners. The macOS regression differences go away there; details are on #3820. |
|
The two macOS failures here are the five tests in |
Description
OpenMC's CI only runs on Linux, so problems on macOS, and on Apple silicon in particular, are only found when users hit them (e.g. #3415). This PR adds a
macosjob that builds OpenMC on a GitHub-hosted Apple silicon runner (macos-26) and runs the C++ tests withctestand the Python unit tests withpytest.The regression tests are left out for now. Their reference results are generated on Linux, and on macOS 21 of them give different results because of differences in the system math library (#3820). They can be added to this job once #3820 is resolved.
This PR depends on #4196: without it, the five tests in
tests/unit_tests/test_tally_nuclide_names.pyfail on macOS, because the error message OpenMC prints there isn't recognized with libc++.Summary
OPENMC_USE_OPENMP=OFF/ON, with Apple clang. For OpenMP, CMake is pointed at Homebrew'slibompthroughOpenMP_ROOT, so no Homebrew LLVM is needed.RelWithDebInfo,OPENMC_ENABLE_STRICT_FP=on, Python 3.13,pip install -e .[test,vtk,ci], ncrystal and mcpl, NJOY2016 2016.78, and the cross section data fromtools/ci/download-xs.sh, cached with the same key.ci-pass, so it reports on PRs without blocking merges. It can be made required later.Design
.github/workflows/ci.yml, jobmacos:HDF5_ROOTis set to the Homebrew prefix, overriding the workflow-level/usr.tools/ci/gha-install-njoy.sh, but withgfortran-15from the runner and without-Dstatic=on, since macOS doesn't support fully static executables.build/and installed withsudo cmake --install build, as on Linux.pytestcall is the one fromtools/ci/gha-script.shwithouttests/regression_tests, with a comment pointing to Regression Tests Not Portable Between Different Compilers and Systems #3820.Commits
ctestonly, the first version of this PR.Testing
tests/test_matplotlib_import.py+tests/unit_tests1318 passed, 58 skipped, 0 failed.macos-26runners in my fork.core-math-transcendentalsbranch on macos-26, ubuntu-24.04 and ubuntu-24.04-arm. All of the regression tests that fail on macOS today pass on all three against the same references (details on Regression Tests Not Portable Between Different Compilers and Systems #3820).Prepared with help from Claude Code (Opus 5.5, medium effort).
Summary by CodeRabbit