-
Notifications
You must be signed in to change notification settings - Fork 407
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
[develop branch] Standalone cmake issues #826
Comments
Note: if there is a newer preferred way of doing things, that's fine, but also make sure those changes are reflected in /example/build_cmake such it always has the preferred method in it. Also, this is develop so I get what I deserve :-) |
Ah! You're building kokkos as part of your project, correct? Yeah, I did not consider that. I guess for standalone nothing should change between CMAKE_SOURCE_DIR and CMAKE_CURRENT_SOURCE_DIR, but when kokkos is built inside another library, CMAKE_SOURCE_DIR refers to the "host" project. I think the cleanest thing to do is to use Kokkos_SOURCE_DIR, which can be defined once and for all at the beginning of kokkos' main CMakeLists.text. |
As for the include directories not correctly inherited, I'll have to think about it. As soon as I can get my laptop out I'll check it out. |
Hi All, I was looking at this... I have a partial fix in a fork https://github.com/bjoo/kokkos/tree/cmake_changes commit e77eab4 It involved changing CMAKE_SOURCE_DIR etc to Kokkos_SOURCE_DIR, CMAKE_BINARY_DIR to Kokkos_BINARY_DIR and also adding a bunch of include_directory() commands to pick up the includes both from Kokkos source and binary (which is where the config.h file came. However, it still has at least one flaw when building as part of my project. The kokkos include directories go into installdir/include, whereas it would be cleaner if they went into installdir/kokkos/include. If you think it is adequate, I can create a pull req. OtherwiseI can wait for your solutions too. |
Your fix sounds reasonable. As for the installation, we can perhaps do something like SET(Kokkos_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/kokkos) if kokkos is built as a sub project... |
I guess I can do that in my superproject?
Let me try. If that works, I’ll create a pull req.
Best,
B
… On May 19, 2017, at 9:08 PM, Luca Bertagna ***@***.***> wrote:
Your fix sounds reasonable. As for the installation, we can perhaps do something like
SET(Kokkos_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/kokkos)
if kokkos is built as a sub project...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
--------------------------------------------------------------------------------------
Dr Balint Joo High Performance Computational Scientist
Jefferson Lab
12000 Jefferson Ave, Suite 3, MS 12B2, Room F217,
Newport News, VA 23606, USA
Tel: +1-757-269-5339, Fax: +1-757-269-5427
email: bjoo@jlab.org
-------------------------------------------------------------------------------------
|
I think it should be done from inside kokkos. One way to detect if kokkos is a subproject is to check whether CMAKE_PROJECT_NAME is already set... |
Check if it is set before kokkos call to project. (Sorry, writing from my phone) |
OK. I will try… Still a bit of a CMake novice…
Will write back in a few…
Best,B
… On May 19, 2017, at 9:17 PM, Luca Bertagna ***@***.***> wrote:
Check if it is set before kokkos call to project.
(Sorry, writing from my phone)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
--------------------------------------------------------------------------------------
Dr Balint Joo High Performance Computational Scientist
Jefferson Lab
12000 Jefferson Ave, Suite 3, MS 12B2, Room F217,
Newport News, VA 23606, USA
Tel: +1-757-269-5339, Fax: +1-757-269-5427
email: bjoo@jlab.org
-------------------------------------------------------------------------------------
|
However, if you are installing kokkos, you may as well use ExternalProject_Add. The real difference is if you only build kokkos, and want to link to it without installing it. This is more difficult, and I don't think as it is it would work. Probably we would have to introduce the build/install interface generators to establish the include directories.. |
I couldn't get things to work with the Kokkos_INSTALL_DIR (maybe I did but it got overwritten later. However, I did manage to get the headers to install in include/kokkos for submodule builds with Libraries still get installed in CMAKE_INSTALL_DIR/lib and binaries in CMAKE_INSTALL_DIR/bin This works for me. If Luca and Daniel are good with it I can submit a pull. |
This must be why TriBITS distinguishes between |
It looks like we forgot to label this issue decently, but #827 was merged and is now in master. Can this be closed? |
Fine with me |
It appears that commit 9583090 by @bartgol has caused issues with my standalone cmake.
These are the changes I made which allowed kokkos to build again w/in my project:
However, I am still not inheriting the kokkos include directories as I was before. Any ideas @dsunder, @bartgol?
The text was updated successfully, but these errors were encountered: