diff -Naur /tmp/ucb/ucbctest/Makefile /tmp/ucb-new/ucbctest/Makefile --- ucb/ucbctest/Makefile 1995-03-06 01:21:33.000000000 -0500 +++ ucb-new/ucbctest/Makefile 2008-12-16 21:56:51.000000000 -0500 @@ -2,13 +2,13 @@ SHELL=/bin/sh -TIME=/bin/time +#TIME=time CPP=cpp -PRECISION= DP +#PRECISION=DP -SRC= $$HOME/ucb +SRC= SOURCE= $(SRC)/ucbctest diff -Naur /tmp/ucb/ucbREADME/linux.sh /tmp/ucb-new/ucbREADME/linux.sh --- ucb/ucbREADME/linux.sh 1995-03-07 11:55:57.000000000 -0500 +++ ucb-new/ucbREADME/linux.sh 2008-12-16 22:26:24.000000000 -0500 @@ -1,34 +1,45 @@ set -e set -x -### specification section +### Specification Section: The user needs to modify the following variables +### ------------------------------------------------------------------------ -# sample ucbtest invocation for GCC/F2C on linux Slackware 1.1.59 - -# temporary directory where everything is to happen +# tmpdir is the temporary directory where everything is to happen +# set TIME to location of time executable - with full path +# PATH is needed so time can find the *out files tmpdir=/tmp/linux +TIME=/usr/bin/time -# source code directory +# source code directory - set to where ucbtest has been unpacked -SRC=$HOME/ucb +SRC=/tmp/ucb -# precision choices +# set precision and language choices choices +# DP is double precision testing and SP is single precision testing +# c is C language code and f is Fortran language code -precisions="DP SP" +#precisions="DP SP" +precisions="DP" # language choices +#languages="c f" +languages="c" +# compilation options -languages="c f" +# set desired compile options +opts="-m64 -O2 -pipe -march=core2 -fomit-frame-pointer -mfpmath=sse -mssse3 -m128bit-long-double" -# compilation options +### Nothing needs to be modified below this point +### --------------------------------------------- + +PATH=$PATH:$tmpdir make="make" -cpp="/lib/cpp -traditional" -cc=/usr/bin/cc -f77=/usr/bin/f77 -cppopts="-DNO_FUNCF -DNTESTS=1000000 -DNREGIONS=16 -DQUIET -DNO_FAIL" -opts="-O" +cpp="cpp -traditional" +cc=gcc +f77=gfortran +cppopts="-DNO_FUNCF -DNTESTS=1000000 -DNREGIONS=16 -DQUIET" ccopts="-ffloat-store" ccldopts="-lm" f77opts="" @@ -36,8 +47,9 @@ ### execution section -sh $SRC/ucbREADME/log.sh - +#sh $SRC/ucbREADME/log.sh +set +e +set +x if test -d $tmpdir ; then : ; else mkdir $tmpdir ; fi @@ -54,8 +66,7 @@ $make -f $SRC/$makedir/Makefile SRC=$SRC PRECISION=${precision} \ CC="$cc" CCOPTS="$opts $ccopts $cppopts" CCLDOPTS="$ccldopts" \ F77="$f77" F77OPTS="$opts $f77opts" F77LDOPTS="$f77ldopts" \ -CPP="$cpp" CPPOPTS="$cppopts" \ -TIME=/usr/bin/time +CPP="$cpp" CPPOPTS="$cppopts" TIME=$TIME \ done done diff -Naur /tmp/ucb/ucbtest/beef.c /tmp/ucb-new/ucbtest/beef.c --- ucb/ucbtest/beef.c 1995-03-05 14:22:34.000000000 -0500 +++ ucb-new/ucbtest/beef.c 2008-07-01 14:04:46.000000000 -0400 @@ -323,13 +323,13 @@ for (i = 0; i <= BRK_LOG; i++) double_check(i, "brk_log", &bpq_log[i], &brk_log[i]); } - +#include #if BSD_RUSAGE # include # include # define msec(t) ((t).tv_sec * 100 + (t).tv_usec / 10000) #else -# include /* ANSI-C has time(.); POSIX has CLK_TCK */ +# include /* ANSI-C has time(.); POSIX has CLOCKS_PER_SEC */ # if POSIX_TIMES # include /* POSIX has times(.) */ # else /* POSIX_TIMES */ @@ -378,12 +378,12 @@ if (!state) (void) times(&t0); else { - clock_t ut, st, clk_tck = CLK_TCK; + clock_t ut, st, clk_tck = CLOCKS_PER_SEC; struct tms t1; (void) times(&t1); - ut = t1.tms_utime - t0.tms_utime; /* 1 / CLK_TCK sec */ - st = t1.tms_stime - t0.tms_stime; /* 1 / CLK_TCK sec */ + ut = t1.tms_utime - t0.tms_utime; /* 1 / CLOCKS_PER_SEC sec */ + st = t1.tms_stime - t0.tms_stime; /* 1 / CLOCKS_PER_SEC sec */ (void) printf("--> Timing {%s}: %ld.%02ldu %ld.%02lds\n\f", msg, sec(ut), csec(ut), sec(st), csec(st)); } diff -Naur /tmp/ucb/ucbtest/ieee.c /tmp/ucb-new/ucbtest/ieee.c --- ucb/ucbtest/ieee.c 1995-03-05 14:35:08.000000000 -0500 +++ ucb-new/ucbtest/ieee.c 2008-07-01 12:35:25.000000000 -0400 @@ -35,6 +35,7 @@ #ifdef linux #include +#include #define Round_Down _FPU_RC_DOWN #define Round_Near _FPU_RC_NEAREST #define Round_Up _FPU_RC_UP @@ -45,18 +46,18 @@ /* Note this library function sets both the precision and rounding mode. */ #ifdef SP #define swapRM(x) \ -__setfpucw((unsigned short) (x | 0x107f | PC_24)) +_FPU_SETCW((unsigned short) (x | 0x107f | PC_24)) #else #ifdef DP #define swapRM(x) \ -__setfpucw((unsigned short) (x | 0x107f | PC_53)) +_FPU_SETCW((unsigned int) (x | 0x107f | PC_53)) #else #define swapRM(x) \ -__setfpucw((unsigned short) (x | 0x107f | PC_64)) +_FPU_SETCW((unsigned short) (x | 0x107f | PC_64)) #endif #endif /* This sets the precision but also sets rounding to nearest. */ -#define set_prec(x) __setfpucw((unsigned short) (x | 0x107f)) +#define set_prec(x) _FPU_SETCW((unsigned short) (x | 0x107f)) #endif #ifdef __FPCE_IEEE__ @@ -234,7 +235,7 @@ round_nearest() { /* set rounding direction to nearest */ #ifdef Round_Near /* if rounding isn't defined, OK to do nothing */ - swapRM(Round_Near); + fesetround(Round_Near); #endif } @@ -242,7 +243,7 @@ round_positive() { /* set rounding direction to +inf */ #ifdef Round_Up - swapRM(Round_Up); + fesetround(Round_Up); #else printf("Don't know how to round toward +infinity!\n"); ucbfail( __FILE__, __LINE__ ); @@ -256,7 +257,7 @@ printf("Don't know how to round toward zero!\n"); ucbfail( __FILE__, __LINE__ ); #else - swapRM(Round_Zero); + fesetround(Round_Zero); #endif } @@ -287,7 +288,7 @@ #ifdef QP #define Prec PC_64 #endif - set_prec(Prec); +/* fesetprec(Prec); */ #endif #endif @@ -304,7 +305,7 @@ #endif #if !defined(No_Prec) && !defined(Cant_Prec) - set_prec(PC_64); +/* fesetprec(PC_64); */ #endif }