fix(fftw3) : Unify fftw3 build for linux and windows #10209
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 522 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.374
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #10209"
general
weight: 0.35
nunnikri
Motivation
#8527 fixed fftw3's broken SONAME on Linux by switching it to GNU Autotools, while Windows kept using upstream's own CMake build. #8874 then added SSE2/AVX/AVX2 SIMD codelet flags on top of that autotools path. The result is that
third-party/fftw3is the only module in the superbuild with two completely different build systems depending on platform. Divergent flags, divergent patch surfaces, and twice the maintenance burden every time fftw3 needs a bump or a new platform-specific fix.This PR reverts both #8527 and #8874's build-system changes and fixes the same underlying problems directly in upstream's own CMake build instead, so Linux and Windows share one build path, one set of patches, and one config output. No autotools, no second code path to maintain.
ISSUE ID : https://github.com/ROCm/TheRock/issues/7781
What changed
therock_cmake_subproject_declarepath, used on both platforms.amdrocm-fft-test's package restoration inpackage.jsonis deliberately not reverted.patches/third-party/fftw3/0001-fix-soversion-version-swap.patch: upstream'sset_target_properties(... SOVERSION 3.6.9 VERSION 3 ...)hasSOVERSION/VERSIONbackwards, so the linker embedslibfftw3.so.3.6.9as the SONAME instead oflibfftw3.so.3. No downstream package (and no system-provided fftw3) ships a library with that name, so anything linked against our build could never resolve the dependency against a normally-packaged fftw3. This was the original motivation for #8527's SONAME-targeted autotools switch.patches/third-party/fftw3/0002-relocatable-config.patch: upstream'sFFTW3Config.cmake.inbakes the build machine's absolute@CMAKE_INSTALL_FULL_LIBDIR@/@CMAKE_INSTALL_FULL_INCLUDEDIR@into the legacyFFTW3_LIBRARY_DIRS/FFTW3_INCLUDE_DIRSvariables, so a staged install copied elsewhere fails to resolve (#7781). Fixed with CMake's ownconfigure_package_config_file()/PATH_VARSmachinery.-DENABLE_SSE2/AVX/AVX2=ON); AVX-512 has no equivalent in upstream's CMake build and is left as a separate follow-up if ever needed.build_tools/packaging/linux/package.json:amdrocm-fft-test(which shipsrocfft-test/hipfft-test, link directly against GPL-licensedlibfftw3) was declaredLicense: MIT. Corrected toMIT AND GPL.Test plan / results
CI run: https://github.com/ROCm/TheRock/actions/runs/44941739592 — Linux (gfx90a, gfx94X-dcgpu) and Windows (gfx110X-all) math-libs builds, downstream DEB/RPM packaging, and "Trigger Test Artifacts" all completed with success
.Verified against the downloaded build artifacts from that run:
Relocatable config: FFTW3Config.cmake
generated from the patched template resolvesFFTW3_LIBRARY_DIRS/FFTW3_INCLUDE_DIRSvia@PACKAGE_INIT@→get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)— no build-machine absolute path baked in.FFTW3LibraryDepends.cmake/-release.cmakeare generated by upstream's owninstall(EXPORT)unchanged, with correct relocatable_IMPORT_PREFIXlogic.SONAME fix, at the library itself (readelf -d
):
SONAME fix, at the actual compiled/linked test binaries (readelf -d`) — the real end-to-end check, not just config metadata:
All four library variants resolve to the correct unversioned SONAME in two independent consumers.