Tweak FindFFTW API checks
authorSzilárd Páll <pall.szilard@gmail.com>
Sun, 7 Oct 2018 21:16:18 +0000 (23:16 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Mon, 8 Oct 2018 22:01:03 +0000 (00:01 +0200)
FindFFTW.cmake used to check an fftw API function's existance that we
don't even use. This change swaps the check with three checks for
fftw?__plan_many_dft, fftw?_plan_many_dft_r2c, and
fftw?__plan_many_dft_c2r.

Change-Id: I75283359e763ce2c1fdc75a2011166af2a986c95

cmake/FindFFTW.cmake

index afee8a06755852edc755628a2a57fe233ade5950..fc8439f2c761ac16fb95bc3e0d643c8d28271250 100644 (file)
@@ -96,9 +96,13 @@ if (${FFTW}_FOUND)
   if (FFTW_LIBRARY_CHANGED)
     unset(FOUND_${FFTW}_PLAN CACHE)
   endif()
-  check_library_exists("${${FFTW}_LIBRARIES}" "${${FFTW}_FUNCTION_PREFIX}_plan_r2r_1d" "" FOUND_${FFTW}_PLAN)
-  if(NOT FOUND_${FFTW}_PLAN)
-    message(FATAL_ERROR "Could not find ${${FFTW}_FUNCTION_PREFIX}_plan_r2r_1d in ${${FFTW}_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what went wrong. If you are using a static lib (.a) make sure you have specified all dependencies of ${${FFTW}_PKG} in ${FFTW}_LIBRARY by hand (e.g. -D${FFTW}_LIBRARY='/path/to/lib${${FFTW}_PKG}.so;/path/to/libm.so') !")
+  check_library_exists("${${FFTW}_LIBRARIES}" "${${FFTW}_FUNCTION_PREFIX}_plan_many_dft"     "" FOUND_${FFTW}_PLAN_MANY)
+  check_library_exists("${${FFTW}_LIBRARIES}" "${${FFTW}_FUNCTION_PREFIX}_plan_many_dft_r2c" "" FOUND_${FFTW}_PLAN_MANY_R2C)
+  check_library_exists("${${FFTW}_LIBRARIES}" "${${FFTW}_FUNCTION_PREFIX}_plan_many_dft_c2r" "" FOUND_${FFTW}_PLAN_MANY_C2R)
+  if(NOT (FOUND_${FFTW}_PLAN_MANY AND
+      FOUND_${FFTW}_PLAN_MANY_R2C AND
+      FOUND_${FFTW}_PLAN_MANY_C2R))
+      message(FATAL_ERROR "Could not find ${${FFTW}_FUNCTION_PREFIX}_plan_many_[r2c|c2r] in ${${FFTW}_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what went wrong. If you are using a static lib (.a) make sure you have specified all dependencies of ${${FFTW}_PKG} in ${FFTW}_LIBRARY by hand (e.g. -D${FFTW}_LIBRARY='/path/to/lib${${FFTW}_PKG}.so;/path/to/libm.so') !")
   endif()
 
   # Check for FFTW3 compiled with --enable-sse