famd: move Frontier AMD builds to AFAR drop 23.2.1 - #1768
Conversation
Point `famd` at therock-afar-23.2.1-gfx90a-7.13.0-7357b5084b, the newest AFAR drop on Frontier, instead of therock-23.1.0. The layout changed: 23.2.x no longer ships the mpich3.4a2 module set (only mpich4.3.1, which matches cray-mpich 9.x) and hipfort moved from include/ and lib/ to lib/llvm/. $OLCF_AFAR_ROOT is now overridable so trying the next drop does not need a source edit. Also resolve HIP and hipfort out of the drop explicitly. The loaded ROCm module ships its own libhipfort-amdgcn.a, and find_library searches CMAKE_PREFIX_PATH before HINTS, so HIPFORT_AMDGCN_LIB was resolving to /opt/rocm-7.2.0/lib/libhipfort-amdgcn.a -- pairing the drop's flang .mod files with an archive built by a different flang. The module set stays on amd/7.2.0 + rocm/7.2.0 deliberately. Bumping to amd/7.13.0 breaks the build: /opt/rocm-7.13.0 and the drop both ship libclang-cpp.so.23.0git and libLLVM.so.23.0git, and famd puts the drop's lib/llvm/lib first on LD_LIBRARY_PATH, so cc loads the wrong LLVM and aborts with "malloc(): invalid size (unsorted)" on a trivial .c file, failing the hipfort dependency configure. Verified on Frontier (1 node, gfx90a, --gpu mp): syscheck passes and 667/686 of the test suite passes. The 19 failures are all chemistry cases missing the separately-built gpu-mp-chem binary, not compiler failures. The simulation device-LTO link drops from 1682 s on 23.1.0 to 780-951 s on 23.2.1. Claude-Session: https://claude.ai/code/session_01RPGyAS6S7BRDELsANWaBpR
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Moves the Frontier AMD (famd / amdflang) toolchain configuration to the newer AFAR 23.2.1 drop and tightens CMake library resolution to ensure HIP/hipfort are taken from the drop (avoiding ROCm module archive mismatches).
Changes:
- Update
famdAFAR root totherock-afar-23.2.1...and adjust mpich/hipfort include+lib paths to the new drop layout. - Allow
$OLCF_AFAR_ROOToverride for easier drop testing, and document the pinned ROCm 7.0.2 runtime requirement. - Change CMake
find_library()usage to prefer AFAR-drop HIP and hipfort archives over installed ROCm module libraries.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| toolchain/bootstrap/modules.sh | Switches famd to AFAR 23.2.1, updates include/lib locations, and documents pinned runtime libs. |
| cmake/MFCTargets.cmake | Adjusts library discovery so HIP/hipfort resolve from AFAR drop before falling back elsewhere. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1768 +/- ##
=======================================
Coverage 61.67% 61.67%
=======================================
Files 84 84
Lines 21619 21619
Branches 3196 3196
=======================================
Hits 13334 13334
Misses 6093 6093
Partials 2192 2192 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Moves the
famd(Frontier AMD / amdflang) toolchain from thetherock-23.1.0AFAR drop totherock-afar-23.2.1-gfx90a-7.13.0-7357b5084b, the newest drop available on Frontier (moduleafar/23.2.1-7.13.0-7357b5084b, staged 2026-08-25).What changed
toolchain/bootstrap/modules.sh— the 23.2.x drop layout differs from 23.1.0:include/mpich3.4a2is gone; onlympich4.3.1ships, which is the right one for cray-mpich 9.x anyway.include/hipfort+lib/tolib/llvm/include/hipfort+lib/llvm/lib.$OLCF_AFAR_ROOTis now overridable, matching theamdfundblock below it, so testing the next drop doesn't need a source edit.cmake/MFCTargets.cmake— resolve HIP and hipfort out of the drop explicitly. The loaded ROCm module also shipslibhipfort-amdgcn.a, andfind_librarysearchesCMAKE_PREFIX_PATHbeforeHINTS, soHIPFORT_AMDGCN_LIBwas silently resolving to/opt/rocm-7.2.0/lib/libhipfort-amdgcn.a— pairing the drop's flang.modfiles with an archive built by a different flang. It linked, but only because the-L$OLCF_AFAR_ROOT/...flags happened to come first.What deliberately did not change
toolchain/modulesstays onamd/7.2.0 rocm/7.2.0./opt/rocm-7.13.0(with modulesamd/7.13.0/rocm/7.13.0) is new on Frontier and ships amdflang 23, but it cannot be used here:libclang-cpp.so.23.0gitandlibLLVM.so.23.0git.famdputs the drop'slib/llvm/libfirst onLD_LIBRARY_PATH, so the systemccloads the drop's LLVM and dies withmalloc(): invalid size (unsorted)compiling a trivial.c, which fails thehipfortdependency configure.amd/7.2.0has LLVM 22 sonames, so no collision.amd-builtmpi.mod(both9.0.1/ofi/amd/6.0and9.1.0/ofi/amd/7.0) is rejected by flang 23 with'mpi.mod' is not a module file for this compiler. Only the drop's owninclude/mpich4.3.1works, so the drop has to stay the base.Also worth noting: the
/opt/rocm-7.0.2entry onLD_LIBRARY_PATHis load-bearing, not stale. cray-mpich'slibmpifort_amd.sois built with classic flang and needslibpgmath/libflang/libflangrti/libompstub, which no AFAR drop ships and which ROCm dropped after 7.0.2. Retargeting it at$ROCM_PATHproduceslibpgmath.so: cannot open shared object fileat run time. Added a comment so it doesn't get cleaned up again.Verification
Frontier, 1 node, gfx90a,
--gpu mp, MFC masterb2a01f9:syscheckPASSED — MPI init/barrier/finalize,omp_get_num_devices() > 0, device selection.gpu-mp-chem-*binary, which this run never built (--no-build; CI builds that variant in a separate job) — not compiler failures.simulationdevice-LTO link: 1682 s on 23.1.0 → 780–951 s on 23.2.1. Both builds shared a login node so the numbers are approximate, but the ~2x is well outside the noise. This is the cost that drives the concurrentbase/chemjob split in.github/workflows/common/build.sh; that split is left alone here, but there may be room to simplify it in a follow-up.