SP: CMake template for RAJA examples fixed!
cmake_minimum_required(VERSION 2.8)
# Specify project name
-PROJECT(@SOLVER@_CXX_serial_examples CXX)
+PROJECT(@SOLVER@_CXX_serial_examples)
+
+set(CMAKE_CXX_STANDARD 11)
+find_package(CUDA)
+
+SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} @RAJA_NVCC_FLAGS@)
MARK_AS_ADVANCED(EXECUTABLE_OUTPUT_PATH LIBRARY_OUTPUT_PATH)
@@ -52,7 +57,7 @@ FIND_LIBRARY(SUNDIALS_SOLVER_LIB
# Find the NVECTOR library
FIND_LIBRARY(SUNDIALS_NVEC_LIB
- sundials_nvecserial ${SUNDIALS_LIB_DIR}
+ sundials_nvecraja ${SUNDIALS_LIB_DIR}
DOC "NVECTOR library")
# Set additional libraries
@@ -71,6 +76,9 @@ SET(KLU_LIBRARIES @KLU_LIBRARIES@ CACHE STRING "KLU libraries")
INCLUDE_DIRECTORIES(@PETSC_INCLUDE_DIR@)
SET(PETSC_LIBRARIES @PETSC_LIBRARIES@ CACHE STRING "PETSC libraries")
+INCLUDE_DIRECTORIES(@RAJA_INCLUDE_DIR@)
+SET(RAJA_LIBRARIES @RAJA_LIBRARIES@ CACHE STRING "RAJA libraries")
+
# List of all libraries
SET(SUNDIALS_LIBS ${SUNDIALS_SOLVER_LIB} ${SUNDIALS_NVEC_LIB} ${SUNDIALS_EXTRA_LIB})
IF(LAPACK_LIBRARIES)
@@ -92,8 +100,10 @@ IF(PETSC_LIBRARIES)
LIST(APPEND SUNDIALS_LIBS ${PETSC_LIBRARIES})
ENDIF(PETSC_LIBRARIES)
+#LIST(APPEND SUNDIALS_LIBS ${RAJA_LIBRARIES})
+
# Build each example one by one
FOREACH(example ${examples})
- ADD_EXECUTABLE(${example} ${example}.cpp)
- TARGET_LINK_LIBRARIES(${example} ${SUNDIALS_LIBS})
+ CUDA_ADD_EXECUTABLE(${example} ${example}.cu)
+ TARGET_LINK_LIBRARIES(${example} ${SUNDIALS_LIBS} -L@RAJA_LIB_DIR@ -lRAJA)
ENDFOREACH(example ${examples})
