<HTML><FONT FACE=arial,helvetica><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2">Matt,<BR>
<BR>
It looks like Darwin does not use glibc. Unfortunately, I haven't been able to nail down exactly which libraries are used. In any case, I found at least one other instance where someone porting something to Darwin had to include <sys/time.h> (before including <sys/resource.h>) in order to use getrusage().<BR>
<BR>
Laci,<BR>
<BR>
I was able to get this to run on Darwin, but had to make the changes shown below because of the issue described above.<BR>
<BR>
</FONT><FONT COLOR="#000000" FACE="Monaco" FAMILY="FIXED" SIZE="1">// Copyright (C) 2002, International Business Machines<BR>
// Corporation and others. All Rights Reserved.<BR>
<BR>
#ifndef _CoinTime_hpp<BR>
#define _CoinTime_hpp<BR>
<BR>
//#############################################################################<BR>
<BR>
#include <ctime><BR>
#if defined(_MSC_VER)<BR>
// Turn off compiler warning about long names<BR>
# pragma warning(disable:4786)<BR>
#elif defined(__MACH__) // Added these lines<BR>
# include <sys/time.h> // Added these lines<BR>
# include <sys/resource.h> // Added these lines<BR>
#else<BR>
# include <sys/resource.h><BR>
#endif<BR>
<BR>
//#############################################################################<BR>
<BR>
static inline double CoinCpuTime()<BR>
{<BR>
double cpu_temp;<BR>
#if defined(_MSC_VER)<BR>
unsigned int ticksnow; /* clock_t is same as int */<BR>
<BR>
ticksnow = (unsigned int)clock();<BR>
<BR>
cpu_temp = (double)((double)ticksnow/CLOCKS_PER_SEC);<BR>
#else<BR>
struct rusage usage;<BR>
getrusage(RUSAGE_SELF,&usage);<BR>
cpu_temp = usage.ru_utime.tv_sec;<BR>
cpu_temp += 1.0e-6*((double) usage.ru_utime.tv_usec);<BR>
#endif<BR>
return cpu_temp;<BR>
}<BR>
<BR>
//#############################################################################<BR>
<BR>
#endif<BR>
</FONT><FONT COLOR="#000000" FACE="Geneva" FAMILY="SANSSERIF" SIZE="2"></FONT></HTML>