Skip to content

Avoid exporting TPL (e.g. MFEM) cmake targets - #1681

Draft
chapman39 wants to merge 2 commits into
developfrom
task/chapman39/avoid-exporting-tpls
Draft

chapman39 wants to merge 2 commits into
developfrom
task/chapman39/avoid-exporting-tpls

Conversation

@chapman39

@chapman39 chapman39 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

avoid exporting MFEM cmake target. this creates a lot of issues when we build with codevelop. instead, each project will import the third party libraries they need individually. and only export targets that are internal to the project. so smith only exports smith_infrastructure, smith_numerics, etc. https://github.com/llnl/smith/blob/develop/CMakeLists.txt#L206-L211

This only works if every project built from source (i.e. mfem, axom, tribol) agrees to NOT export mfem, except mfem itself. Because either only one library can export a target, or everyone has to. So before this, lido, smith, axom, tribol all had to export mfem, which becomes hard to maintain.

I updated the Axom and Tribol submodules to no longer export mfem. Links:

NOTE:

Now that we're importing targets more often in our smith-config.cmake, it's good practice to check if the target already exists before importing it. Otherwise when downstream projects install Smith and they both import arpack for example, it will error-out, since you can't have two targets with the same name. It's not required to do this when we call find_dependency. Example

  if(SMITH_USE_ARPACK AND NOT TARGET arpack)
    blt_import_library(NAME       arpack
                       INCLUDES   @ARPACK_INCLUDE_DIRS@
                       LIBRARIES  @ARPACK_LIBRARIES@
                       TREAT_INCLUDES_AS_SYSTEM ON)
  endif()

Some issues:

  • latest axom uses new umpire target name, so we either need to update umpire or create a separate axom branch temporarily reverting to the old target name

@chapman39 chapman39 self-assigned this Oct 15, 2026
@chapman39 chapman39 added the build Build system label Oct 15, 2026
@chapman39 chapman39 changed the title Avoid exporting TPLs (e.g. MFEM) Avoid exporting TPL (e.g. MFEM) cmake targets Oct 15, 2026
@chapman39
chapman39 marked this pull request as draft October 15, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant