Closed seanm closed 9 years ago
Is this really on master? I don't see gettimeofday() in the master branch.
In the short run, if you add a line to libminc/CMakeLists.txt on or around line 112:
CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H)
you will probably be ok, if HAVE_CLOCK_GETTIME
is not set. Looking over this code, I think I need to rework the options to reflect current system dependencies. clock_gettime()
and associated constants are defined in <time.h>
, but gettimeofday()
depends on <sys/time.h>
.
@seanm Please see if the latest develop commit fixes the issue.
Ugh, indeed, I mean 'develop' branch... (I'm so used to mainline work being done in master.)
Your fix works, thanks!
git master has a warning:
volume_io/Prog_utils/time.c:141:9: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
time.c starts with:
I've confirmed that I don't get into "#if HAVE_SYS_TIME_H" and also confirmed that #including <sys/time.h> fixes the warning.
I'm on OS X and building with CMake. I don't know enough about MINC's build system to know why HAVE_SYS_TIME_H is not true for me.
Help? :)
Thanks.