This issue is a result of a Codex global repository scan.
ENABLE_FLOAT_FFTW defaults to OFF, and the top-level build only links FFTW3::FFTW3_FLOAT when that option is enabled. However, FindFFTW3.cmake always searches for fftw3f and includes FFTW3_FLOAT_LIBRARY in find_package_handle_standard_args(), so double-precision-only FFTW installations can fail configure even when single-precision FFTW support is disabled.
Option and top-level link condition:
|
option(USE_ABACUS_LIBM "Build libmath from source to speed up" OFF) |
|
option(ENABLE_LIBXC "Enable using the LibXC package" OFF) |
|
option(ENABLE_FLOAT_FFTW "Enable using single-precision FFTW library." OFF) |
|
find_package(FFTW3 REQUIRED) |
|
find_package(Lapack REQUIRED) |
|
include_directories(${FFTW3_INCLUDE_DIRS}) |
|
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS) |
|
# ScaLAPACK is a distributed-memory library and is only needed for the |
|
# MPI build. A serial build (e.g. the native Windows serial version) |
|
# must not require it. |
|
if(ENABLE_MPI) |
|
find_package(ScaLAPACK REQUIRED) |
|
list(APPEND math_libs ScaLAPACK::ScaLAPACK) |
|
endif() |
|
if(USE_OPENMP) |
|
list(APPEND math_libs FFTW3::FFTW3_OMP) |
|
endif() |
|
if(ENABLE_FLOAT_FFTW) |
|
list(APPEND math_libs FFTW3::FFTW3_FLOAT) |
|
endif() |
Find module requirement:
|
find_library(FFTW3_FLOAT_LIBRARY |
|
NAMES fftw3f |
|
HINTS ${FFTW3_DIR} |
|
PATH_SUFFIXES "lib" |
|
) |
|
|
|
# both libfftw3.so and libfftw3_omp.so should be link in multi-thread term |
|
if (USE_OPENMP) |
|
find_library(FFTW3_OMP_LIBRARY |
|
NAMES fftw3_omp |
|
HINTS ${FFTW3_DIR} |
|
PATH_SUFFIXES "lib" |
|
) |
|
endif() |
|
|
|
# Handle the QUIET and REQUIRED arguments and |
|
# set FFTW3_FOUND to TRUE if all variables are non-zero. |
|
include(FindPackageHandleStandardArgs) |
|
if (USE_OPENMP) |
|
find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_OMP_LIBRARY FFTW3_LIBRARY FFTW3_FLOAT_LIBRARY FFTW3_INCLUDE_DIR) |
|
else() |
|
find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_FLOAT_LIBRARY FFTW3_INCLUDE_DIR) |
Relevant code:
find_library(FFTW3_FLOAT_LIBRARY NAMES fftw3f ...)
...
find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_FLOAT_LIBRARY FFTW3_INCLUDE_DIR)
Suggested fix:
Only search for and require FFTW3_FLOAT_LIBRARY when ENABLE_FLOAT_FFTW is enabled. Keep the imported FFTW3::FFTW3_FLOAT target conditional on that option as well.
This issue is a result of a Codex global repository scan.
ENABLE_FLOAT_FFTWdefaults toOFF, and the top-level build only linksFFTW3::FFTW3_FLOATwhen that option is enabled. However,FindFFTW3.cmakealways searches forfftw3fand includesFFTW3_FLOAT_LIBRARYinfind_package_handle_standard_args(), so double-precision-only FFTW installations can fail configure even when single-precision FFTW support is disabled.Option and top-level link condition:
abacus-develop/CMakeLists.txt
Lines 23 to 25 in 84ca04b
abacus-develop/CMakeLists.txt
Lines 630 to 646 in 84ca04b
Find module requirement:
abacus-develop/cmake/FindFFTW3.cmake
Lines 19 to 40 in 84ca04b
Relevant code:
Suggested fix:
Only search for and require
FFTW3_FLOAT_LIBRARYwhenENABLE_FLOAT_FFTWis enabled. Keep the importedFFTW3::FFTW3_FLOATtarget conditional on that option as well.