[Buildroot] [PATCH] package/unixbench: new package

Atharva Lele itsatharva at gmail.com
Sun Mar 24 17:59:39 UTC 2019


UnixBench is the original BYTE UNIX benchmark suite, updated and revised by many people over the years.
The purpose of UnixBench is to provide a basic indicator of the performance of a Unix-like system.

Signed-off-by: Atharva Lele <itsatharva at gmail.com>
---
 DEVELOPERS                                    |  3 ++
 package/Config.in                             |  1 +
 .../unixbench/0001-remove-make-check.patch    | 25 +++++++++++++
 package/unixbench/Config.in                   | 19 ++++++++++
 package/unixbench/unixbench                   |  3 ++
 package/unixbench/unixbench.hash              |  2 ++
 package/unixbench/unixbench.mk                | 36 +++++++++++++++++++
 7 files changed, 89 insertions(+)
 create mode 100644 package/unixbench/0001-remove-make-check.patch
 create mode 100644 package/unixbench/Config.in
 create mode 100644 package/unixbench/unixbench
 create mode 100644 package/unixbench/unixbench.hash
 create mode 100644 package/unixbench/unixbench.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index c0a4814a86..fa0357aabc 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -236,6 +236,9 @@ F:	package/luasec/
 F:	package/lua-ev/
 F:	package/orbit/
 
+N:	Atharva Lele <itsatharva at gmail.com>
+F:	package/unixbench
+
 N:	Bartosz Bilas <b.bilas at grinn-global.com>
 F:	package/qt5/qt5scxml/
 
diff --git a/package/Config.in b/package/Config.in
index b5321aeb49..521308c1d8 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -132,6 +132,7 @@ menu "Debugging, profiling and benchmark"
 	source "package/trace-cmd/Config.in"
 	source "package/trinity/Config.in"
 	source "package/uclibc-ng-test/Config.in"
+	source "package/unixbench/Config.in"
 	source "package/valgrind/Config.in"
 	source "package/vmtouch/Config.in"
 	source "package/whetstone/Config.in"
diff --git a/package/unixbench/0001-remove-make-check.patch b/package/unixbench/0001-remove-make-check.patch
new file mode 100644
index 0000000000..331fab5c44
--- /dev/null
+++ b/package/unixbench/0001-remove-make-check.patch
@@ -0,0 +1,25 @@
+diff --git a/UnixBench/Run b/UnixBench/Run
+index b4abd26..46d5414 100755
+--- a/UnixBench/Run
++++ b/UnixBench/Run
+@@ -875,13 +875,13 @@ sub preChecks {
+ 
+     # Check that the required files are in the proper places.
+     my $make = $ENV{MAKE} || "make";
+-    system("$make check");
+-    if ($? != 0) {
+-        system("$make all");
+-        if ($? != 0) {
+-            abortRun("\"$make all\" failed");
+-        }
+-    }
++#    system("$make check");
++#    if ($? != 0) {
++#        system("$make all");
++#        if ($? != 0) {
++#            abortRun("\"$make all\" failed");
++#        }
++#    }
+ 
+     # Create a script to kill this run.
+     system("echo \"kill -9 $$\" > \"${TMPDIR}/kill_run\"");
diff --git a/package/unixbench/Config.in b/package/unixbench/Config.in
new file mode 100644
index 0000000000..ffcc5803f7
--- /dev/null
+++ b/package/unixbench/Config.in
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_UNIXBENCH
+		select BR2_PACKAGE_PERL
+		bool "unixbench"
+		help
+		  UnixBench is the original BYTE UNIX benchmark suite, updated and
+		  revised by many people over the years.
+         
+		  The purpose of UnixBench is to provide a basic indicator of the
+		  performance of a Unix-like system; hence multiple tests are used
+		  to test various aspects of the system's performance. These test
+		  results are then compared to the scores from a baseline system to
+		  produce an index value, which is easier to handle than raw scores.
+		  The entire set of index values is then combined to make an overall
+		  index for the system.
+         
+		  Some simple graphics tests are included to test 2D and 3D performance
+		  of the system. Multi-CPU systems are also handled.
+         
+		  https://github.com/kdlucas/byte-unixbench
diff --git a/package/unixbench/unixbench b/package/unixbench/unixbench
new file mode 100644
index 0000000000..01412efbb4
--- /dev/null
+++ b/package/unixbench/unixbench
@@ -0,0 +1,3 @@
+#!/bin/bash
+cd /usr/lib/unixbench
+exec ./Run "${@}"
diff --git a/package/unixbench/unixbench.hash b/package/unixbench/unixbench.hash
new file mode 100644
index 0000000000..ccec430c66
--- /dev/null
+++ b/package/unixbench/unixbench.hash
@@ -0,0 +1,2 @@
+# sha256 locally computed
+sha256 1677dcdcbed78805848b3c3fd58a6d052b677b6a4ee7add4db74acc4d3364a79 unixbench-070030e09f6effdf0c6721e8fcc3a5c6fb5bed1a.tar.gz
diff --git a/package/unixbench/unixbench.mk b/package/unixbench/unixbench.mk
new file mode 100644
index 0000000000..06f1903871
--- /dev/null
+++ b/package/unixbench/unixbench.mk
@@ -0,0 +1,36 @@
+################################################################################
+#
+# unixbench
+#
+################################################################################
+
+UNIXBENCH_VERSION = 070030e09f6effdf0c6721e8fcc3a5c6fb5bed1a
+UNIXBENCH_SITE = $(call github,kdlucas,byte-unixbench,$(UNIXBENCH_VERSION))
+UNIXBENCH_LICENSE = GPL-2.0
+UNIXBENCH_LICENSE_FILE = LICENSE.txt
+
+# UnixBench tries to compile its binaries regargless of them being compiled
+# or not. The patch will disable that since we may not always have a compiler
+# onboard.
+
+# set UB_GCC_OPTIONS to default optimization from UnixBench (Line #88 in makefile).
+# cross compilation fails if UnixBench makefile tries to detect
+# architecture and OS. This is due to cross compiler not supporting
+# 'native' value for -march and -mtune flags.
+define UNIXBENCH_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
+	$(MAKE) \
+		CC="$(TARGET_CC)" -C $(@D)/UnixBench \
+		UB_GCC_OPTIONS="$(TARGET_CFLAGS)"
+endef
+
+# UnixBench doesn't have any install script of its own. Since $(INSTALL)
+# cannot copy whole directories, we have to copy files and then chmod them.
+define UNIXBENCH_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/usr/lib/unixbench
+	cp -a $(@D)/UnixBench/{pgms,results,testdir,tmp,Run} $(TARGET_DIR)/usr/lib/unixbench/
+	chmod -R 0755 $(TARGET_DIR)/usr/lib/unixbench
+	$(INSTALL) -D -m 0755 $(UNIXBENCH_PKGDIR)/unixbench $(TARGET_DIR)/usr/bin/unixbench
+endef
+
+$(eval $(generic-package))
-- 
2.21.0



More information about the buildroot mailing list