added MKL support
This commit is contained in:
@ -117,14 +117,21 @@ endif()
|
||||
|
||||
if(ENABLE_KSPACE)
|
||||
find_package(FFTW3)
|
||||
find_package(MKL)
|
||||
if(FFTW3_FOUND)
|
||||
add_definitions(-DFFT_FFTW3)
|
||||
include_directories(${FFTW3_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS ${FFTW3_LIBRARIES})
|
||||
elseif(MKL_FOUND)
|
||||
add_definitions(-DFFT_MKL)
|
||||
include_directories(${MKL_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS ${MKL_LIBRARIES})
|
||||
endif()
|
||||
set(PACK_OPTIMIZATION "PACK_ARRAY" CACHE STRING "Optimization for FFT")
|
||||
set_property(CACHE LAMMPS_SIZE_LIMIT PROPERTY STRINGS PACK_ARRAY PACK_POINTER PACK_MEMCPY)
|
||||
add_definitions(-D${PACK_OPTIMIZATION})
|
||||
if(NOT PACK_OPTIMIZATION STREQUAL "PACK_ARRAY")
|
||||
add_definitions(-D${PACK_OPTIMIZATION})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_MISC)
|
||||
|
||||
22
cmake/Modules/FindMKL.cmake
Normal file
22
cmake/Modules/FindMKL.cmake
Normal file
@ -0,0 +1,22 @@
|
||||
# - Find mkl
|
||||
# Find the native MKL headers and libraries.
|
||||
#
|
||||
# MKL_INCLUDE_DIRS - where to find mkl.h, etc.
|
||||
# MKL_LIBRARIES - List of libraries when using mkl.
|
||||
# MKL_FOUND - True if mkl found.
|
||||
#
|
||||
|
||||
find_path(MKL_INCLUDE_DIR mkl_dfti.h HINTS $ENV{MKLROOT}/include)
|
||||
|
||||
find_library(MKL_LIBRARY NAMES mkl_rt HINTS $ENV{MKLROOT}/lib $ENV{MKLROOT}/lib/intel64)
|
||||
|
||||
set(MKL_LIBRARIES ${MKL_LIBRARY})
|
||||
set(MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIR})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
# handle the QUIETLY and REQUIRED arguments and set MKL_FOUND to TRUE
|
||||
# if all listed variables are TRUE
|
||||
|
||||
find_package_handle_standard_args(MKL DEFAULT_MSG MKL_LIBRARY MKL_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(MKL_INCLUDE_DIR MKL_LIBRARY )
|
||||
Reference in New Issue
Block a user