Subject: g98 compilation problems

From: Christoph van Wüllen <[email-masked]>
Date: Wed, 25 Jul 2001 14:56:52 +0200

Some people reported to me that they cannot compile g98A7 under new 
LINUX versions, so I looked at it.
There is indeed a problem in bsd/mdutil.c related to the constant CLK_TCK,
which is not always defined by including <sys/times.h>.
The "clean" solution is of course to use the getrusage interface, i.e. replace
the lines

#ifndef ETIME_DONE
   clock_t times(), wall;
   struct tms tbuf;
   wall = times(&tbuf);
   tarray[0] = (float) (((f77_wp) tbuf.tms_utime) / ((f77_wp) CLK_TCK));
   tarray[1] = (float) (((f77_wp) tbuf.tms_stime) / ((f77_wp) CLK_TCK));
#endif

by

#ifndef ETIME_DONE
struct rusage usage;

getrusage(RUSAGE_SELF, &usage);

tarray[0] = (double) usage.ru_utime.tv_sec + 0.000001 * (double) 
usage.ru_utime.tv_usec;
tarray[1] = (double) usage.ru_stime.tv_sec + 0.000001 * (double) 
usage.ru_stime.tv_usec;
#endif

(near the bottom of function etime_).