From 7c5adccfe76b72420d36554aa51413938faeae37 Mon Sep 17 00:00:00 2001 From: Marco Barbone Date: Tue, 20 May 2025 11:02:52 -0400 Subject: [PATCH] Fixed --- CMakeLists.txt | 2 +- cmake/setupFFTW.cmake | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be8de6a96..bb4285a5e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ option(FINUFFT_USE_DUCC0 "Whether to use DUCC0 (instead of FFTW) for CPU FFTs" O option(FINUFFT_BUILD_DOCS "Whether to build the FINUFFT documentation" OFF) # if FINUFFT_USE_DUCC0 is ON, the following options are ignored set(FINUFFT_FFTW_LIBRARIES "DEFAULT" CACHE STRING "Specify a custom FFTW library") -set(FINUFFT_FFTW_SUFFIX "OpenMP" CACHE STRING "Suffix for FFTW libraries (e.g. OpenMP, Threads etc.)") +set(FINUFFT_FFTW_SUFFIX "DEFAULT" CACHE STRING "Suffix for FFTW libraries (e.g. OpenMP, Threads etc.) defaults to empty string if OpenMP is disabled, else uses OpenMP. Ignored if DUCC0 is used.") # if FINUFFT_USE_CPU is OFF, the following options are ignored set(FINUFFT_ARCH_FLAGS "native" CACHE STRING "Compiler flags for specifying target architecture, defaults to -march=native") # sphinx tag (don't remove): @cmake_opts_end diff --git a/cmake/setupFFTW.cmake b/cmake/setupFFTW.cmake index 3e6d88063..e6eb36619 100644 --- a/cmake/setupFFTW.cmake +++ b/cmake/setupFFTW.cmake @@ -81,11 +81,16 @@ if(FINUFFT_FFTW_LIBRARIES STREQUAL DEFAULT OR FINUFFT_FFTW_LIBRARIES STREQUAL DO target_include_directories(fftw3 PUBLIC $) else() - set(FINUFFT_FFTW_LIBRARIES - "FFTW::Float" - "FFTW::Double" - "FFTW::Float${FINUFFT_FFTW_SUFFIX}" - "FFTW::Double${FINUFFT_FFTW_SUFFIX}" - ) + # link against single thread fftw + set(FINUFFT_FFTW_LIBRARIES "FFTW::Float" "FFTW::Double") + # default behavior + if(FINUFFT_FFTW_SUFFIX STREQUAL "DEFAULT") + if(FINUFFT_USE_OPENMP) + list(APPEND FINUFFT_FFTW_LIBRARIES "FFTW::FloatOpenMP" "FFTW::DoubleOpenMP") + endif() + else() + # user override + list(APPEND FINUFFT_FFTW_LIBRARIES "FFTW::Float${FINUFFT_FFTW_SUFFIX}" "FFTW::Double${FINUFFT_FFTW_SUFFIX}") + endif() endif() endif()