pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/math/fftw math/fftw: fix up SIMD choice and conflict w...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/aefd53115989
branches:  trunk
changeset: 451748:aefd53115989
user:      thor <thor%pkgsrc.org@localhost>
date:      Fri Apr 30 23:31:08 2021 +0000

description:
math/fftw: fix up SIMD choice and conflict with user CFLAGS

This also requires gcc 4.8 at minimum, 4.9 for the full set of SIMD.
The configure script is patched to avoid the build adding -march=core-avx2,
which could conflict with user's CFLAGS.

diffstat:

 math/fftw/Makefile |  29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diffs (59 lines):

diff -r 344923235684 -r aefd53115989 math/fftw/Makefile
--- a/math/fftw/Makefile        Fri Apr 30 23:30:06 2021 +0000
+++ b/math/fftw/Makefile        Fri Apr 30 23:31:08 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.65 2021/04/30 20:51:06 thor Exp $
+# $NetBSD: Makefile,v 1.66 2021/04/30 23:31:08 thor Exp $
 
 PKGREVISION=   5
 
@@ -35,9 +35,7 @@
 .include "options.mk"
 
 # Test will only use the default build.
-.if defined(PKGSRC_RUN_TEST) && !empty(PKGSRC_RUN_TEST:M[Yy][Ee][Ss])
-USE_TOOLS+=            perl:test
-.endif
+USE_TOOLS+=            perl:test sed
 
 PLIST_VARS+=           pthreads
 PTHREAD_OPTS=          native
@@ -53,6 +51,9 @@
 MAKE_DIRS+=            build/${p}
 .endfor
 
+# SIMD stuff needs some baseline.
+GCC_REQD+=     4.8
+
 # 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.
@@ -60,12 +61,24 @@
 FFTW_DOUBLE_OPTS=      --enable-generic-simd128 --enable-generic-simd256
 
 .if ${MACHINE_ARCH} == "x86_64"
-FFTW_FLOAT_OPTS+=      --enable-sse --enable-sse2 --enable-avx --enable-avx2
-FFTW_FLOAT_OPTS+=      --enable-avx512 --enable-avx-128-fma
-FFTW_DOUBLE_OPTS+=     --enable-sse2 --enable-avx --enable-avx2
-FFTW_DOUBLE_OPTS+=     --enable-avx512 --enable-avx-128-fma 
+FFTW_FLOAT_OPTS+=      --enable-sse --enable-sse2 --enable-avx
+FFTW_DOUBLE_OPTS+=     --enable-sse2 --enable-avx
+# From gcc-4.9 on, these should work trouble-free.
+.if empty(${CC_VERSION:Mgcc-4.8.*})
+FFTW_FLOAT_OPTS+=      --enable-avx2 --enable-avx512 --enable-avx-128-fma
+FFTW_DOUBLE_OPTS+=     --enable-avx2 --enable-avx512 --enable-avx-128-fma 
+.endif
 .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}



Home | Main Index | Thread Index | Old Index