[MOAB-dev] r3994 - in MOAB/trunk: . src/io

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Jun 2 15:14:50 CDT 2010


Author: kraftche
Date: 2010-06-02 15:14:49 -0500 (Wed, 02 Jun 2010)
New Revision: 3994

Modified:
   MOAB/trunk/configure.ac
   MOAB/trunk/src/io/ReadHDF5.cpp
Log:
fix large file support on 32-bit machines (e.g. BGP).  you'll need to do 'make clean' and rebuild for this change to take effect

Modified: MOAB/trunk/configure.ac
===================================================================
--- MOAB/trunk/configure.ac	2010-06-02 20:14:05 UTC (rev 3993)
+++ MOAB/trunk/configure.ac	2010-06-02 20:14:49 UTC (rev 3994)
@@ -52,7 +52,13 @@
 ################################################################################
 AC_CHECK_FUNC([vsnprintf],[AM_CPPFLAGS="$AM_CPPFLAGS -DHAVE_VSNPRINTF"])
 
+# Use 64-bit off_t value for file offsets.  W/out this, the stat/fseek calls
+# in serial_open_file and other places will fail on 32-bit systems if the file 
+# is larger that 2GB.
+AM_CPPFLAGS="$AM_CPPFLAGS -D_FILE_OFFSET_BITS=64"
 
+
+
 ################################################################################
 #                           No-Namepsace (3.0) Headers
 ################################################################################

Modified: MOAB/trunk/src/io/ReadHDF5.cpp
===================================================================
--- MOAB/trunk/src/io/ReadHDF5.cpp	2010-06-02 20:14:05 UTC (rev 3993)
+++ MOAB/trunk/src/io/ReadHDF5.cpp	2010-06-02 20:14:49 UTC (rev 3994)
@@ -58,12 +58,6 @@
 
 #define READ_HDF5_BUFFER_SIZE (40*1024*1024)
 
-#if !defined(WIN32) && !defined(WIN64)
-# include <sys/stat.h>
-# include <unistd.h>
-# include <errno.h>
-#endif
-
 #define assert_range( PTR, CNT ) \
   assert( (PTR) >= (void*)dataBuffer ); assert( ((PTR)+(CNT)) <= (void*)(dataBuffer + bufferSize) );
 
@@ -300,20 +294,6 @@
   }
   else {
   
-      // first check if file exists, so we can fail w/out
-      // a lot of noise from the HDF5 library if it does not
-#if !defined(WIN32) && !defined(WIN64)
-    struct stat stat_info;
-    if (stat( filename, &stat_info)) {
-      if (ENOENT == errno)
-        return MB_FILE_DOES_NOT_EXIST;
-      else
-        return MB_FILE_WRITE_ERROR;
-    }
-    else if (S_ISDIR(stat_info.st_mode))


More information about the moab-dev mailing list