Skip to content

save mfem's tpl rpath info by transforming -Xlinker items to -Wl - #1968

Open
chapman39 wants to merge 4 commits into
developfrom
bugfix/chapman39/replace-xlinker-with-wl-in-find-mfem
Open

save mfem's tpl rpath info by transforming -Xlinker items to -Wl#1968
chapman39 wants to merge 4 commits into
developfrom
bugfix/chapman39/replace-xlinker-with-wl-in-find-mfem

Conversation

@chapman39

Copy link
Copy Markdown
Contributor

Fixes the following error:

[meemee@rzvector2:build-rzvector-toss_4_x86_64_ib-llvm@19.1.3_cuda-debug]$ ./tests/utils_config_test 
./tests/utils_config_test: error while loading shared libraries: libstrumpack.so.8.0: cannot open shared object file: No such file or directory

The issue is that in FindMFEM, the rpath information was being filtered out. But, if a tpl is shared, we still need that rpath. So, transform -Xlinker into -Wl.

This was tested on rzvector using a custom host config where strumpack was built as a shared library.

We might need to check if using clang or gcc compiler before performing the transformation but I'm not sure.

@chapman39 chapman39 self-assigned this Aug 27, 2026
@chapman39 chapman39 added the bug Something isn't working label Aug 27, 2026
@chapman39
chapman39 requested review from kennyweiss and white238 and a lite review from Copilot August 27, 2026 23:54
@chapman39

Copy link
Copy Markdown
Contributor Author

does this warrant a release notes update?

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Axom’s MFEM CMake discovery logic to preserve MFEM third-party (TPL) rpath/linker flags that were previously being dropped, addressing runtime loader failures (e.g., missing libstrumpack.so).

Changes:

  • Stops filtering out -Xlinker-related link flags from MFEM’s config.mk parsing.
  • Attempts to transform -Xlinker rpath flags into -Wl,... form so the rpath is retained for shared TPLs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 116 to +120
set(_mfem_tpl_list ${mfem_tpl_lnk_flags})
separate_arguments(_mfem_tpl_list)
list(FILTER _mfem_tpl_list EXCLUDE REGEX Xlinker)
list(JOIN _mfem_tpl_list " " mfem_tpl_lnk_flags)
list(TRANSFORM _mfem_tpl_list
REPLACE "^-Xlinker=-rpath,(.*)$" "-Wl,-rpath,\\1")
set(mfem_tpl_lnk_flags ${_mfem_tpl_list})

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah but mfem doesnt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants