added FFTW2 support

This commit is contained in:
Christoph Junghans 2017-07-19 15:33:02 -06:00
parent a99e3ef4f0
commit babba1870e
2 changed files with 31 additions and 11 deletions

View File

@ -116,17 +116,15 @@ if(ENABLE_USER-OMP OR ENABLE_KOKKOS OR ENABLE_USER-INTEL)
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()
foreach(FFT FFTW3 MKL FFTW2)
find_package(${FFT})
if(${FFT}_FOUND)
add_definitions(-DFFT_${FFT})
include_directories(${${FFT}_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${${FFT}_LIBRARIES})
break()
endif()
endforeach()
set(PACK_OPTIMIZATION "PACK_ARRAY" CACHE STRING "Optimization for FFT")
set_property(CACHE LAMMPS_SIZE_LIMIT PROPERTY STRINGS PACK_ARRAY PACK_POINTER PACK_MEMCPY)
if(NOT PACK_OPTIMIZATION STREQUAL "PACK_ARRAY")

View File

@ -0,0 +1,22 @@
# - Find fftw2
# Find the native FFTW2 headers and libraries.
#
# FFTW2_INCLUDE_DIRS - where to find fftw2.h, etc.
# FFTW2_LIBRARIES - List of libraries when using fftw2.
# FFTW2_FOUND - True if fftw2 found.
#
find_path(FFTW2_INCLUDE_DIR fftw.h)
find_library(FFTW2_LIBRARY NAMES fftw)
set(FFTW2_LIBRARIES ${FFTW2_LIBRARY})
set(FFTW2_INCLUDE_DIRS ${FFTW2_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set FFTW2_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(FFTW2 DEFAULT_MSG FFTW2_LIBRARY FFTW2_INCLUDE_DIR)
mark_as_advanced(FFTW2_INCLUDE_DIR FFTW2_LIBRARY )