-
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
CMakeLists update for issue 148 #149
Conversation
Address request in issue kokkos#148 to check for CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=ON when Cuda is enabled. If it is not on, error out at configuration.
Tested that this 1) errors out at configuration with Cuda8 if |
Is there a problem with always having this ON when CUDA is enabled ? I don't know why we would error out, force the user to set it and reconfigure again. If it is needed can we just set it ON for CUDA. |
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.
Thanks @ndellingwood ! I suggested a couple changes.
CMakeLists.txt
Outdated
@@ -75,6 +75,10 @@ TRIBITS_ADD_OPTION_AND_DEFINE( | |||
LIST(APPEND DEVICE_LIST "<Cuda,CudaUVMSpace>") | |||
ENDIF() | |||
|
|||
IF(NOT CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS) |
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.
IF(NOT (DEFINED(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS)) OR (NOT CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS))
etc.
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.
Not sure if CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS
is defined by default. (CMake options have three possible states: NOT DEFINED
, FALSE
, and TRUE
.) The above will check for that.
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.
@mhoemmen I didn't realize that, thanks for the catch!
CMakeLists.txt
Outdated
@@ -75,6 +75,10 @@ TRIBITS_ADD_OPTION_AND_DEFINE( | |||
LIST(APPEND DEVICE_LIST "<Cuda,CudaUVMSpace>") | |||
ENDIF() | |||
|
|||
IF(NOT CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS) | |||
MESSAGE( FATAL_ERROR "Kokkos-Kernels configuration failed: CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS is required be set to ON when compiling with Cuda." ) |
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.
Incorrect grammar; try this:
The CMake option CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS is either undefined or OFF. Please set CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL=ON when building with CUDA.
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.
@mhoemmen made the change, thanks!
Fix if check and grammar, suggestions from @mhoemmen
Updated PR with suggested changes |
@bartlettroscoe I added a check in kokkos-kernels for |
This file gets processed as part of the Trilinos CMake configure as well so it should be active there as well. In fact, any TriBITS configure of this package will have this check. |
Thanks @ndellingwood ! :D |
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.
Thanks @ndellingwood ! I have a few questions:
- Does a CUDA build with complex OFF actually need this option? If not, then the message isn't quite accurate, though it doesn't hurt.
- Does this option work with all supported host compilers for CUDA builds? If not, then we should add a check for the host compiler, just so we don't force users to do something that doesn't work.
Thanks @mhoemmen!
|
@ndellingwood wrote:
I'm not too worried about this bit, as long as the build settings work in both complex ON and OFF cases, but it's still helpful to know, so thanks :-) .
If we don't test it, it doesn't exist ;-) . I would say, let's discover this rather than trying to guess. If somebody reports on a new platform that it doesn't work, we can change the message then. |
Addresses issue kokkos#148. The check for CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS enabled is only necessary when complex+double+Cuda with ETI occurs.
Part of issue kokkos#148
Changes to address issue kokkos#148
@crtrott requested the @srajama1 since |
@srajama1 README updated with comment for usage |
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'm OK with this for now, but please see note. Thanks @ndellingwood !
@@ -75,6 +75,10 @@ TRIBITS_ADD_OPTION_AND_DEFINE( | |||
LIST(APPEND DEVICE_LIST "<Cuda,CudaUVMSpace>") | |||
ENDIF() | |||
|
|||
IF( Trilinos_ENABLE_COMPLEX_DOUBLE AND ((NOT DEFINED CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS) OR (NOT CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS)) ) |
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.
This is fine, though it may be possible to turn OFF KokkosKernels_INST_COMPLEX_DOUBLE
even if Trilinos_ENABLE_COMPLEX_DOUBLE
is ON.
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.
@mhoemmen Thanks for the catch! I'm guessing most users use Trilinos_ENABLE_COMPLEX_DOUBLE
so I think I should leave that and add a check for KokkosKernels_INST_COMPLEX_DOUBLE also, does this sound correct?
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.
@ndellingwood What about stand-alone builds? Does Trilinos_ENABLE_COMPLEX_DOUBLE
even exist in that case?
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.
@mhoemmen I'm not sure that kokkos-kernels has standalone CMake support, I think for standalone builds the Makefile system should be used but I may be wrong.
Address request in issue #148 to check for
CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=ON when Cuda is enabled.
If it is not on, error out at configuration.