forked from lijiext/lammps
Move KSPACE CMake configuration into its own file
This commit is contained in:
parent
e788d32678
commit
203c6d122b
|
@ -227,44 +227,7 @@ if(BUILD_OMP)
|
|||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||
endif()
|
||||
|
||||
if(PKG_KSPACE)
|
||||
option(FFT_SINGLE "Use single precision FFT instead of double" OFF)
|
||||
set(FFTW "FFTW3")
|
||||
if(FFT_SINGLE)
|
||||
set(FFTW "FFTW3F")
|
||||
add_definitions(-DFFT_SINGLE)
|
||||
endif()
|
||||
find_package(${FFTW} QUIET)
|
||||
if(${FFTW}_FOUND)
|
||||
set(FFT "${FFTW}" CACHE STRING "FFT library for KSPACE package")
|
||||
else()
|
||||
set(FFT "KISS" CACHE STRING "FFT library for KSPACE package")
|
||||
endif()
|
||||
set(FFT_VALUES KISS ${FFTW} MKL)
|
||||
set_property(CACHE FFT PROPERTY STRINGS ${FFT_VALUES})
|
||||
validate_option(FFT FFT_VALUES)
|
||||
string(TOUPPER ${FFT} FFT)
|
||||
if(NOT FFT STREQUAL "KISS")
|
||||
find_package(${FFT} REQUIRED)
|
||||
if(NOT FFT STREQUAL "FFTW3F")
|
||||
add_definitions(-DFFT_FFTW)
|
||||
else()
|
||||
add_definitions(-DFFT_${FFT})
|
||||
endif()
|
||||
include_directories(${${FFT}_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS ${${FFT}_LIBRARIES})
|
||||
else()
|
||||
add_definitions(-DFFT_KISS)
|
||||
endif()
|
||||
set(FFT_PACK "array" CACHE STRING "Optimization for FFT")
|
||||
set(FFT_PACK_VALUES array pointer memcpy)
|
||||
set_property(CACHE FFT_PACK PROPERTY STRINGS ${FFT_PACK_VALUES})
|
||||
validate_option(FFT_PACK FFT_PACK_VALUES)
|
||||
if(NOT FFT_PACK STREQUAL "array")
|
||||
string(TOUPPER ${FFT_PACK} FFT_PACK)
|
||||
add_definitions(-DFFT_PACK_${FFT_PACK})
|
||||
endif()
|
||||
endif()
|
||||
include(Packages/KSPACE)
|
||||
|
||||
if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-PLUMED OR PKG_USER-QUIP OR PKG_LATTE)
|
||||
find_package(LAPACK)
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
if(PKG_KSPACE)
|
||||
option(FFT_SINGLE "Use single precision FFT instead of double" OFF)
|
||||
set(FFTW "FFTW3")
|
||||
if(FFT_SINGLE)
|
||||
set(FFTW "FFTW3F")
|
||||
add_definitions(-DFFT_SINGLE)
|
||||
endif()
|
||||
find_package(${FFTW} QUIET)
|
||||
if(${FFTW}_FOUND)
|
||||
set(FFT "${FFTW}" CACHE STRING "FFT library for KSPACE package")
|
||||
else()
|
||||
set(FFT "KISS" CACHE STRING "FFT library for KSPACE package")
|
||||
endif()
|
||||
set(FFT_VALUES KISS ${FFTW} MKL)
|
||||
set_property(CACHE FFT PROPERTY STRINGS ${FFT_VALUES})
|
||||
validate_option(FFT FFT_VALUES)
|
||||
string(TOUPPER ${FFT} FFT)
|
||||
if(NOT FFT STREQUAL "KISS")
|
||||
find_package(${FFT} REQUIRED)
|
||||
if(NOT FFT STREQUAL "FFTW3F")
|
||||
add_definitions(-DFFT_FFTW)
|
||||
else()
|
||||
add_definitions(-DFFT_${FFT})
|
||||
endif()
|
||||
include_directories(${${FFT}_INCLUDE_DIRS})
|
||||
list(APPEND LAMMPS_LINK_LIBS ${${FFT}_LIBRARIES})
|
||||
else()
|
||||
add_definitions(-DFFT_KISS)
|
||||
endif()
|
||||
set(FFT_PACK "array" CACHE STRING "Optimization for FFT")
|
||||
set(FFT_PACK_VALUES array pointer memcpy)
|
||||
set_property(CACHE FFT_PACK PROPERTY STRINGS ${FFT_PACK_VALUES})
|
||||
validate_option(FFT_PACK FFT_PACK_VALUES)
|
||||
if(NOT FFT_PACK STREQUAL "array")
|
||||
string(TOUPPER ${FFT_PACK} FFT_PACK)
|
||||
add_definitions(-DFFT_PACK_${FFT_PACK})
|
||||
endif()
|
||||
endif()
|
Loading…
Reference in New Issue