diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2006-11-06 22:17:46 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2006-11-06 22:17:46 (GMT) |
commit | 8e0a4a03c0a7923057eeb2b8b2ac16338fc87e76 (patch) | |
tree | e95317e9f70ba1bcfaab80b88e1368038ba1b2b1 /configure.in | |
parent | 2e8e42d6c9a229d0490cd97e9711fb707ad67578 (diff) | |
download | hdf5-8e0a4a03c0a7923057eeb2b8b2ac16338fc87e76.zip hdf5-8e0a4a03c0a7923057eeb2b8b2ac16338fc87e76.tar.gz hdf5-8e0a4a03c0a7923057eeb2b8b2ac16338fc87e76.tar.bz2 |
[svn-r12870] Add a new macro H5_HAVE_DIRECT_ALIGN in configure.in. Some systems like copper and sleipnir
doesn't require alignment for Direct I/O. If this's true, write or read data just like sec2
does.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/configure.in b/configure.in index fa13ecd..ff618c7 100644 --- a/configure.in +++ b/configure.in @@ -2572,7 +2572,7 @@ if test "$STREAM_VFD" = "yes"; then fi dnl ---------------------------------------------------------------------- -dnl Check if Direct I/O driver is wanted by --enable-direct-vfd +dnl Check if Direct I/O driver is enabled by --enable-direct-vfd dnl AC_MSG_CHECKING([for Direct Virtual File Driver support]) @@ -2612,6 +2612,46 @@ else fi AM_CONDITIONAL([DIRECT_VFD_CONDITIONAL], [test "X$DIRECT_VFD" = "Xyes"]) + +dnl ---------------------------------------------------------------------- +dnl Check if Direct I/O driver requires alignment. +dnl + +if test ${hdf5_direct_io} = "yes"; then + AC_MSG_CHECKING([for Direct VFD alignment requirement]) + + AC_CACHE_VAL([hdf5_direct_align], + [AC_TRY_RUN([ + #include <stdlib.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <fcntl.h> + int main(void) + { + int *buf; + int fid; + fid=open("tst_file", O_CREAT | O_TRUNC | O_DIRECT | O_RDWR, 0755); + buf = (int*)malloc(sizeof(int)); + if(write(fid, (void*)buf, sizeof(int))<0) { + close(fid); + free(buf); + remove("tst_file"); + exit(1); + } + close(fid); + remove("tst_file"); + free(buf); + exit (0); + }], [hdf5_direct_align=no], [hdf5_direct_align=yes],)]) + + if test ${hdf5_direct_align} = "yes"; then + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_DIRECT_ALIGN], [1], + [Define if the direct I/O VFD requires alignment]) + else + AC_MSG_RESULT([no]) + fi +fi dnl ---------------------------------------------------------------------- dnl Decide whether the presence of user's exception handling functions is |