Unverified Commit 469a4f15 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

some tweaks to simplify building the KOKKOS package and to enforce consistent behavior

parent e39faf4f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -123,6 +123,10 @@ else()
  endif()
  add_executable(lammps ${ALL_SOURCES})
  set_target_properties(lammps PROPERTIES OUTPUT_NAME ${LAMMPS_BINARY})
  if(Kokkos_ENABLE_CUDA)
    # The Kokkos nvcc wrapper does not like -std=gnu++11 and wants -std=c++11
    set_target_properties(lammps PROPERTIES CXX_EXTENSIONS OFF)
  endif()
  install(TARGETS lammps DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

@@ -257,6 +261,10 @@ if(BUILD_OMP)
    message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support")
  endif()
  target_link_libraries(lammps PRIVATE OpenMP::OpenMP_CXX)
else()
  if(Kokkos_ENABLE_OPENMP)
    message(FATAL_ERROR "Must enable BUILD_OMP with Kokkos_ENABLE_OPENMP")
  endif()
endif()

if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE)
+4 −0
Original line number Diff line number Diff line
@@ -31,6 +31,10 @@ 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