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:   thor
Date:           Fri Apr 30 23:31:08 UTC 2021

Modified Files:
        pkgsrc/math/fftw: Makefile

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 pkgsrc/math/fftw/Makefile

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.65 pkgsrc/math/fftw/Makefile:1.66
--- pkgsrc/math/fftw/Makefile:1.65      Fri Apr 30 20:51:06 2021
+++ pkgsrc/math/fftw/Makefile   Fri Apr 30 23:31:08 2021
@@ -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 @@ FFTW_PRECISION=       double float
 .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 @@ CONFIGURE_DIRS+=      build/${p}
 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_FLOAT_OPTS=    --enable-generic-simd12
 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