pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/math/fftw fftw: clean up funrolling, make avx into a p...
details: https://anonhg.NetBSD.org/pkgsrc/rev/4e2b1d37bdee
branches: trunk
changeset: 452764:4e2b1d37bdee
user: nia <nia%pkgsrc.org@localhost>
date: Sat May 15 11:05:29 2021 +0000
description:
fftw: clean up funrolling, make avx into a package option
diffstat:
math/fftw/Makefile | 30 ++++++++----------------------
math/fftw/buildlink3.mk | 4 +---
math/fftw/options.mk | 30 ++++++++++++++++++------------
3 files changed, 27 insertions(+), 37 deletions(-)
diffs (129 lines):
diff -r ddfcb57f5445 -r 4e2b1d37bdee math/fftw/Makefile
--- a/math/fftw/Makefile Sat May 15 10:55:28 2021 +0000
+++ b/math/fftw/Makefile Sat May 15 11:05:29 2021 +0000
@@ -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 @@
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}
diff -r ddfcb57f5445 -r 4e2b1d37bdee math/fftw/buildlink3.mk
--- a/math/fftw/buildlink3.mk Sat May 15 10:55:28 2021 +0000
+++ b/math/fftw/buildlink3.mk Sat May 15 11:05:29 2021 +0000
@@ -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_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}
diff -r ddfcb57f5445 -r 4e2b1d37bdee math/fftw/options.mk
--- a/math/fftw/options.mk Sat May 15 10:55:28 2021 +0000
+++ b/math/fftw/options.mk Sat May 15 11:05:29 2021 +0000
@@ -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 @@
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