All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] fftw: Add support for ptest.
@ 2021-03-26 14:08 Philip Balister
  0 siblings, 0 replies; only message in thread
From: Philip Balister @ 2021-03-26 14:08 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Philip Balister

From: Philip Balister <philip@opensdr.com>

 * 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.

Signed-off-by: Philip Balister <philip@opensdr.com>
---
 .../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

diff --git a/meta-oe/recipes-support/fftw/fftw/club-libtool.patch b/meta-oe/recipes-support/fftw/fftw/club-libtool.patch
new file mode 100644
index 000000000..d4a1ef8d0
--- /dev/null
+++ b/meta-oe/recipes-support/fftw/fftw/club-libtool.patch
@@ -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
diff --git a/meta-oe/recipes-support/fftw/fftw/install-bench.patch b/meta-oe/recipes-support/fftw/fftw/install-bench.patch
new file mode 100644
index 000000000..ef570b19d
--- /dev/null
+++ b/meta-oe/recipes-support/fftw/fftw/install-bench.patch
@@ -0,0 +1,41 @@
+--- ./tests/Makefile.am.orig	2021-03-23 11:45:12.756371739 -0400
++++ ./tests/Makefile.am	2021-03-23 19:29:19.692180793 -0400
+@@ -1,21 +1,21 @@
+ AM_CPPFLAGS = -I $(top_srcdir)
+-noinst_PROGRAMS = bench
++bin_PROGRAMS = bench@PREC_SUFFIX@
+ EXTRA_DIST = check.pl README
+ 
+ if THREADS
+-bench_CFLAGS = $(PTHREAD_CFLAGS)
++bench@PREC_SUFFIX@_CFLAGS = $(PTHREAD_CFLAGS)
+ if !COMBINED_THREADS
+ LIBFFTWTHREADS = $(top_builddir)/threads/libfftw3@PREC_SUFFIX@_threads.la
+ endif
+ else
+ if OPENMP
+-bench_CFLAGS = $(OPENMP_CFLAGS)
++bench@PREC_SUFFIX@_CFLAGS = $(OPENMP_CFLAGS)
+ LIBFFTWTHREADS = $(top_builddir)/threads/libfftw3@PREC_SUFFIX@_omp.la
+ endif
+ endif
+ 
+-bench_SOURCES = bench.c hook.c fftw-bench.c fftw-bench.h
+-bench_LDADD = $(LIBFFTWTHREADS)				\
++bench@PREC_SUFFIX@_SOURCES = bench.c hook.c fftw-bench.c fftw-bench.h
++bench@PREC_SUFFIX@_LDADD = $(LIBFFTWTHREADS)				\
+ $(top_builddir)/libfftw3@PREC_SUFFIX@.la		\
+ $(top_builddir)/libbench2/libbench2.a $(THREADLIBS)
+ 
+--- ./tools/Makefile.am.orig	2021-03-24 08:22:31.845581620 -0400
++++ ./tools/Makefile.am	2021-03-24 08:24:26.454053573 -0400
+@@ -24,7 +24,7 @@
+ endif
+ 
+ fftw@PREC_SUFFIX@_wisdom_SOURCES = fftw-wisdom.c
+-fftw@PREC_SUFFIX@_wisdom_LDADD = $(top_builddir)/tests/bench-bench.o	\
+-$(top_builddir)/tests/bench-fftw-bench.o $(LIBFFTWTHREADS)	\
++fftw@PREC_SUFFIX@_wisdom_LDADD = $(top_builddir)/tests/bench@PREC_SUFFIX@-bench.o	\
++$(top_builddir)/tests/bench@PREC_SUFFIX@-fftw-bench.o $(LIBFFTWTHREADS)	\
+ $(top_builddir)/libfftw3@PREC_SUFFIX@.la			\
+ $(top_builddir)/libbench2/libbench2.a $(THREADLIBS)
diff --git a/meta-oe/recipes-support/fftw/fftw/run-ptest b/meta-oe/recipes-support/fftw/fftw/run-ptest
new file mode 100644
index 000000000..6d8dd96f0
--- /dev/null
+++ b/meta-oe/recipes-support/fftw/fftw/run-ptest
@@ -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
diff --git a/meta-oe/recipes-support/fftw/fftw_3.3.8.bb b/meta-oe/recipes-support/fftw/fftw_3.3.8.bb
index d9e0ea340..de175d629 100644
--- a/meta-oe/recipes-support/fftw/fftw_3.3.8.bb
+++ b/meta-oe/recipes-support/fftw/fftw_3.3.8.bb
@@ -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"
-- 
2.30.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-26 14:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 14:08 [meta-oe][PATCH] fftw: Add support for ptest Philip Balister

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.