Skip to content

CMake fix on examples - #1645

Open
thartland wants to merge 1 commit into
developfrom
hartland1/example_cmake_fix
Open

CMake fix on examples#1645
thartland wants to merge 1 commit into
developfrom
hartland1/example_cmake_fix

Conversation

@thartland

Copy link
Copy Markdown
Contributor

In a previous PR #1621 I erroneously changed STRUMPACK_DIR to STRUMPACK_FOUND in various CMake files associated to the examples. I am now reverting back to using STRUMPACK_DIR. Upon looking closer at SetupSmithThirdParty.cmake it appears that since strumpack will come via mfem, if it is made available at all, then smith doesn't set/use/define STRUMPACK_FOUND rather all the logic is done via STRUMPACK_DIR.

Copilot AI lite review requested due to automatic review settings August 14, 2026 21:06
@thartland
thartland requested a review from white238 August 14, 2026 21:07
@thartland thartland added bug Something isn't working ready for review Ready for active inspection by reviewers labels Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 corrects the CMake gating logic for several example targets by reverting the Strumpack availability check from STRUMPACK_FOUND back to STRUMPACK_DIR, aligning the examples with how Smith’s third-party setup actually enables Strumpack support.

Changes:

  • Switch example if(...) conditions from STRUMPACK_FOUND to STRUMPACK_DIR.
  • Ensure continuation- and Tribol-dependent examples are only added when Strumpack is configured via STRUMPACK_DIR.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
examples/uniaxial/CMakeLists.txt Gate uniaxial example on STRUMPACK_DIR instead of STRUMPACK_FOUND.
examples/obstacle_design/CMakeLists.txt Gate continuation obstacle design example on SMITH_ENABLE_CONTINUATION AND STRUMPACK_DIR.
examples/inertia_relief/CMakeLists.txt Gate continuation inertia relief example on SMITH_ENABLE_CONTINUATION AND STRUMPACK_DIR.
examples/contact/homotopy/CMakeLists.txt Gate two-blocks homotopy example on TRIBOL_FOUND AND STRUMPACK_DIR AND SMITH_ENABLE_CONTINUATION.
examples/contact/CMakeLists.txt Gate contact examples on TRIBOL_FOUND AND STRUMPACK_DIR.

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

@thartland
thartland requested a review from ebchin August 14, 2026 21:09
# SPDX-License-Identifier: (BSD-3-Clause)

if (TRIBOL_FOUND AND STRUMPACK_FOUND AND SMITH_ENABLE_CONTINUATION)
if (TRIBOL_FOUND AND STRUMPACK_DIR AND SMITH_ENABLE_CONTINUATION)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be STRUMPACK_FOUND and if it is not being created that is a bug.

It is because it coming from MFEM and we aren't creating variables for it's dependencies. This is a larger issue you didn't create and I can fix it if you like.

It causes cascading issues as well. Like this config header check isn't being handled either:

set(TPL_DEPS ADIAK AXOM CALIPER CAMP CONDUIT CONTINUATION CUDA ENZYME GRETL HDF5 HIP LUA MFEM MPI PETSC RAJA SLEPC STRUMPACK SUNDIALS TRIBOL UMPIRE)
foreach(dep ${TPL_DEPS})
if( ${dep}_FOUND OR ENABLE_${dep} )
set(SMITH_USE_${dep} TRUE)
endif()
endforeach()

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.

@white238 I can this PR go and let you put in the right plumbing to the smith setup thirdparty so that various mfem options are exposed in smith via variables like STRUMPACK_FOUND.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thats fine. Issue created #1646

@thartland thartland added do not merge and removed ready for review Ready for active inspection by reviewers labels Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working do not merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants