pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/math/fftw



Module Name:    pkgsrc
Committed By:   nia
Date:           Sat May 15 11:05:30 UTC 2021

Modified Files:
        pkgsrc/math/fftw: Makefile buildlink3.mk options.mk

Log Message:
fftw: clean up funrolling, make avx into a package option


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 pkgsrc/math/fftw/Makefile
cvs rdiff -u -r1.10 -r1.11 pkgsrc/math/fftw/buildlink3.mk
cvs rdiff -u -r1.5 -r1.6 pkgsrc/math/fftw/options.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/math/fftw/Makefile
diff -u pkgsrc/math/fftw/Makefile:1.70 pkgsrc/math/fftw/Makefile:1.71
--- pkgsrc/math/fftw/Makefile:1.70      Sat May 15 10:19:33 2021
+++ pkgsrc/math/fftw/Makefile   Sat May 15 11:05:29 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.70 2021/05/15 10:19:33 nia Exp $
+# $NetBSD: Makefile,v 1.71 2021/05/15 11:05:29 nia Exp $
 
 DISTNAME=      fftw-3.3.9
 PKGREVISION=   5
@@ -49,31 +49,17 @@ CONFIGURE_DIRS+=    build/${p}
 MAKE_DIRS+=            build/${p}
 .endfor
 
-# SIMD stuff needs some baseline.
-GCC_REQD+=     4.9
-
-# FFTW offers SIMD runtime detection, but wants explicit build options.
-# These should be generic for all platforms. Compiler needs intrinsics
-# for this, but those have been present for quite some time.
-FFTW_FLOAT_OPTS=       --enable-generic-simd128 --enable-generic-simd256
-FFTW_DOUBLE_OPTS=      --enable-generic-simd128 --enable-generic-simd256
+# Generic compiler vector abstractions.
+.if !empty(PKGSRC_COMPILER:M*gcc*) || !empty(PKGSRC_COMPILER:M*clang*)
+FFTW_FLOAT_OPTS+=      --enable-generic-simd128 --enable-generic-simd256
+FFTW_DOUBLE_OPTS+=     --enable-generic-simd128 --enable-generic-simd256
+.endif
 
 .if ${MACHINE_ARCH} == "x86_64"
-FFTW_FLOAT_OPTS+=      --enable-sse --enable-sse2 --enable-avx
-FFTW_DOUBLE_OPTS+=     --enable-sse2 --enable-avx
-FFTW_FLOAT_OPTS+=      --enable-avx2 --enable-avx512 --enable-avx-128-fma
-FFTW_DOUBLE_OPTS+=     --enable-avx2 --enable-avx512 --enable-avx-128-fma
+FFTW_FLOAT_OPTS+=      --enable-sse --enable-sse2
+FFTW_DOUBLE_OPTS+=     --enable-sse2
 .endif
 
-# TODO: Add the above for other architectures.
-
-# Avoid -march=core-avx2 messing up with user CFLAGS.
-# This rules out gcc 4.8 for AVX2 builds.
-SUBST_CLASSES+=                hardcore
-SUBST_STAGE.hardcore=  pre-configure
-SUBST_FILES.hardcore=  configure configure.ac
-SUBST_SED.hardcore=    -e "s,march=core-avx2,march=donotbother,g"
-
 pre-configure:
 .for d in ${CONFIGURE_DIRS}
        mkdir -p ${WRKSRC:Q}/${d}

Index: pkgsrc/math/fftw/buildlink3.mk
diff -u pkgsrc/math/fftw/buildlink3.mk:1.10 pkgsrc/math/fftw/buildlink3.mk:1.11
--- pkgsrc/math/fftw/buildlink3.mk:1.10 Sat May 15 10:19:33 2021
+++ pkgsrc/math/fftw/buildlink3.mk      Sat May 15 11:05:29 2021
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.10 2021/05/15 10:19:33 nia Exp $
+# $NetBSD: buildlink3.mk,v 1.11 2021/05/15 11:05:29 nia Exp $
 
 BUILDLINK_TREE+=       fftw
 
@@ -9,8 +9,6 @@ BUILDLINK_API_DEPENDS.fftw+=    fftw>=3.0
 BUILDLINK_ABI_DEPENDS.fftw+=   fftw>=3.1nb1
 BUILDLINK_PKGSRCDIR.fftw?=     ../../math/fftw
 
-GCC_REQD+=     4.9
-
 pkgbase := fftw
 .include "../../mk/pkg-build-options.mk"
 .if ${PKG_BUILD_OPTIONS.fftw:Mmpi}

Index: pkgsrc/math/fftw/options.mk
diff -u pkgsrc/math/fftw/options.mk:1.5 pkgsrc/math/fftw/options.mk:1.6
--- pkgsrc/math/fftw/options.mk:1.5     Fri May  7 12:31:22 2021
+++ pkgsrc/math/fftw/options.mk Sat May 15 11:05:29 2021
@@ -1,20 +1,26 @@
-# $NetBSD: options.mk,v 1.5 2021/05/07 12:31:22 thor Exp $
+# $NetBSD: options.mk,v 1.6 2021/05/15 11:05:29 nia Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.fftw
 # fftw (double) and fftwf (single) are always built, you can add
 # fftwl (long) and fftwq (quad).
 PKG_SUPPORTED_OPTIONS= fftw-fortran openmp mpi fftw-long fftw-quad
-# Enable fortran support by default on platforms supported by lang/g95.
-.if (${MACHINE_ARCH} == i386 || ${MACHINE_ARCH} == x86_64 || \
-       ${MACHINE_ARCH} == ia64 || !empty(MACHINE_ARCH:Mpowerpc*) || \
-       ${MACHINE_ARCH} == hppa || !empty(MACHINE_ARCH:Msparc*) || \
-       ${MACHINE_ARCH} == alpha || !empty(MACHINE_ARCH:Mmips*))
-# ...but disable it until lang/g95 issue is resolved.
-#PKG_SUGGESTED_OPTIONS=        fftw-fortran
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${MACHINE_ARCH} == "x86_64"
+PKG_SUPPORTED_OPTIONS+=        avx
 .endif
 
 .include "../../mk/bsd.options.mk"
 
+.if !empty(PKG_OPTIONS:Mavx)
+GCC_REQD+=             4.9
+.  for opt in avx avx2 avx512 avx-128-fma
+FFTW_FLOAT_OPTS+=      --enable-${opt}
+FFTW_DOUBLE_OPTS+=     --enable-${opt}
+.  endfor
+.endif
+
 .if !empty(PKG_OPTIONS:Mfftw-fortran)
 USE_LANGUAGES+=                fortran77
 .else
@@ -27,20 +33,20 @@ PLIST.omp=          yes
 CONFIGURE_ARGS+=       --enable-openmp
 .endif
 
-PLIST_VARS+=   mpi
+PLIST_VARS+=           mpi
 .if !empty(PKG_OPTIONS:Mmpi)
-PLIST.mpi=     yes
+PLIST.mpi=             yes
 CONFIGURE_ARGS+=       --enable-mpi
 .include "../../mk/mpi.buildlink3.mk"
 .endif
 
-PLIST_VARS+=   long quad
-
+PLIST_VARS+=           long
 .if !empty(PKG_OPTIONS:Mfftw-long)
 FFTW_PRECISION+=       long-double
 PLIST.long=            yes
 .endif
 
+PLIST_VARS+=           quad
 .if !empty(PKG_OPTIONS:Mfftw-quad)
 FFTW_PRECISION+=       quad-precision
 PLIST.quad=            yes



Home | Main Index | Thread Index | Old Index