From e4e41375fced75f3b6141e5017662b78534b3fc3 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Thu, 21 Aug 2025 09:54:02 +0800 Subject: [PATCH] obey system build flags (cherry picked from commit 0685d33486b51d3d8063ac9ed4e0f525a1c93f19) --- fftw-obey-system-build-flags.patch | 42 ++++++++++++++++++++++ fftw.spec | 56 ++++++++++-------------------- fftw.yaml | 2 +- fix_autotools_build.patch | 28 +++++++++++++++ 4 files changed, 90 insertions(+), 38 deletions(-) create mode 100644 fftw-obey-system-build-flags.patch create mode 100644 fix_autotools_build.patch diff --git a/fftw-obey-system-build-flags.patch b/fftw-obey-system-build-flags.patch new file mode 100644 index 0000000..c91f64f --- /dev/null +++ b/fftw-obey-system-build-flags.patch @@ -0,0 +1,42 @@ +From a7cfe545ecfbe069b917fd29e1a57a2887ecbfc6 Mon Sep 17 00:00:00 2001 +From: Funda Wang +Date: Thu, 21 Aug 2025 08:36:40 +0800 +Subject: [PATCH] obey system build flags + +--- + m4/ax_cc_maxopt.m4 | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/m4/ax_cc_maxopt.m4 b/m4/ax_cc_maxopt.m4 +index 61d3a98..1d7e0d2 100644 +--- a/m4/ax_cc_maxopt.m4 ++++ b/m4/ax_cc_maxopt.m4 +@@ -27,7 +27,6 @@ AC_REQUIRE([AC_CANONICAL_HOST]) + + # Try to determine "good" native compiler flags if none specified via CFLAGS + if test "$ac_test_CFLAGS" != "set"; then +- CFLAGS="" + case $ax_cv_c_compiler_vendor in + dec) CFLAGS="-newc -w0 -O5 -ansi_alias -ansi_args -fp_reorder -tune host" + ;; +@@ -62,7 +61,7 @@ if test "$ac_test_CFLAGS" != "set"; then + ;; + + clang) +- CFLAGS="-O3 -fomit-frame-pointer" ++ CFLAGS="$CFLAGS -O3 -fomit-frame-pointer" + AX_CHECK_COMPILER_FLAGS(-mtune=native, CFLAGS="$CFLAGS -mtune=native") + AX_CHECK_COMPILER_FLAGS(-fstrict-aliasing,CFLAGS="$CFLAGS -fstrict-aliasing") + ;; +@@ -70,7 +69,7 @@ if test "$ac_test_CFLAGS" != "set"; then + gnu) + # Default optimization flags for gcc on all systems. + # Somehow -O3 does not imply -fomit-frame-pointer on ia32 +- CFLAGS="-O3 -fomit-frame-pointer" ++ CFLAGS="$CFLAGS -O3 -fomit-frame-pointer" + + # tune for the host by default + AX_CHECK_COMPILER_FLAGS(-mtune=native, CFLAGS="$CFLAGS -mtune=native") +-- +2.50.1 + diff --git a/fftw.spec b/fftw.spec index 752a766..ba75c69 100644 --- a/fftw.spec +++ b/fftw.spec @@ -1,4 +1,3 @@ -%define debug_package %{nil} %bcond_with openmpi %bcond_with mpich @@ -11,11 +10,14 @@ Name: fftw Version: 3.3.10 -Release: 2 +Release: 3 Summary: A C subroutine library for computing the discrete Fourier transform -License: GPLv2+ -URL: http://www.fftw.org -Source0: http://www.fftw.org/fftw-%{version}.tar.gz +License: GPL-2.0-or-later +URL: https://www.fftw.org +Source0: https://www.fftw.org/fftw-%{version}.tar.gz +Patch0: fftw-obey-system-build-flags.patch +# https://github.com/FFTW/fftw3/pull/346 +Patch1: fix_autotools_build.patch BuildRequires: gcc-gfortran autoconf automake libtool time perl-interpreter gcc_secure make %global quad 0 @@ -36,9 +38,6 @@ BuildRequires: openmpi-devel BuildRequires: environment-modules %endif -Requires(post): info -Requires(preun): info - %description This package is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST). @@ -226,7 +225,14 @@ mkdir single double long quad siarch=(--enable-single --enable-sse2 --enable-avx --enable-avx2) build_section "${siarch[@]}" cd ../double - diarch=(--enable-double --enable-sse2 --enable-avx --enable-avx2) + diarch=(--disable-single --enable-sse2 --enable-avx --enable-avx2) + build_section "${diarch[@]}" +%elifarch aarch64 + cd single + siarch=(--enable-single --enable-neon) + build_section "${siarch[@]}" + cd ../double + diarch=(--disable-single --enable-neon) build_section "${diarch[@]}" %else cd single @@ -289,8 +295,6 @@ source /etc/profile.d/modules.sh %make_install -C quad %endif -%global delete_la find $RPM_BUILD_ROOT -type f -name "*.la" -delete - %if %{with mpich} || %{with openmpi} for mpi in %{mpi_list} do @@ -305,9 +309,6 @@ done rm -f %{buildroot}%{_infodir}/dir %delete_la -find %{buildroot} -type f -name '*.so*' -exec strip '{}' ';' -find %{buildroot} -type f -name 'fftw*-wisdom*' -exec strip '{}' ';' - %check %if %{with mpich} || %{with openmpi} source /etc/profile.d/modules.sh @@ -339,33 +340,10 @@ do done %endif -%post libs-single -p /sbin/ldconfig -%postun libs-single -p /sbin/ldconfig -%post libs-double -p /sbin/ldconfig -%postun libs-double -p /sbin/ldconfig -%post libs-long -p /sbin/ldconfig -%postun libs-long -p /sbin/ldconfig - -%if %{quad} -%post libs-quad -p /sbin/ldconfig -%postun libs-quad -p /sbin/ldconfig -%endif - -%post devel -/sbin/install-info --section="Math" %{_infodir}/%{name}.info.gz %{_infodir}/dir 2>/dev/null || : - -%preun devel -if [ "$1" = 0 ] -then - /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir 2>/dev/null || : -fi - %files %{_bindir}/fftw*-wisdom* -%exclude /usr/lib/debug/usr/bin/fftw*-wisdom* %files libs -%exclude /usr/lib/debug/usr/lib64/ %files libs-single %license COPYING COPYRIGHT @@ -462,6 +440,10 @@ fi %endif %changelog +* Thu Aug 21 2025 Funda Wang - 3.3.10-3 +- obey system build flags +- enable neon for aarch64 + * Tue Jul 15 2025 yaoxin <1024769339@qq.com> - 3.3.10-2 - Add AVX2 support diff --git a/fftw.yaml b/fftw.yaml index e4e1a0f..e2ad035 100644 --- a/fftw.yaml +++ b/fftw.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: FFTW/fftw3 tag_prefix: ^fftw- -seperator: . +separator: . diff --git a/fix_autotools_build.patch b/fix_autotools_build.patch new file mode 100644 index 0000000..2854762 --- /dev/null +++ b/fix_autotools_build.patch @@ -0,0 +1,28 @@ +From 3e0effdd08b629c2242ef37c022cefd3bd2d8c02 Mon Sep 17 00:00:00 2001 +From: Marc Perache +Date: Wed, 24 Jan 2024 11:25:51 +0100 +Subject: [PATCH] Update FFTW3Config.cmake.in + +Fixes FFTW/fftw3/issues/130 +as proposed by @sergiomb2 and @ferdnyc + +Update FFTW3Config.cmake.in +--- + FFTW3Config.cmake.in | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/FFTW3Config.cmake.in b/FFTW3Config.cmake.in +index 6b1fbc2e1..b5aa4f39c 100644 +--- a/FFTW3Config.cmake.in ++++ b/FFTW3Config.cmake.in +@@ -10,7 +10,9 @@ set (FFTW3@PREC_SUFFIX@_LIBRARIES fftw3@PREC_SUFFIX@) + set (FFTW3@PREC_SUFFIX@_LIBRARY_DIRS @CMAKE_INSTALL_FULL_LIBDIR@) + set (FFTW3@PREC_SUFFIX@_INCLUDE_DIRS @CMAKE_INSTALL_FULL_INCLUDEDIR@) + +-include ("${CMAKE_CURRENT_LIST_DIR}/FFTW3LibraryDepends.cmake") ++if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/FFTW3LibraryDepends.cmake") ++ include ("${CMAKE_CURRENT_LIST_DIR}/FFTW3LibraryDepends.cmake") ++endif () + + if (CMAKE_VERSION VERSION_LESS 2.8.3) + set (CMAKE_CURRENT_LIST_DIR) -- Gitee