Skip to content

Commit a9b11c8

Browse files
hjmjohnsonclaude
andcommitted
STYLE: Add SIMD status message and fix SSE forwarding to fftwd
- Add message(STATUS) showing detected FFTW SIMD flags at configure time so users can verify detection without inspecting the cache. - Remove ENABLE_SSE from the fftwd (double-precision) ExternalProject block; SSE1 codelets are float-only and have no effect on fftwd. - Document in the file header that option() defaults only apply on first configure and that ENABLE_SSE is not forwarded to fftwd. Addresses review comments from @greptile-apps on PR InsightSoftwareConsortium#6006. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 886494b commit a9b11c8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

CMake/itkExternal_FFTW.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
#
2828
# Every flag is an individually overridable cache option, e.g.:
2929
# cmake -DFFTW_ENABLE_AVX2=OFF ...
30+
# Note: option() defaults are only applied on the first configure.
31+
# To re-detect after a toolchain change, delete the CMake cache or use
32+
# cmake --fresh, or pass explicit -DFFTW_ENABLE_*= overrides.
33+
#
34+
# ENABLE_SSE (SSE1) is float-only and is not forwarded to the
35+
# double-precision fftwd build.
3036
#
3137
# These instructions follow the guidance provided for modern cmake usage as described:
3238
# https://github.com/dev-cafe/cmake-cookbook/blob/master/chapter-08/recipe-03/c-example/external/upstream/fftw3/CMakeLists.txt
@@ -145,6 +151,11 @@ if(NOT ITK_USE_SYSTEM_FFTW)
145151
${_fftw_default_avx2}
146152
)
147153

154+
message(
155+
STATUS
156+
"FFTW SIMD: NEON=${FFTW_ENABLE_NEON} SSE=${FFTW_ENABLE_SSE} SSE2=${FFTW_ENABLE_SSE2} AVX=${FFTW_ENABLE_AVX} AVX2=${FFTW_ENABLE_AVX2}"
157+
)
158+
148159
# Macro to generate library filename with appropriate prefix/suffix
149160
# Args: output_var library_base_name
150161
macro(_library_name_to_filename output_var library_base_name)
@@ -262,7 +273,7 @@ if(NOT ITK_USE_SYSTEM_FFTW)
262273
-DENABLE_AVX2:BOOL=${FFTW_ENABLE_AVX2} -DENABLE_FLOAT:BOOL=OFF
263274
-DENABLE_LONG_DOUBLE:BOOL=OFF -DENABLE_NEON:BOOL=${FFTW_ENABLE_NEON}
264275
-DENABLE_OPENMP:BOOL=OFF -DENABLE_QUAD_PRECISION:BOOL=OFF
265-
-DENABLE_SSE:BOOL=${FFTW_ENABLE_SSE}
276+
-DENABLE_SSE:BOOL=OFF # SSE1 codelets are 32-bit float only; no effect on double-precision
266277
-DENABLE_SSE2:BOOL=${FFTW_ENABLE_SSE2} -DENABLE_THREADS:BOOL=ON
267278
-DCMAKE_APPLE_SILICON_PROCESSOR:STRING=${CMAKE_APPLE_SILICON_PROCESSOR}
268279
-DCMAKE_C_COMPILER_LAUNCHER:PATH=${CMAKE_C_COMPILER_LAUNCHER}

0 commit comments

Comments
 (0)