diff --git a/configure.ac b/configure.ac index 002b2df..80e8533 100755 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ esac # We can't do anything without a working MPI AX_PROG_CC_MPI(,,[ - AC_MSG_FAILURE([MPI compiler requested, but couldn't use MPI.]) + AC_MSG_FAILURE([MPI compiler requested, but could not use MPI.]) ]) AC_PROG_RANLIB @@ -85,7 +85,9 @@ AC_ARG_WITH([lustre], [], [with_lustre=check]) AS_IF([test "x$with_lustre" != xno], [ AC_CHECK_HEADERS([linux/lustre/lustre_user.h lustre/lustre_user.h], break, [ - if test "x$with_lustre" != xcheck; then + if test "x$with_lustre" != xcheck -a \ + "x$ac_cv_header_linux_lustre_lustre_user_h" = "xno" -a \ + "x$ac_cv_header_lustre_lustre_user_h" = "xno" ; then AC_MSG_FAILURE([--with-lustre was given, not found]) fi ]) diff --git a/src/aiori-POSIX.c b/src/aiori-POSIX.c index cb87297..94d0a7e 100755 --- a/src/aiori-POSIX.c +++ b/src/aiori-POSIX.c @@ -32,11 +32,10 @@ #include -#ifdef HAVE_LUSTRE_LUSTRE_USER_H -# include -#endif #ifdef HAVE_LINUX_LUSTRE_LUSTRE_USER_H # include +#elif defined(HAVE_LUSTRE_LUSTRE_USER_H) +# include #endif #ifdef HAVE_GPFS_H # include @@ -282,6 +281,12 @@ void *POSIX_Create(char *testFileName, IOR_param_t * param) return 0; #ifdef HAVE_LUSTRE_LUSTRE_USER_H +/* Add a #define for FASYNC if not available, as it forms part of + * the Lustre O_LOV_DELAY_CREATE definition. */ +#ifndef FASYNC +#define FASYNC 00020000 /* fcntl, for BSD compatibility */ +#endif + if (param->lustre_set_striping) { /* In the single-shared-file case, task 0 has to creat the file with the Lustre striping options before any other processes @@ -302,7 +307,8 @@ void *POSIX_Create(char *testFileName, IOR_param_t * param) opts.lmm_stripe_count = param->lustre_stripe_count; /* File needs to be opened O_EXCL because we cannot set - Lustre striping information on a pre-existing file. */ + * Lustre striping information on a pre-existing file.*/ + fd_oflag |= O_CREAT | O_EXCL | O_RDWR | O_LOV_DELAY_CREATE; *fd = open64(testFileName, fd_oflag, 0664);