Skip to contentSkip to conversation

fftw: Add support for ptest.

PATCH New Philip Balister 1 participant 1 message Mar 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fftw: Add support for ptest.

From: Philip Balister <[email protected]>

* The bench program is installed then moved into the ptest ares so it links. Since we are building for all precisions, we need to build three versions of the bench program.

---
 .../fftw/fftw/club-libtool.patch              |  9 ++++
 .../fftw/fftw/install-bench.patch             | 41 +++++++++++++++++++
 meta-oe/recipes-support/fftw/fftw/run-ptest   | 30 ++++++++++++++
 meta-oe/recipes-support/fftw/fftw_3.3.8.bb    | 22 +++++++++-
 4 files changed, 101 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/fftw/fftw/club-libtool.patch
 create mode 100644 meta-oe/recipes-support/fftw/fftw/install-bench.patch
 create mode 100644 meta-oe/recipes-support/fftw/fftw/run-ptest
meta-oe/recipes-support/fftw/fftw/club-libtool.patch new file +9 -0
new file mode 100644
index 000000000..d4a1ef8d0
@@ -0,0 +1,9 @@
+--- ./tests/Makefile.am.orig	2021-03-23 11:45:12.756371739 -0400
++++ ./tests/Makefile.am	2021-03-23 11:46:43.224132851 -0400
+@@ -1,5 +1,5 @@
+ AM_CPPFLAGS = -I $(top_srcdir)
+-noinst_PROGRAMS = bench
++bin_PROGRAMS = bench@PREC_SUFFIX@
+ EXTRA_DIST = check.pl README
+ 
+ if THREADS
meta-oe/recipes-support/fftw/fftw/install-bench.patch new file +41 -0

41 lines not on this page · raw message

meta-oe/recipes-support/fftw/fftw/run-ptest new file +30 -0
new file mode 100644
index 000000000..6d8dd96f0
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+cd fftw
+/usr/bin/perl -w ./check.pl  -r -c=30 -v `pwd`/bench
+fftw_result=$?
+cd ../fftwf
+/usr/bin/perl -w ./check.pl  -r -c=30 -v `pwd`/benchf
+fftwf_result=$?
+cd ../fftwl
+/usr/bin/perl -w ./check.pl  -r -c=30 -v `pwd`/benchl
+fftwl_result=$?
+
+echo -n "fftw  test result:"
+if [ $fftw_result  = "0" ]; then
+	echo PASSED
+else
+	echo FAILED
+fi
+echo -n "fftwf test result:"
+if [ $fftwf_result = "0" ]; then
+	echo PASSED
+else
+	echo FAILED
+fi
+echo -n "fftwl test result:"
+if [ $fftwl_result = "0" ]; then
+	echo PASSED
+else
+	echo FAILED
+fi
meta-oe/recipes-support/fftw/fftw_3.3.8.bb +21 -1
index d9e0ea340..de175d629 100644
@@ -6,11 +6,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
 SRC_URI = " \
     http://www.fftw.org/fftw-${PV}.tar.gz \
     file://0001-NEON-autodetection-segfaults-assume-neon-present.patch \
+    file://install-bench.patch \
+    file://run-ptest \
 "
 SRC_URI[md5sum] = "8aac833c943d8e90d51b697b27d4384d"
 SRC_URI[sha256sum] = "6113262f6e92c5bd474f2875fa1b01054c4ad5040f6b0da7c03c98821d9ae303"
 
-inherit autotools pkgconfig
+inherit autotools pkgconfig ptest
 
 # we had multiple recipes in the past
 PROVIDES = "fftwl fftwf"
@@ -65,6 +67,22 @@ do_install() {
     done
 }
 
+do_install_ptest() {
+    for lib in fftw fftwl fftwf; do
+        install -d ${D}${PTEST_PATH}/$lib
+        install -m 0755 ${S}/tests/check.pl ${D}${PTEST_PATH}/$lib
+        cd ${WORKDIR}/build-$lib
+        if [ $lib = "fftw" ]; then
+            mv ${D}${bindir}/bench ${D}${PTEST_PATH}/$lib
+        fi
+        if [ $lib = "fftwl" ]; then
+            mv ${D}${bindir}/benchl ${D}${PTEST_PATH}/$lib
+        fi
+        if [ $lib = "fftwf" ]; then
+            mv ${D}${bindir}/benchf ${D}${PTEST_PATH}/$lib
+        fi
+    done
+}
 
 PACKAGES =+ "libfftw libfftwl libfftwf"
 FILES_libfftw = "${libdir}/libfftw3.so.* ${libdir}/libfftw3_*.so.*"
@@ -79,5 +97,7 @@ FILES_fftw-wisdom-to-conf = "${bindir}/fftw-wisdom-to-conf"
 
 FILES_${PN}-dev += "${libdir}/cmake"
 RDEPENDS_${PN}-dev = "libfftw libfftwl libfftwf"
+RDEPENDS_${PN}-ptest += "perl"
+RDEPENDS_${PN}-ptest_remove = "fftw"
 
 BBCLASSEXTEND = "native"
Signature · 1 line
2.30.2