CMake fix on examples - #1645
Conversation
There was a problem hiding this comment.
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 fromSTRUMPACK_FOUNDtoSTRUMPACK_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.
| # 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) |
There was a problem hiding this comment.
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:
smith/cmake/SmithConfigHeader.cmake
Lines 10 to 15 in d083f8b
There was a problem hiding this comment.
@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.
In a previous PR #1621 I erroneously changed
STRUMPACK_DIRtoSTRUMPACK_FOUNDin various CMake files associated to the examples. I am now reverting back to usingSTRUMPACK_DIR. Upon looking closer atSetupSmithThirdParty.cmakeit appears that since strumpack will come via mfem, if it is made available at all, then smith doesn't set/use/defineSTRUMPACK_FOUNDrather all the logic is done viaSTRUMPACK_DIR.