Skip to content

[infrastructure] Rework Trilinos configure process and add TPL dependency variables#1930

Merged
maxfirmbach merged 3 commits into4C-multiphysics:mainfrom
maxfirmbach:Introduce-Trilinos-TPL-variables
Apr 4, 2026
Merged

[infrastructure] Rework Trilinos configure process and add TPL dependency variables#1930
maxfirmbach merged 3 commits into4C-multiphysics:mainfrom
maxfirmbach:Introduce-Trilinos-TPL-variables

Conversation

@maxfirmbach
Copy link
Copy Markdown
Contributor

@maxfirmbach maxfirmbach commented Apr 3, 2026

Description and Context

This is my "poor man's approach" on introducing a variable FOUR_C_WITH_TRILINOS_XXX which is set during Trilinos configure, to be used as REQUIRED_DEPENDENCY for testing. The main difficulty is that we indirectly use these TPLs through Trilinos and do not directly configure them in 4C directly.

This enables use to skip tests, which use specific TPLs compiled into Trilinos. Example, we want to skip tests using MUMPS as direct solver.

In the same scope, I added checks to find Trilinos packages we have a hard dependency on. This is by no means complete yet, but it helps to directly error out during configure if a "wrong" Trilinos install is used and not during compile time, due to headers not found ...

@maxfirmbach
Copy link
Copy Markdown
Contributor Author

Well, seems like my first try failed miserably.

@maxfirmbach maxfirmbach force-pushed the Introduce-Trilinos-TPL-variables branch from d41ccdb to e17a507 Compare April 3, 2026 12:30
Copy link
Copy Markdown
Member

@sebproell sebproell left a comment

Choose a reason for hiding this comment

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

The current approach seems like a valid starting point. I need too think a bit about whether it makes sense that we call the variables FOUR_C_WITH_xxx in this case, since they mark transitive dependencies. One way to approach this is to have a configure_MUMPS.cmake etc file and in there check for the relevant Trilinos stuff. At a later point in time, we may also add support for getting these dependencies differently. Ofc, Trilinos needs to be configured first, but we have control over that in the top-level CMakeLists.txt. Not sure you can easily access the nice Amesos2_ENABLE_xx vars there.

Comment thread cmake/configure/configure_Trilinos.cmake Outdated
Comment thread cmake/configure/configure_Trilinos.cmake Outdated
@sebproell
Copy link
Copy Markdown
Member

How do we use MUMPS/UMFPACK/SuperLu_dist in the code: through Trilinos or their own API? If through Trilinos (which I supect for all three), we should name the variables something like FOUR_WITH_TRILINOS_UMFPACK etc. because we mean that Trilinos is set up for using them. By contrast, FOUR_C_WITH_UMFPACK would imply to me that we can use UMFPACK standalone, but it is not clear if Trilinos was built with that support. Ofc, Trilinos supporting UMFPACK would likely mean we can also use it standalone, but I think we should be specific here. It prevents somebody from giving us just UMFPACK without having it compiled into Trilinos as well.

@maxfirmbach
Copy link
Copy Markdown
Contributor Author

How do we use MUMPS/UMFPACK/SuperLu_dist in the code: through Trilinos or their own API? If through Trilinos (which I supect for all three), we should name the variables something like FOUR_WITH_TRILINOS_UMFPACK etc. because we mean that Trilinos is set up for using them. By contrast, FOUR_C_WITH_UMFPACK would imply to me that we can use UMFPACK standalone, but it is not clear if Trilinos was built with that support. Ofc, Trilinos supporting UMFPACK would likely mean we can also use it standalone, but I think we should be specific here. It prevents somebody from giving us just UMFPACK without having it compiled into Trilinos as well.

@sebproell We purely use it through Trilinos/Amesos2, which internally calls the respective API. I thought about the same ... I just wanted to have a first working version, let me think about how this could be done better also using what you proposed.

@maxfirmbach maxfirmbach changed the title [infrastructure] Introduce dependency variable for MUMPS [infrastructure] Rework Trilinos configure process and add TPL dependency variables Apr 3, 2026
@maxfirmbach maxfirmbach force-pushed the Introduce-Trilinos-TPL-variables branch from 7c83132 to 2d66b7b Compare April 3, 2026 15:10
@maxfirmbach maxfirmbach added the dependencies Pull requests that update a dependency file label Apr 3, 2026
Copy link
Copy Markdown
Member

@sebproell sebproell left a comment

Choose a reason for hiding this comment

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

This looks very promising now! You might want to add the FOUR_C_WITH_TRILINOS_MUMPS etc variables to the config.h file as well. For that, you need to enhace the configure_dependency() function that calls configure_Trilinos. See my comment below

Comment thread cmake/configure/configure_Trilinos.cmake Outdated
sebproell
sebproell previously approved these changes Apr 4, 2026
Copy link
Copy Markdown
Member

@sebproell sebproell left a comment

Choose a reason for hiding this comment

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

Perfect, exactly how I would want it to work 👍

@maxfirmbach maxfirmbach enabled auto-merge April 4, 2026 13:35
@maxfirmbach maxfirmbach requested a review from mayrmt April 4, 2026 13:38
@maxfirmbach
Copy link
Copy Markdown
Contributor Author

@bennoschoenstein Please check if ctest -L minimal gives you nice output with skipping the so far failing test on our workstation 😉.

@maxfirmbach
Copy link
Copy Markdown
Contributor Author

Had to fix the ParMETIS variable, should be correctly recognized now.

@maxfirmbach maxfirmbach requested a review from sebproell April 4, 2026 17:29
Copy link
Copy Markdown
Member

@mayrmt mayrmt left a comment

Choose a reason for hiding this comment

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

Let's give it a try in practice!

@maxfirmbach maxfirmbach merged commit 73456e7 into 4C-multiphysics:main Apr 4, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file team: infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants