-
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
Decoupling include/link dirs from 'TRIBITS_ADD_LIBRARY' #182
Comments
So the idea is that you need to call
Yea, I guess that would make sense. I am not sure why it is done in this way (it has been years since this code has been touched). But if that would solve your problem, can you give this a try in a branch? If you run the native TriBIITS test suite, it will tell you if you have broken anything. If you clone the TriBITS repo, then running the native TriBITS test suite is as easy as:
And you can build Trilinos against this TriBITS version using If moving these calls to Is ForTrilinos going to be under automated testing with Trilinos? I think it would be good if it could be. The sooner the better I suspect. That way, any changes to TriBITS will be tested against ForTrilinos before I update the snapshot the TriBITS in Trilinos. NOTE: Once I do the refactoring in #63, all of this internal library and include dir management code will change pretty dramatically to use |
@sethrj, was this the motivation for dropping TriBITS? |
@bartlettroscoe Sorry that I didn't ever see your earlier reply! Looks like the wrong Seth was tagged and I must not have seen the notification of a reply. :( This is a separate project from our Exnihilo work so it's mostly tangential to our thoughts of moving away from TriBITS. It is related in a way though. TriBITS' strength as a package architecture is that it's very automatic and full-featured when working within the constraints of its design, but extending or modifying it is almost impossible (for anyone but you, of course). The indirection and complexity of TriBITS (a lot of which is I think necessary for the unit testing) makes it difficult to even pinpoint the source of any unexpected behavior. Since I wrote this issue, the SWIG situation has actually changed quite a bit: the upstream CMake UseSWIG implementation changed significantly in order to move to newer CMake paradigms (properties of targets and source files as opposed to global/directory properties). I don't even know how the newer script will interact with TriBITS, so we're keeping basically a copy of an old Anyway, I haven't looked at this issue in a while, and the SWIG stuff seems to be working for the moment so I don't want to mess with it :) I'm going to close the issue. Thanks for the detailed response that I missed! |
@sethrj, thanks for the detailed response. These are all valid concerns. The plan for a long time has been to refactor TriBITS to strip out most of the guts for library and executable linking and use the newer CMake target-based approach. Just recently Trilinos upgraded the minimum CMake version form 2.8.11 to 3.10. That was the major impediment to refactoring TriBITS. Now that the minimum CMake version for TriBITS is 3.10, I think we can move forward with major refactorings and extensions like #63 and #10. I would like to make sure that the refactored TriBITS can smoothly handle use cases like you describe with SWIG so it I will ping you once we get that effort going. Hopefully we can preserve the advantages of a package-based architecture for CMake projects and address these and related concerns. Examples like Kitware's own VTK Modules and Google's Catkin shown the clear need for a package-based architecture for large amounts of CMake-based code. It would be a shame to have to give up and just go back to trying to glue together various packages that systems like Spack and CMake ExternalProject have you do (and throws away many of the advantages of CMake, CTest, and CDash). |
I'm working on ForTrilinos with Andrey Prokopenko. I've got SWIG hooked up provisionally into CMake/Tribits: SWIG takes a
.i
file and generates a.cxx
and a.f90
file, which get linked (alongside whatever sources the user provides) into a package library usingTRIBITS_ADD_LIBRARY
.There is a problem though, in that SWIG needs the dependency information (include directories) as the library compilation, but that information is only built inside the
TRIBITS_ADD_LIBRARY
call (but before the actual CMakeADD_LIBRARY
call). As a workaround, I'm explicitly callingbefore calling
SWIG_ADD_MODULE
. But I think this hack ends up causing theTRIBITS_ADD_LIBRARY
logic to retrace the package dependency graph and possibly even duplicate all the upstream includes.The only other workaround I can think of is to create a stub
TRIBITS_ADD_LIBRARY
before the SWIG call, but that ends up unnecessarily doubling the number of libraries in the one package.Is there a way to decouple the upstream include directory/link traversal from the library creation? Is there a reason this is done inside the "
add_library
" command as opposed toTRIBITS_PACKAGE
orTRIBITS_SUBPACKAGE
?The text was updated successfully, but these errors were encountered: