From 29ac7e7e436cebe34aa45dccc88521cc611a91d8 Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Tue, 13 Feb 2018 11:10:58 -0700 Subject: [PATCH 1/7] CMakeLists: check for CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS with Cuda 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. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ec8a6cfc4..01fcd8cdf3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,10 @@ TRIBITS_ADD_OPTION_AND_DEFINE( LIST(APPEND DEVICE_LIST "") 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." ) + ENDIF() + ENDIF() IF(${Kokkos_ENABLE_Serial} OR ${Kokkos_ENABLE_Pthread} OR ${Kokkos_ENABLE_OpenMP}) From 80dee88e85d76d92c6614b5c2aa0e6780938f14b Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Tue, 13 Feb 2018 12:17:19 -0700 Subject: [PATCH 2/7] CMakeLists: Fix CMake variable syntax --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01fcd8cdf3..e2c624915b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,7 @@ TRIBITS_ADD_OPTION_AND_DEFINE( LIST(APPEND DEVICE_LIST "") ENDIF() - IF (NOT ${CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS}) + 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." ) ENDIF() From 086ec012674324dcc01203d1f3b0dbbbf5b0a6a8 Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Tue, 13 Feb 2018 16:51:13 -0700 Subject: [PATCH 3/7] CMakeLists: if check added for #148 incomplete - updated Fix if check and grammar, suggestions from @mhoemmen --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2c624915b..3583363176 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,8 +75,8 @@ TRIBITS_ADD_OPTION_AND_DEFINE( LIST(APPEND DEVICE_LIST "") 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." ) + IF((NOT DEFINED CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS) OR (NOT CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS)) + MESSAGE( FATAL_ERROR "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.") ENDIF() ENDIF() From 73239c97af78b4bd11d347272b9ad94ee8aa55bb Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Wed, 14 Mar 2018 11:29:49 -0600 Subject: [PATCH 4/7] CMakeLists: Restrict response file check to complex+double+Cuda Addresses issue #148. The check for CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS enabled is only necessary when complex+double+Cuda with ETI occurs. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3583363176..db2bfb99a0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,8 +75,8 @@ TRIBITS_ADD_OPTION_AND_DEFINE( LIST(APPEND DEVICE_LIST "") ENDIF() - IF((NOT DEFINED CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS) OR (NOT CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS)) - MESSAGE( FATAL_ERROR "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.") + IF( KokkosKernels_INST_DOUBLE AND Trilinos_ENABLE_COMPLEX_DOUBLE AND ((NOT DEFINED CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS) OR (NOT CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS)) ) + MESSAGE( FATAL_ERROR "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 and complex double enabled.") ENDIF() ENDIF() From 1a720ffea15444324a96e43624f0643b3fa20636 Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Wed, 14 Mar 2018 11:55:15 -0600 Subject: [PATCH 5/7] CMakeLists: Fix check for complex double Part of issue #148 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db2bfb99a0..0efa5a8b85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,7 @@ TRIBITS_ADD_OPTION_AND_DEFINE( LIST(APPEND DEVICE_LIST "") ENDIF() - IF( KokkosKernels_INST_DOUBLE AND Trilinos_ENABLE_COMPLEX_DOUBLE AND ((NOT DEFINED CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS) OR (NOT CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS)) ) + IF( Trilinos_ENABLE_COMPLEX_DOUBLE AND ((NOT DEFINED CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS) OR (NOT CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS)) ) MESSAGE( FATAL_ERROR "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 and complex double enabled.") ENDIF() From 2d7326d94233f6d2d7dc57a0e34e82901e4d45fd Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Wed, 14 Mar 2018 13:16:17 -0600 Subject: [PATCH 6/7] CMakeLists: Replace FATAL_ERROR with WARNING Changes to address issue #148 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0efa5a8b85..a73eb35815 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,7 @@ TRIBITS_ADD_OPTION_AND_DEFINE( 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)) ) - MESSAGE( FATAL_ERROR "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 and complex double enabled.") + MESSAGE( WARNING "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 and complex double enabled.") ENDIF() ENDIF() From 3f25e9f77202f5dcf9a3d81cec0e8f869bdc10f4 Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Wed, 14 Mar 2018 14:00:28 -0600 Subject: [PATCH 7/7] Update README for CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS usage --- README | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README b/README index 9b7291e993..297dc243e2 100644 --- a/README +++ b/README @@ -71,7 +71,7 @@ Building Kokkoskernels example/buildlib/compileKokkosKernels.sh for your environment and run it to generate the required makefiles. - KOKKOS_DEVICES can be as below. You can remove any backend - that you don't need. If cuda backend is used, CXX compiler should point to ${KOKKOS_PATH}/config/nvcc_wrapper. + that you don't need. If cuda backend is used, CXX compiler should point to ${KOKKOS_PATH}/bin/nvcc_wrapper. If you enable Cuda, a host space, either OpenMP or Serial should be enabled. KOKKOS_DEVICES=OpenMP,Serial,Cuda @@ -82,9 +82,24 @@ Building Kokkoskernels For the architecture flags, run below command. %: scripts/generate_makefile.bash --help + 2. Run "make build-test" to compile the tests. +Comments for building Trilinos with Kokkoskernels +---------------------- + - For Trilinos builds with the Cuda backend and complex double enabled with ETI, + the cmake option below may need to be set to avoid Error 127 errors: + CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS:BOOL=ON + + If the option above is not set, a warning will be issued during configuration: + + "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 and + complex double enabled." + + Using Kokkoskernels Test Drivers --------------------------