Triton Repository branch, master, updated. 80aba4cea32ab45d6f11c561522e2b40cf5703cf
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Triton Repository". The branch, master has been updated via 80aba4cea32ab45d6f11c561522e2b40cf5703cf (commit) from 32d930776fced4110dc88849d53cf89ad6cce7be (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 80aba4cea32ab45d6f11c561522e2b40cf5703cf Author: slang <[email protected]> Date: Fri Feb 25 16:58:13 2011 -0600 changes to build on OS X ----------------------------------------------------------------------- Summary of changes: code/configure.ac | 28 ++++++++++++++++++---------- code/src/common/triton-debug.c | 6 ++++++ code/src/kv/test/nb-barrier.c | 2 +- code/src/kv/test/stats.c | 3 ++- code/src/kv/test/test-common.c | 27 ++++++++++++++++++++++++--- 5 files changed, 51 insertions(+), 15 deletions(-) Diff of changes: diff --git a/code/configure.ac b/code/configure.ac index 1dc53b6..de297ba 100644 --- a/code/configure.ac +++ b/code/configure.ac @@ -180,19 +180,27 @@ AC_ARG_ENABLE(coverage, ) AC_SUBST(ENABLE_COVERAGE) -AC_CHECK_HEADERS(sys/epoll.h) -AC_MSG_CHECKING(for epoll functions) -AC_TRY_LINK([#include <sys/epoll.h>], [ - int fd; - fd = epoll_create(1); - close(fd); +AC_MSG_CHECKING(if initstate_r() exists) +AC_TRY_COMPILE([#include <stdlib.h>], [ + struct random_data rnd; + initstate_r(0, NULL, 0, &rnd); ], - AC_MSG_RESULT(yes), - [ -dnl AC_MSG_ERROR(EPOLL: epoll required by aesop resource manager) - ] +[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_RANDOM_DATA, 1, [Define if struct random_data is defined and initstate_r exists]) +], + AC_MSG_RESULT(no) ) +AC_MSG_CHECKING(for __progname_full) +AC_TRY_LINK( + [#include <stdio.h>], + [extern char * __progname_full; + printf(NULL, "%s", __progname_full);], + [AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_PROGNAME_FULL, 1, Define if __progname_full global variable exists)], + [AC_MSG_RESULT(no)]) + dnl a mechanism to turn off threads in the client library AC_MSG_CHECKING([for client library thread safety support]) AC_ARG_ENABLE(thread-safety, diff --git a/code/src/common/triton-debug.c b/code/src/common/triton-debug.c index 766c3b7..b834cf2 100644 --- a/code/src/common/triton-debug.c +++ b/code/src/common/triton-debug.c @@ -16,8 +16,10 @@ uint32_t triton_debug_enabled_all = 0; uint32_t triton_debug_enabled_none = 1; TRITON_BITARRAY_VARDEF(triton_debug_enabled_minor, TRITON_DEBUG_MAXSIZE); +#ifdef HAVE_PROGNAME_FULL /* TODO: configure test for this; probably glibc specific */ extern char* __progname_full; +#endif static FILE *triton_debug_fp = NULL; static char *triton_debug_enabled_str = NULL; @@ -358,7 +360,11 @@ static triton_ret_t triton_debug_setfile(const char *file) i++; break; case 'e': +#ifdef HAVE_PROGNAME_FULL j += sprintf(&target[j], "%s", __progname_full); +#else + j += sprintf(&target[j], "unknown-program"); +#endif i++; break; case 'h': diff --git a/code/src/kv/test/nb-barrier.c b/code/src/kv/test/nb-barrier.c index 12180f5..a77aec8 100644 --- a/code/src/kv/test/nb-barrier.c +++ b/code/src/kv/test/nb-barrier.c @@ -1,7 +1,7 @@ #include "nb-barrier.h" #include <mpi.h> #include <assert.h> -#include <malloc.h> +#include <stdlib.h> struct nb_barrier { diff --git a/code/src/kv/test/stats.c b/code/src/kv/test/stats.c index 3076649..f750bfa 100644 --- a/code/src/kv/test/stats.c +++ b/code/src/kv/test/stats.c @@ -1,6 +1,7 @@ #include "stats.h" -#include <malloc.h> +#include <stdlib.h> +#include <stdio.h> #include <string.h> #include <float.h> diff --git a/code/src/kv/test/test-common.c b/code/src/kv/test/test-common.c index 5c970f1..a77b787 100644 --- a/code/src/kv/test/test-common.c +++ b/code/src/kv/test/test-common.c @@ -30,17 +30,29 @@ triton_ret_t generateKV (size_t id, size_t seed, void * key, size_t maxkey, *keysize = written; + size_t i; char rnddata[256]; memset (&rnddata[0], 0, sizeof(rnddata)); + char * ptr = (char *) data; + + /* we should probably use openssl rand interfaces where initstate_r + * doesn't exist (Darwin) + */ +#ifdef HAVE_RANDOM_DATA struct random_data rnd; memset (&rnd, 0, sizeof(rnd)); - size_t i; initstate_r (seed, &rnddata[0], sizeof(rnddata), &rnd); - char * ptr = (char *) data; +#else + initstate(seed, &rnddata[0], sizeof(rnddata)); +#endif for (i=0; i<datasize; ++i) { uint32_t val; +#ifdef HAVE_RANDOM_DATA random_r (&rnd, &val); +#else + val = random(); +#endif *ptr++ = val & 0xff; } return TRITON_SUCCESS; @@ -56,15 +68,24 @@ bool validateKV (const void * key, size_t keysize, const void * data, char rnddata[256]; memset (&rnddata[0], 0, sizeof(rnddata)); + size_t i; +#ifdef HAVE_RANDOM_DATA struct random_data rnd; memset (&rnd, 0, sizeof(rnd)); - size_t i; initstate_r (seed, &rnddata[0], sizeof(rnddata), &rnd); +#else + initstate(seed, &rnddata[0], sizeof(rnddata)); +#endif + const char * ptr = (const char *) data; for (i=0; i<datasize; ++i) { uint32_t val; +#ifdef HAVE_RANDOM_DATA random_r (&rnd, &val); +#else + val = random(); +#endif if (*ptr++ != (val && 0xff)) return false; hooks/post-receive -- Triton Repository
participants (1)
-
noreply@mcs.anl.gov