Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Thomas Orgis (e62995db7f3d49e6c67f676b62060042f694540c)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Thomas Orgis <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Thomas Orgis (e62995db7f3d49e6c67f676b62060042f694540c)
  • Date: Fri, 30 Apr 2021 23:31:45 +0000

GIT changes to master grimoire by Thomas Orgis <sobukus AT sourcemage.org>:

libs/fftw/BUILD | 40 ++++++++++++++++++++--------------------
libs/fftw/CONFIGURE | 8 ++++----
libs/fftw/DETAILS | 1 +
libs/fftw/HISTORY | 5 +++++
libs/fftw/PRE_BUILD | 7 +++++++
5 files changed, 37 insertions(+), 24 deletions(-)

New commits:
commit e62995db7f3d49e6c67f676b62060042f694540c
Author: Thomas Orgis <sobukus AT sourcemage.org>
Commit: Thomas Orgis <sobukus AT sourcemage.org>

fftw: rework build for run-time SIMD and less questioning

diff --git a/libs/fftw/BUILD b/libs/fftw/BUILD
index c717c4d..78546dc 100755
--- a/libs/fftw/BUILD
+++ b/libs/fftw/BUILD
@@ -16,26 +16,26 @@ else
COMMON_OPTS+=" --disable-openmp"
fi &&

-# There are others available via custom configure.
-# We just enable a runtime-chosen set of optimizations that should
-# benefit the masses.
-case $FFTW_VECTOR in
- sse)
- SINGLE_OPTS+=' --enable-sse'
- ;;
- sse2)
- SINGLE_OPTS+=' --enable-sse'
- DOUBLE_OPTS+=' --enable-sse2'
- ;;
- avx)
- SINGLE_OPTS+=' --enable-sse --enable-avx'
- DOUBLE_OPTS+=' --enable-sse2 --enable-avx'
- ;;
- avx2)
- SINGLE_OPTS+=' --enable-sse --enable-avx2'
- DOUBLE_OPTS+=' --enable-sse2 --enable-avx2'
- ;;
-esac &&
+# Generic SIMD for all.
+# If you enable long double precision, that won't work with any SIMD.
+DOUBLE_OPTS="--enable-generic-simd128 --enable-generic-simd256" &&
+SINGLE_OPTS=$DOUBLE_OPTS &&
+
+# You can add PPC and ARM opts here. See:
+# http://www.fftw.org/fftw3_doc/Installation-on-Unix.html
+if [[ ${SMGL_COMPAT_ARCHS[1]} == x86_64 ]]; then
+ MORE_DOUBLE_OPTS="--enable-sse2 --enable-avx" &&
+ if ! is_version_less "$(installed_version gcc)" 4.9; then
+ MORE_DOUBLE_OPTS+="--enable-avx2 --enable-avx512 --enable-avx-128-fma"
+ fi &&
+ MORE_SINGLE_OPTS="--enable-sse $MORE_DOUBLE_OPTS"
+elif [[ ${SMGL_COMPAT_ARCHS[1]} == ia32 ]]; then
+ MORE_DOUBLE_OPTS="--enable-sse2" &&
+ MORE_SINGLE_OPTS="--enable-sse --enable-sse2"
+fi &&
+
+DOUBLE_OPTS+=" $MORE_DOUBLE_OPTS" &&
+SINGLE_OPTS+=" $MORE_SINGLE_OPTS" &&

# Build each precision by itself.
for p in $FFTW_PRECISION; do
diff --git a/libs/fftw/CONFIGURE b/libs/fftw/CONFIGURE
index 6870c29..208435f 100755
--- a/libs/fftw/CONFIGURE
+++ b/libs/fftw/CONFIGURE
@@ -1,10 +1,9 @@
. $GRIMOIRE/config_query_multi.function &&
config_query_multi FFTW_PRECISION "Choose precisions to build:" \
double single longdouble &&
-# There is more AVX, but not sure what I can test without CPU support.
-config_query_list FFTW_VECTOR \
- "Enforce vector instruction level (compiler flags have to support this):" \
- none sse sse2 avx avx2 &&
+# Let's just enable a default set of vector instructions.
+message "${MESSAGE_COLOR}Using default SIMD opts. You might want to add\
+ custom configure options for exotic SIMD.${DEFAULT_COLOR}" &&
# Transition from FFTW_OPTS_NEW for sub depends.
threads=n &&
openmp=n &&
@@ -24,6 +23,7 @@ config_query FFTW_OPENMP "Parallel fftw using OpenMP?"
$openmp &&
# It was a long time ago that we had to be careful with enabling SSE or FMA.
# Remove the options for that.
# Also outdated new opts.
+persistent_remove FFTW_VECTOR &&
persistent_remove FFTW_OPTS_NEW &&
persistent_remove FFTW_DOUBLEOPTS &&
persistent_remove FFTW_FLOATOPTS &&
diff --git a/libs/fftw/DETAILS b/libs/fftw/DETAILS
index ff7e845..c8f9207 100755
--- a/libs/fftw/DETAILS
+++ b/libs/fftw/DETAILS
@@ -1,5 +1,6 @@
SPELL=fftw
VERSION=3.3.9
+ PATCHLEVEL=1

SOURCE_HASH=sha512:52ebc2a33063a41fd478f6ea2acbf3b511867f736591d273dd57f9dfca5d3e0b0c73157921b3a36f1a7cfd741a8a6bde0fd80de578040ae730ea168b5ba466cf
SOURCE=$SPELL-$VERSION.tar.gz
SOURCE_DIRECTORY=$BUILD_DIRECTORY/$SPELL-$VERSION
diff --git a/libs/fftw/HISTORY b/libs/fftw/HISTORY
index 66568a9..87caa8a 100644
--- a/libs/fftw/HISTORY
+++ b/libs/fftw/HISTORY
@@ -1,3 +1,8 @@
+2021-05-01 Thomas Orgis <sobukus AT sourcemage.org>
+ * DETAILS: ++PATCHLEVEL
+ * CONFIGURE, BUILD: default set of SIMD with runtime choice
+ * PRE_BUILD: avoid conflicts from -march=core-avx2 from configure
+
2021-04-29 Thomas Orgis <sobukus AT sourcemage.org>
* DETAILS: remove version hack
* PRE_BUILD: gone
diff --git a/libs/fftw/PRE_BUILD b/libs/fftw/PRE_BUILD
new file mode 100755
index 0000000..a556139
--- /dev/null
+++ b/libs/fftw/PRE_BUILD
@@ -0,0 +1,7 @@
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
+# Avoid the build messing with -march=core-avx2, which is a hack
+# for gcc-4.8 only anyway. It conflicts with user-set march.
+if printf "%s\n" "$CFLAGS" | grep -q march=; then
+ sed -i s:march=core-avx2:march=donotbother:g configure.ac configure
+fi



  • [SM-Commit] GIT changes to master grimoire by Thomas Orgis (e62995db7f3d49e6c67f676b62060042f694540c), Thomas Orgis, 04/30/2021

Archive powered by MHonArc 2.6.24.

Top of Page