summaryrefslogtreecommitdiff
path: root/benchmarks/whetstone
diff options
context:
space:
mode:
authorgarbled <garbled@pkgsrc.org>1998-08-30 17:51:16 +0000
committergarbled <garbled@pkgsrc.org>1998-08-30 17:51:16 +0000
commit9a4b4407afb2fa601d10b0d7155c54af309c7840 (patch)
treec6a083fef77491551122d722473fc8ec48255d1e /benchmarks/whetstone
parent7131d974391dccff74576af1c7145dcc1ac9104a (diff)
downloadpkgsrc-9a4b4407afb2fa601d10b0d7155c54af309c7840.tar.gz
Add new pkg for whetstone-1.2 with patches from Ignatios to use clock()
a benchmark for processors that gives you a MIPS rating.
Diffstat (limited to 'benchmarks/whetstone')
-rw-r--r--benchmarks/whetstone/Makefile23
-rw-r--r--benchmarks/whetstone/files/md53
-rw-r--r--benchmarks/whetstone/patches/patch-aa55
-rw-r--r--benchmarks/whetstone/pkg/COMMENT1
-rw-r--r--benchmarks/whetstone/pkg/DESCR11
-rw-r--r--benchmarks/whetstone/pkg/PLIST2
6 files changed, 95 insertions, 0 deletions
diff --git a/benchmarks/whetstone/Makefile b/benchmarks/whetstone/Makefile
new file mode 100644
index 00000000000..69e2f4a1f62
--- /dev/null
+++ b/benchmarks/whetstone/Makefile
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile,v 1.1 1998/08/30 17:51:16 garbled Exp $
+
+DISTNAME= whetstone
+PKGNAME= whetstone-1.2
+CATEGORIES= benchmarks
+MASTER_SITES= http://www.netlib.org/benchmark/
+EXTRACT_SUFX= .c
+
+MAINTAINER= root@garbled.net
+
+NO_WRKSUBDIR= yes
+
+do-extract:
+ ${MKDIR} ${WRKSRC}
+ ${CP} ${DISTDIR}/whetstone.c ${WRKSRC}
+
+do-build:
+ (cd ${WRKSRC} ; cc -O2 -o whetstone whetstone.c -lm)
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/whetstone ${PREFIX}/bin
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/benchmarks/whetstone/files/md5 b/benchmarks/whetstone/files/md5
new file mode 100644
index 00000000000..d2aae53fb45
--- /dev/null
+++ b/benchmarks/whetstone/files/md5
@@ -0,0 +1,3 @@
+$NetBSD: md5,v 1.1 1998/08/30 17:51:17 garbled Exp $
+
+MD5 (whetstone.c) = d8eb2cd7104bb5a12d614ac6d3f1f9fb
diff --git a/benchmarks/whetstone/patches/patch-aa b/benchmarks/whetstone/patches/patch-aa
new file mode 100644
index 00000000000..e9b1f82abbf
--- /dev/null
+++ b/benchmarks/whetstone/patches/patch-aa
@@ -0,0 +1,55 @@
+$NetBSD: patch-aa,v 1.1 1998/08/30 17:51:17 garbled Exp $
+--- whetstone.c.orig Sun Aug 30 10:03:47 1998
++++ whetstone.c Sun Aug 30 10:06:00 1998
+@@ -59,6 +59,12 @@
+
+ /* the following is optional depending on the timing function used */
+ #include <time.h>
++#ifdef CLOCKS_PER_SEC
++#define mytime() clock()
++#else
++#define mytime() time(0)
++#define CLOCKS_PER_SEC 1
++#endif
+
+ /* map the FORTRAN math functions, etc. to the C versions */
+ #define DSIN sin
+@@ -120,7 +126,7 @@
+ C Start benchmark timing at this point.
+ C
+ */
+- startsec = time(0);
++ startsec = mytime();
+
+ /*
+ C
+@@ -355,7 +361,7 @@
+ C Stop benchmark timing at this point.
+ C
+ */
+- finisec = time(0);
++ finisec = mytime();
+
+ /*
+ C----------------------------------------------------------------
+@@ -367,15 +373,16 @@
+ C--------------------------------------------------------------------
+ */
+ printf("\n");
+- if (finisec-startsec <= 0) {
++ if (finisec-startsec <= 100) {
+ printf("Insufficient duration- Increase the LOOP count\n");
+ return(1);
+ }
+
+- printf("Loops: %ld, Iterations: %d, Duration: %ld sec.\n",
+- LOOP, II, finisec-startsec);
++ printf("Loops: %ld, Iterations: %d, Duration: %f sec.\n",
++ LOOP, II,
++ (float)(finisec-startsec)/(float)CLOCKS_PER_SEC);
+
+- KIPS = (100.0*LOOP*II)/(float)(finisec-startsec);
++ KIPS = (100.0*LOOP*II*CLOCKS_PER_SEC)/(float)(finisec-startsec);
+ if (KIPS >= 1000.0)
+ printf("C Converted Double Precision Whetstones: %.1f MIPS\n", KIPS/1000.0);
+ else
diff --git a/benchmarks/whetstone/pkg/COMMENT b/benchmarks/whetstone/pkg/COMMENT
new file mode 100644
index 00000000000..93bf9c68e27
--- /dev/null
+++ b/benchmarks/whetstone/pkg/COMMENT
@@ -0,0 +1 @@
+a benchmark for processors that gives you a MIPS rating.
diff --git a/benchmarks/whetstone/pkg/DESCR b/benchmarks/whetstone/pkg/DESCR
new file mode 100644
index 00000000000..5a334ab6a47
--- /dev/null
+++ b/benchmarks/whetstone/pkg/DESCR
@@ -0,0 +1,11 @@
+Converted by Rich Painter, Painter Engineering, Inc. based on the
+www.netlib.org benchmark/whetstoned version obtained 16 March 1998.
+
+A novel approach was used here to keep the look and feel of the
+FORTRAN version. Altering the FORTRAN-based array indices,
+starting at element 1, to start at element 0 for C, would require
+numerous changes, including decrementing the variable indices by 1.
+Instead, the array E1[] was declared 1 element larger in C. This
+allows the FORTRAN index range to function without any literal or
+variable indices changes. The array element E1[0] is simply never
+used and does not alter the benchmark results.
diff --git a/benchmarks/whetstone/pkg/PLIST b/benchmarks/whetstone/pkg/PLIST
new file mode 100644
index 00000000000..f6bb63b3aa9
--- /dev/null
+++ b/benchmarks/whetstone/pkg/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 1998/08/30 17:51:17 garbled Exp $
+bin/whetstone