-
Notifications
You must be signed in to change notification settings - Fork 99
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
Standalone CMake build #120
Comments
we will also use kokkoskernels - it has no standalone cmake support kokkos/kokkos-kernels#120
we will also use kokkoskernels - it has no standalone cmake support kokkos/kokkos-kernels#120
@william76 - adding you to the issue, in case you have time to spare on this. |
We will want to use a:
Best practice is to use a namespace for imported targets so that cmake knows it's a CMake target and not just a library. AFAIK kokkos does not namespace targets currently.
Otherwise you can end up with just a |
Related to kokkos/kokkos#674 and kokkos/kokkos#1924 |
TL; DR: KokkosKernels needs a modest overhaul to the build system to do modern CMake correctly. Kokkos itself might need a couple fixes, too. Okay - I think I need clarification. This is my impression of the current build state of both kokkos and kokkoskernels (which may be incorrect).
Even if we link kokkoskernels against a kokkos CMake target, kokkos is not currently propagating include targets.
|
@jjwilke: please feel free to consider everything you want to consider and fix the above mentioned issues in both Kokkos and KokkosKernels ;-) |
Feature branch of Kokkos at jjwilke/kokkos.git@4a50aed548c187f0365f624fab34084c1f1521f2 |
Is this ready to come in as a PR ? |
@ndellingwood this sounds very very reasonable. We also need to talk to the LANL folks who rely on current Kokkos cmake support that the Kokkos core changes didn't break there stuff (and/or they like the changes necessary). |
Yes, yes. Much more testing needs to be done. I'm particularly worried about case-sensitive file names since Darwin mucks this up by not being case-sensitive. @ndellingwood: In theory, nothing for Trilinos was broken - but obviously this should be tested. As far as I can tell, the kokkos_build.cmake file is only included when not building with Trilinos. This is the only file I modified in a significant way. Everything else uses TRIBITS_X(...) CMake 2.8 - which is the minimum for Trilinis (I think) - supports target_include_directories and target_link_libraries, but does not do transitive dependencies. The most likely point of breakage is the examples and tests relying on transitive includes/libs which will work in the Kokkos minimum 3.3 but will not work in the Trilinos minimum (2.8). |
Trilinos is actually at 3.10 as a minimum for CMake. |
The first draft is at kokkos-kernels on the kokkos repository kokkos TODO: package configure file, if we want to support non-cmake projects Transitive dependencies appear to be working correctly for standalone builds using:
Kokkos transitive dependencies are propagating correctly when linking. A minor complication here (and requires testing with more configurations) - Kokkos kernels by default with no ETI does not appear to add any sources to the list? This means kokkoskernels must be declared as an interface library otherwise this generates a CMake error. |
It is true we do not do ETI on some of our kernels. However, everything in src/impl/generated_specializations_cpp should get into a generated library based on what ETI options are enabled right ? |
That is my understanding - but then KokkosKernels becomes a header-only library? Is that correct? I believe the "correct" way to do a header-only library going forward is to declare it as an interface, but I will try to confirm this on the CMake list. |
I am missing something. Do you mean to say when ETI is off we are a header only library ? We can add an empty dummy.cpp to workaround it. |
CMake makes header-only libraries fairly easy. There was a type-o (fixed locally) which was causing sources not to get added. The behavior was supposed to be ETI on by default, which builds a conventional library. I was surprised to not see any source files getting built by default (hence the question), but that issue is fixed. |
I am changing all executables generated to NOEXEPREFIX so that they have the same names regardless of the parent project. If there is a reason this would break anything, please let me know. |
The old scripts won't work, but that is fine. |
Tests/platforms currently passing:
|
Let's call this done, eh? |
The current CMake build system works only with Trilinos and we use a script to compile standalone. Need to fix the CMake system.
The text was updated successfully, but these errors were encountered: