summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2021-05-15 11:05:29 +0000
committernia <nia@pkgsrc.org>2021-05-15 11:05:29 +0000
commit617744dc93c83f50ec10a8263283618f6aae67e4 (patch)
tree47580e39962055287d0560732335db14dea3b383 /math
parentb640fd57acc9b1198956af19f98869c9b8a1ad84 (diff)
downloadpkgsrc-617744dc93c83f50ec10a8263283618f6aae67e4.tar.gz
fftw: clean up funrolling, make avx into a package option
Diffstat (limited to 'math')
-rw-r--r--math/fftw/Makefile30
-rw-r--r--math/fftw/buildlink3.mk4
-rw-r--r--math/fftw/options.mk30
3 files changed, 27 insertions, 37 deletions
diff --git a/math/fftw/Makefile b/math/fftw/Makefile
index d2e7e4bdbf0..bc2e67ee23e 100644
--- a/math/fftw/Makefile
+++ b/math/fftw/Makefile
@@ -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}
diff --git a/math/fftw/buildlink3.mk b/math/fftw/buildlink3.mk
index 5dd45e17ba2..168ff5b4c71 100644
--- a/math/fftw/buildlink3.mk
+++ b/math/fftw/buildlink3.mk
@@ -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}
diff --git a/math/fftw/options.mk b/math/fftw/options.mk
index 2b625ab38a6..98a93e8eecd 100644
--- a/math/fftw/options.mk
+++ b/math/fftw/options.mk
@@ -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