-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EPIC: Features to remove to simplify TriBITS #569
Comments
NOTE: One might consider removing support for external packages/TPLs with TriBITS and force packages to call |
But if one could not completely remove support for external packages/TPLs in TriBITS as it would destroy the ability to treat internal and external packages in a flexible manner (as discussed above), TriBITS could be greatly simplified by removing support for the TriBITS Legacy TPL System (i.e. that accepted lists of include directories, library directories, and library names and build modern CMake targets and packages out of these) and instead just rely on With those changes and assumptions, all that the TriBITS system would need to do is to call However, this beautify utopia of CMake packages is not currently practical right now because of issues like:
Because of constraints and problems like above, we have to have TriBITS TPL find wrapper modules like FindTPLHDF5.cmake. These wrapper |
@sebrowne, @rppawlo, @jwillenbring, I just learned that if TriBITS and Trilinos switches to manual library links, that will likely result in much longer link links due to duplicate libraries. That will slow down the links and will likely crash the link on some systems that have very long link lines (or force you to switch to the usage of resource files). That appears to be a CMake "feature". For more details, see:
So with modern CMake (as of the current release CMake 3.30), you need a system like TriBITS to manually do your linking for you in order to avoid long link lines with lots of duplicate libraries. Amazing. (NOTE: And that will yield much longer link lines than some overlinking that may be currently occurring with TriBITS auto-linking all libs from dependent upstream packages.) |
Description
There a number of features supported by TriBITS that if removed would (greatly) simplify TriBITS. Some of these major features that could be removed without seriously degrading the main features of TriBITS are:
<UpstreamPkg>::all_libs
targets but intermediate targets in dependent upstream packages) ... Currently this will yield much longer link lines with duplicate libraries, see belowtarget_include_directories()
) and stop using the globalinclude_directories()
command.NOTES:
Even with loosing all of the functionality listed above (and doing all of the refactorings in #411), what remains is TriBITS is very significant and not duplicated by anything in raw CMake or in any of the provided CMake modules. (Not even VTK Modules can do what TriBITS does with the flexible handling of internal and external packages.)
The improvements in dependency handling and streamlining builds provided by subpackages lost by removing support for subpackages in
#1
is mitigated by moving to manual linking of intermediate targets in#2
(and also, manually linking makes the CMakeLists.txt files look more like raw CMake). As a consequence, for example, you would have to configure all of the Teuchos package but downstream packages could choose to just link againstTeuchos::teuchoscore
instead ofTeuchos::all_libs
. This means you are configuring more software that you might need but you are still only building the upstream libraries needed to build downstream targets. (But doing the install of a package would require building everything in that package, including all of its required upstream dependencies and needing to find all required upstream TPLs.) To mitigate the all-or-nothing build of existing packages currently broken into subpackages like Teuchos and SEACAS, package developers would be tempted to add their own conditional enable/disable logic which would create a lot of complexity in downstream packages to compensate for this. (This would shift complexity from the framework/tribits to the package developers which may not be a good idea and would likely make less-than-everything builds much more fragile to maintain.) This will break backward compatibility for existing Trilinos user configure scripts but will be easy and safe to fix in their scripts.Switching to passing in include directories in
#3
would allow ripping some code in code in TriBITS that gets the include directories directory property (set by theinclude_directories()
) command and yields CMakeLists.txt files that look more like raw CMake. This would not impact Trilinos users at all.Removing support for subpackages in
#1
and some compiler option handling in#4
, however, would break the ability to target specific compiler options to specific subpackages (see #442, #453 and trilinos/Trilinos#10111, for example).The code that implements
#5
is pretty complex but it greatly simplifies creating consistent explicit template instantiation sets across dependent packages. Loosing this would likely make the Trilinos CMakeLists.txt files more complex and make Trilinos harder to configure for Trilinos customers.For removing support for legacy TriBITS TPLs in
#6
, that requires that all external packages/TPLs be found with a simplefind_package(<ExternalPkg>)
command and it requires those to find 100% modern CMake packages (i.e. provides all modern CMake targets and calls find_dependency() on all of their upstream dependencies). But there is still a problem where the name of the imported target may change or may not even exist depending on the version of the external package installed or how it is found (see the expended discussion below). However, of all of the changes listed above, this change will most strongly impact Trilinos users and break all of their existing configure scripts for Trilinos. All of the other changes would have minor impact on Trilinos users.The text was updated successfully, but these errors were encountered: