-
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
Add installation testing option #3034
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this with a CUDA build.
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ | ||
-DCMAKE_CXX_COMPILER=$WORKSPACE/bin/nvcc_wrapper \ | ||
-DCMAKE_CXX_FLAGS=-Werror \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is okay (it works). We could have also done -DKokkos_ROOT=...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enabled tests depend on the backends enabled here, don't they? Hence, these should match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm fine with this once the CI configuration is fixed.
It might also be a good idea to hide this some more from the user by making it an internal variable.
CMakeLists.txt
Outdated
@@ -147,6 +147,10 @@ INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_tribits.cmake) | |||
# Check the environment and set certain variables | |||
# to allow platform-specific checks | |||
INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_check_env.cmake) | |||
|
|||
# | |||
KOKKOS_OPTION(INSTALL_TESTING OFF BOOL "Whether to build tests and examples against installation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this is doing effectively is to disable compiling the library and just run the tests.
Hence, I would rather name it DISABLE_COMPILING
or similar and make sure Kokkos_ENABLE_TESTS=ON
.
Ok it doesn't look like this fully works. The config is doing something in between where it doesn't get the enabled spaces from the installed version. It would work if I would just give matching options for the second configure but do we want that? |
@masterleinad Yeah, we should probaly just make it an internal variable. |
So I tried something where I stuck the check just before KOKKOS_SETUP_BUILD_ENVIRONMENT in the main CMakeLists:
And that seems to work properly. You only need to set compiler and Kokkos_INSTALL_TESTING and everything else comes from the installed Kokkos instead of first trying to do a configuration of Kokkos and overwriting those settings via a find package. |
Creating a separate directory with cmake_minimum_required(VERSION 3.10)
project(KokkosTestInstall CXX)
find_package(Kokkos 3.1 REQUIRED QUIET)
SET(PACKAGE_NAME KOKKOS)
SET(KOKKOS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
SET(KOKKOS_ENABLE_TESTS ON)
SET(KOKKOS_INSTALL_TESTING ON)
include(${PROJECT_SOURCE_DIR}/../cmake/fake_tribits.cmake)
include(${PROJECT_SOURCE_DIR}/../cmake/kokkos_tribits.cmake)
ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/../core/ core)
ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/../algorithms algorithms)
ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/../containers containers) would an alternative to be sure to not mess with the configuration of the found package. |
I pushed a refactor that combines all the recent feedback (I think).
I kept the name |
Yeah this looks good. Let me push again the Jenkins config file change I added which got nuked by your force push :-) |
Now, |
I think this is fine. I am also happy with the Kokkos_INSTALL_TESTING directly implying Kokkos_ENABLE_TESTS. That INSTALL_TESTING option anyway implies doing something completely different. |
And the install test worked in Jenkins. Great! |
Allows easier testing Jenkins of Kokkos installations.
Kokkos::kokkos
find_package(Kokkos)
instead of building Kokkos when option is set