Wiped out FFTW variants

This commit is contained in:
Daniele Cesarini 2020-10-22 10:28:57 +02:00
parent 67df0df152
commit c9b833344a
3 changed files with 19 additions and 60 deletions

View File

@ -85,14 +85,6 @@ option(QE_ENABLE_VENDOR_DEPS
"enable fallback on vendored deps when none is found via find_package()" ON)
option(QE_ENABLE_DOC
"enable documentation building" OFF)
option(QE_FFTW_SINGLE
"enable single precision FFTW library" OFF)
option(QE_FFTW_DOUBLE
"enable double precision FFTW library" ON)
option(QE_FFTW_QUAD
"enable quad precision FFTW library" OFF)
option(QE_FFTW_CONF
"FFTW can be accelerated using OpenMP or MPI. It is possible to use thread-safe routines [OPENMP, MPI, THREADS]" OFF)
# TODO change all ifdefs throughout code base to match
# cmake options
@ -127,9 +119,6 @@ endif()
if(QE_ENABLE_HDF5)
qe_add_global_compile_definitions(__HDF5)
endif()
if(QE_ENABLE_OPENMP)
set(QE_FFTW_CONF "OPENMP")
endif()
# Feature checks
check_function_exists(mallinfo HAVE_MALLINFO)
@ -144,17 +133,6 @@ endif()
if(QE_ENABLE_SCALAPACK AND NOT QE_ENABLE_MPI)
message(FATAL_ERROR "SCALAPACK requires MPI support, enable it with '-DQE_ENABLE_MPI=ON' or disable SCALAPACK with '-DQE_ENABLE_SCALAPACK=OFF'")
endif()
if(QE_FFTW_QUAD AND (QE_FFTW_CONF STREQUAL "MPI"))
message(FATAL_ERROR "FFTW quad precision is not supported in MPI")
endif()
if(QE_FFTW_CONF)
string(TOUPPER ${QE_FFTW_CONF} QE_FFTW_CONF)
if((NOT QE_FFTW_CONF STREQUAL "OPENMP") AND
(NOT QE_FFTW_CONF STREQUAL "MPI") AND
(NOT QE_FFTW_CONF STREQUAL "THREADS"))
message(FATAL_ERROR "QE_FFTW_CONF can have only the following values: OPENMP, MPI, and THREADS")
endif()
endif()
# if(QE_ENABLE_HDF5 AND NOT QE_ENABLE_MPI)
# message(FATAL_ERROR "HDF5 requires MPI support, enable it with '-DQE_ENABLE_MPI=ON' or disable HDF5 with '-DQE_ENABLE_HDF5=OFF'")
# endif()

View File

@ -8,10 +8,6 @@ qe_install_targets(qe_fft)
# Try to find a vendor FFTW
find_package(VendorFFTW)
if(VendorFFTW_FOUND)
if(QE_FFTW_QUAD)
message(FATAL_ERROR "FFTW quad precision is not supported in vendor FFTW")
endif()
if(VendorFFTW_ID STREQUAL "Intel")
qe_add_global_compile_definitions(__DFTI)
set(qe_fft_wrappers fft_scalar.DFTI.f90)
@ -25,49 +21,27 @@ if(VendorFFTW_FOUND)
target_link_libraries(qe_fft INTERFACE VendorFFTW)
else()
# Try to find a vendor FFTW3
message("-- No vendor FFTW found")
# Try to find the official FFTW3
message(STATUS "No vendor FFTW found")
set(FFTW_COMPS)
if(QE_FFTW_SINGLE)
if(QE_FFTW_CONF)
list(APPEND FFTW_COMPS "FLOAT_${QE_FFTW_CONF}")
else()
list(APPEND FFTW_COMPS "FLOAT")
endif()
endif()
if(QE_FFTW_DOUBLE)
if(QE_FFTW_CONF)
list(APPEND FFTW_COMPS "DOUBLE_${QE_FFTW_CONF}")
else()
list(APPEND FFTW_COMPS "DOUBLE")
endif()
endif()
if(QE_FFTW_QUAD)
if(QE_FFTW_CONF)
list(APPEND FFTW_COMPS "LONGDOUBLE_${QE_FFTW_CONF}")
else()
list(APPEND FFTW_COMPS "LONGDOUBLE")
endif()
if(QE_ENABLE_OPENMP)
find_package(FFTW COMPONENTS DOUBLE_OPENMP)
else()
find_package(FFTW COMPONENTS DOUBLE)
endif()
find_package(FFTW COMPONENTS ${FFTW_COMPS})
if(FFTW_FOUND)
qe_add_global_compile_definitions(__FFTW3)
set(qe_fft_wrappers fft_scalar.FFTW3.f90)
target_link_libraries(qe_fft INTERFACE FFTW)
else()
message("-- No FFTW3 library found")
# Cannot find anything useful, just fall back to the internal FFTW
message(STATUS "No FFTW3 library found. FFTW is falling back to QE internal implementation (FFTXLib)")
qe_add_global_compile_definitions(__FFTW)
set(qe_fft_wrappers fft_scalar.FFTW.f90)
endif()
endif()
# Cannot find anything useful, just fall back to the internal FFTW
if(NOT VendorFFTW_FOUND AND NOT FFTW_FOUND)
message(STATUS "FFTW is falling back to QE internal implementation (FFTXLib)")
qe_add_global_compile_definitions(__FFTW)
set(qe_fft_wrappers fft_scalar.FFTW.f90)
endif()
set(f_sources
fft_scatter.f90
fft_scatter_2d.f90

View File

@ -36,7 +36,10 @@ if(LAPACK_FOUND)
set(VendorFFTW_ID "Intel")
break()
# FIXME: undefined reference to `zfft1mx_'
## FIXME: In the 'fft_scalar.ARM_LIB.f90' should be removed the call to the subroutine 'zfft1mx'
## otherwise the ARMPL throw the following error: undefined reference to `zfft1mx_'
## This subroutine is not more implemented in the ARMPL (ARMPL misses the symbol)
##
# elseif(_lib MATCHES "armpl")
# get_filename_component(_dir_l1 ${_lib} DIRECTORY)
# get_filename_component(_dir_l2 ${_dir_l1} DIRECTORY)
@ -88,6 +91,10 @@ if(LAPACK_FOUND)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VendorFFTW REQUIRED_VARS VendorFFTW_LIBRARIES VendorFFTW_INCLUDE_DIRS VendorFFTW_ID)
find_package_handle_standard_args(VendorFFTW
REQUIRED_VARS
VendorFFTW_LIBRARIES
VendorFFTW_INCLUDE_DIRS
VendorFFTW_ID)
mark_as_advanced(VendorFFTW_LIBRARIES VendorFFTW_ID)