diff options
author | Rodrigo Osorio <rodrigo@FreeBSD.org> | 2015-01-14 15:49:55 +0000 |
---|---|---|
committer | Rodrigo Osorio <rodrigo@FreeBSD.org> | 2015-01-14 15:49:55 +0000 |
commit | a9e4ed6487fa2d2f0f46e7b18700da22e6817d70 (patch) | |
tree | e781896531c0ae6d3d304f887c64c48d18ebb99b /benchmarks/dhrystone | |
parent | Unbreak fetching of those textures. (diff) |
New port benchmarks/dhrystone : a computing benchmark for integer operations
PR: 193153
Submitted by: Radim Kolar <hsn@sendmail.cz>
Notes
Notes:
svn path=/head/; revision=377022
Diffstat (limited to 'benchmarks/dhrystone')
-rw-r--r-- | benchmarks/dhrystone/Makefile | 43 | ||||
-rw-r--r-- | benchmarks/dhrystone/distinfo | 2 | ||||
-rw-r--r-- | benchmarks/dhrystone/files/patch-hz | 24 | ||||
-rw-r--r-- | benchmarks/dhrystone/files/patch-includes | 33 | ||||
-rw-r--r-- | benchmarks/dhrystone/pkg-descr | 12 |
5 files changed, 114 insertions, 0 deletions
diff --git a/benchmarks/dhrystone/Makefile b/benchmarks/dhrystone/Makefile new file mode 100644 index 000000000000..93e5618a0809 --- /dev/null +++ b/benchmarks/dhrystone/Makefile @@ -0,0 +1,43 @@ +# Created by: Radim Kolar <hsn@sendmail.cz> +# $FreeBSD$ + +PORTNAME= dhrystone +PORTVERSION= 2.1 +CATEGORIES= benchmarks +MASTER_SITES= ${MASTER_SITE_NETLIB} +MASTER_SITE_SUBDIR=benchmark +DISTNAME= dhry-c +EXTRACT_SUFX= + +MAINTAINER= hsn@sendmail.cz +COMMENT= Computing benchmark for integer operations + +LICENSE= BSD2CLAUSE + +EXTRACT_CMD= ${MKDIR} ${WRKSRC};cd ${WRKSRC} && ${SH} + +PLIST_FILES= bin/dhry + +OPTIONS_DEFINE= DOCS + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MDOCS} +PORTDOCS= RATIONALE submit.frm README_C VARIATIONS +.endif + +do-build: + cd ${WRKSRC} && ${CC} ${CFLAGS} -c dhry_1.c && \ + ${CC} ${CFLAGS} -c dhry_2.c && \ + ${CC} -o dhry *.o + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/dhry ${STAGEDIR}${PREFIX}/bin +.if ${PORT_OPTIONS:MDOCS} + ${MKDIR} ${STAGEDIR}${DOCSDIR} +.for f in ${PORTDOCS} + ${INSTALL_DATA} ${WRKSRC}/${f} ${STAGEDIR}${DOCSDIR} +.endfor +.endif + +.include <bsd.port.mk> diff --git a/benchmarks/dhrystone/distinfo b/benchmarks/dhrystone/distinfo new file mode 100644 index 000000000000..a227252140a7 --- /dev/null +++ b/benchmarks/dhrystone/distinfo @@ -0,0 +1,2 @@ +SHA256 (dhry-c) = 038a7e9169787125c3451a6c941f3aca5db2d2f3863871afcdce154ef17f4e3e +SIZE (dhry-c) = 72812 diff --git a/benchmarks/dhrystone/files/patch-hz b/benchmarks/dhrystone/files/patch-hz new file mode 100644 index 000000000000..5b029beed188 --- /dev/null +++ b/benchmarks/dhrystone/files/patch-hz @@ -0,0 +1,24 @@ +diff -Naur drystone-2.1/dhry.h drystone-patched/dhry.h +--- dhry.h 2014-08-30 16:32:37.000000000 +0200 ++++ dhry.h 2014-08-30 16:37:44.933675426 +0200 +@@ -385,6 +385,8 @@ + + #include <stdio.h> + /* for strcpy, strcmp */ ++#include <unistd.h> ++ /* for sysconf */ + + #define Null 0 + /* Value of a Null pointer */ +diff -Naur drystone-2.1/dhry_1.c drystone-patched/dhry_1.c +--- dhry_1.c 2014-08-30 16:32:37.000000000 +0200 ++++ dhry_1.c 2014-08-30 16:44:20.484050144 +0200 +@@ -262,6 +262,8 @@ + / (float) Number_Of_Runs; + Dhrystones_Per_Second = (float) Number_Of_Runs / (float) User_Time; + #else ++ ++ int HZ = sysconf(_SC_CLK_TCK); + Microseconds = (float) User_Time * Mic_secs_Per_Second + / ((float) HZ * ((float) Number_Of_Runs)); + Dhrystones_Per_Second = ((float) HZ * (float) Number_Of_Runs) diff --git a/benchmarks/dhrystone/files/patch-includes b/benchmarks/dhrystone/files/patch-includes new file mode 100644 index 000000000000..d77aadaa2850 --- /dev/null +++ b/benchmarks/dhrystone/files/patch-includes @@ -0,0 +1,33 @@ +diff -Naur drystone-patched/dhry.h dhrystone-working/dhry.h +--- dhry.h 2014-08-30 16:37:44.933675426 +0200 ++++ dhry.h 2014-08-30 17:22:14.124345711 +0200 +@@ -384,7 +384,10 @@ + /* General definitions: */ + + #include <stdio.h> ++#include <string.h> + /* for strcpy, strcmp */ ++#include <stdlib.h> ++ /* for malloc */ + #include <unistd.h> + /* for sysconf */ + +diff -Naur drystone-patched/dhry_1.c dhrystone-working/dhry_1.c +--- dhry_1.c 2014-08-30 16:44:20.484050144 +0200 ++++ dhry_1.c 2014-08-30 17:12:06.705379492 +0200 +@@ -28,7 +28,6 @@ + int Arr_1_Glob [50]; + int Arr_2_Glob [50] [50]; + +-extern char *malloc (); + Enumeration Func_1 (); + /* forward declaration necessary since Enumeration may not simply be int */ + +@@ -45,7 +44,6 @@ + + #ifdef TIMES + struct tms time_info; +-extern int times (); + /* see library function "times" */ + #define Too_Small_Time 120 + /* Measurements should last at least about 2 seconds */ diff --git a/benchmarks/dhrystone/pkg-descr b/benchmarks/dhrystone/pkg-descr new file mode 100644 index 000000000000..7aa6f74758d6 --- /dev/null +++ b/benchmarks/dhrystone/pkg-descr @@ -0,0 +1,12 @@ +Dhrystone benchmark + +Dhrystone is a synthetic computing benchmark program developed in 1984 +by Reinhold P. Weicker intended to be representative of system (integer) +programming. The Dhrystone grew to become representative of general +processor (CPU) performance. + +DMIPS value is result of dhrystone test divided by 1757, results are often +reported in DMIPS/Mhz. For more information, see +http://en.wikipedia.org/wiki/Dhrystone + +WWW: http://www.netlib.org/benchmark/ |