All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] linpack: Build both sp and dp binaries
@ 2021-11-10 22:27 Khem Raj
  0 siblings, 0 replies; only message in thread
From: Khem Raj @ 2021-11-10 22:27 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Khem Raj

This eases out running single-precision and double-precision benchmarks.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...efine-DP-only-when-SP-is-not-defined.patch | 32 +++++++++++++++++++
 .../recipes-benchmark/linpack/linpack_1.0.bb  | 10 ++++--
 2 files changed, 39 insertions(+), 3 deletions(-)
 create mode 100644 meta-oe/recipes-benchmark/linpack/linpack/0001-linpack-Define-DP-only-when-SP-is-not-defined.patch

diff --git a/meta-oe/recipes-benchmark/linpack/linpack/0001-linpack-Define-DP-only-when-SP-is-not-defined.patch b/meta-oe/recipes-benchmark/linpack/linpack/0001-linpack-Define-DP-only-when-SP-is-not-defined.patch
new file mode 100644
index 0000000000..4eb18e38ca
--- /dev/null
+++ b/meta-oe/recipes-benchmark/linpack/linpack/0001-linpack-Define-DP-only-when-SP-is-not-defined.patch
@@ -0,0 +1,32 @@
+From f092d4be22acd09e791187b8e9bff6d312721ce4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 10 Nov 2021 11:36:31 -0800
+Subject: [PATCH] linpack: Define DP only when SP is not defined
+
+This helps compiling two versions ( SP/FP ) of the benchmark just by
+passing -DSP on compile cmdline
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ linpacknew.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/linpacknew.c b/linpacknew.c
+index 17b2824..c656082 100644
+--- a/linpacknew.c
++++ b/linpacknew.c
+@@ -28,7 +28,9 @@
+ #include <time.h>
+ #include <float.h>
+ 
++#ifndef SP
+ #define DP
++#endif
+ 
+ #ifdef SP
+ #define ZERO        0.0
+-- 
+2.33.1
+
diff --git a/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb b/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb
index aed95cdaa4..603004ddd5 100644
--- a/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb
+++ b/meta-oe/recipes-benchmark/linpack/linpack_1.0.bb
@@ -4,17 +4,21 @@ SUMMARY = "LINPACK is a software library for performing numerical linear algebra
 LICENSE = "PD"
 LIC_FILES_CHKSUM ="file://${WORKDIR}/linpacknew.c;beginline=1;endline=23;md5=aa025e3bc44190c71e4c5e3b084fed87"
 
-SRC_URI = "http://www.netlib.org/benchmark/linpackc.new;downloadfilename=linpacknew.c"
+SRC_URI = "http://www.netlib.org/benchmark/linpackc.new;downloadfilename=linpacknew.c \
+           file://0001-linpack-Define-DP-only-when-SP-is-not-defined.patch \
+          "
 SRC_URI[md5sum] = "1c5d0b6a31264685d2e651c920e3cdf4"
 SRC_URI[sha256sum] = "a63f2ec86512959f1fd926bfafb85905b2d7b7402942ffae3af374d48745e97e"
 
 S = "${WORKDIR}"
 
 do_compile () {
-	${CC} ${CFLAGS} ${LDFLAGS} -o linpack linpacknew.c -lm
+	${CC} ${CFLAGS} ${LDFLAGS} -DDP -o linpack_dp linpacknew.c -lm
+	${CC} ${CFLAGS} ${LDFLAGS} -DSP -o linpack_sp linpacknew.c -lm
 }
 
 do_install () {
-	install -Dm 0755 linpack ${D}${bindir}/linpack
+	install -Dm 0755 linpack_dp ${D}${bindir}/linpack_dp
+	install -Dm 0755 linpack_sp ${D}${bindir}/linpack_sp
 }
 
-- 
2.33.1



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

only message in thread, other threads:[~2021-11-10 22:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 22:27 [meta-oe][PATCH] linpack: Build both sp and dp binaries Khem Raj

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.