set using C++11 w/o extensions globally. move KOKKOS only checks to KOKKOS.cmake

This commit is contained in:
Axel Kohlmeyer
2020-04-10 12:16:24 -04:00
parent c83dfd2b22
commit 28379e145f
2 changed files with 14 additions and 13 deletions

View File

@ -1,3 +1,15 @@
########################################################################
# consistency checks and Kokkos options/settings required by LAMMPS
if(Kokkos_ENABLE_CUDA)
set(Kokkos_ENABLE_CUDA_LAMBDA ON)
endif()
# Adding OpenMP compiler flags without the checks done for
# BUILD_OMP can result in compile failures. Enforce consistency.
if(Kokkos_ENABLE_OPENMP AND NOT BUILD_OMP)
message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
endif()
########################################################################
option(EXTERNAL_KOKKOS "Build against external kokkos library" OFF)
option(DOWNLOAD_KOKKOS "Download the KOKKOS library instead of using the bundled one" OFF)
if(DOWNLOAD_KOKKOS)
@ -31,10 +43,6 @@ elseif(EXTERNAL_KOKKOS)
else()
set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos)
set(LAMMPS_LIB_KOKKOS_BIN_DIR ${LAMMPS_LIB_BINARY_DIR}/kokkos)
# enforce using nvcc_wrapper as compiler wrapper
if(Kokkos_ENABLE_CUDA)
set(CMAKE_CXX_COMPILER ${LAMMPS_LIB_KOKKOS_SRC_DIR}/bin/nvcc_wrapper CACHE FILEPATH "Path to nvcc wrapper for Kokkos with CUDA" FORCE)
endif()
add_subdirectory(${LAMMPS_LIB_KOKKOS_SRC_DIR} ${LAMMPS_LIB_KOKKOS_BIN_DIR})
set(Kokkos_INCLUDE_DIRS ${LAMMPS_LIB_KOKKOS_SRC_DIR}/core/src