Re: [netcdfgroup] Problem with netCDF "classic" files larger than 2GB on Windows

Try to compile with 64 bit off_t and lseek. E.g. in config.h

#define SIZEOF_OFF_T 8
#define lseek _lseeki64
#define off_t __int64
#define _off_t __int64
#define _OFF_T_DEFINED

Your test_big_classic.c works for me. The config.h I'm using with msvc9 is attached.

Christoph


On 7/5/2011 3:13 PM, Mark Rivers wrote:
Hi Russ and Ed,

Thanks for your replies.

I have now upgraded from netCDF 3.6.3 to 4.1.3 as you suggested.

I have reproduced the problem in a simple test program, which I have
attached. The test program creates a netCDF file of the following format
as revealed by ncdump:

corvette:areaDetector/ADApp/netCDFSrc>ncdump -k /home/epics/scratch/test.nc

classic

corvette:areaDetector/ADApp/netCDFSrc>ncdump -h /home/epics/scratch/test.nc

netcdf test {

dimensions:

numArrays = UNLIMITED ; // (4100 currently)

YSize = 1024 ;

XSize = 1024 ;

variables:

byte array_data(numArrays, YSize, XSize) ;

}

So it writes a 1024x1024 byte array to the file 4100 times, where 4100
is the unlimited dimension. This tests writing files that are larger
than both the 2GB and 4GB potential limits.

The test program runs fine on Linux and Cygwin.

However, when compiled with the Microsoft Visual Studio 2008 compiler,
it fails with exactly the same error I got in netCDF 3.6.3, except it is
now in line 342 rather than 325 of posixio.c.

writing record 2047/4100

writing record 2048/4100

Assertion failed: pxp->bf_offset <= offset && offset < pxp->bf_offset +
(off_t) pxp->bf_extent, file ..\..\..\ADApp\netCDFSrc\libsrc\posixio.c,
line 342

By way of background on why I need to use the Microsoft compiler:

I run a fairly large NSF-funded user facility at the Advanced Photon
Source at Argonne National Laboratory. We collect data using a wide
variety of x-ray and other detectors under a distributed real-time
control system called EPICS. Some of these detectors can be controlled
from Linux and Cygwin, but many of them have vendor-supplied drivers
that can only be called from code compiled with the Microsoft compiler.
I also need to build my application to run on the vxWorks and RTEMS
real-time operating systems, which we use to control specialized VME
hardware. These use the gcc compiler, but cross-compiling for the
real-time target on a Linux host.

I am building with gnumake, not the Visual Studio application
development environment on all platforms, including when building with
the Microsoft VC++ compiler on Windows.

I have also attached a copy of the config.h file I am using, which has
been modified from the version built by "configure" on Linux to do
things differently if _WIN32 or vxWorks are defined.

I had to make some minor changes to the 4.1.3 source code in order to
allow it to build with the Microsoft VS 2008 compiler, and to build on
vxWorks. I will send those changes in a separate e-mail.

I have also attached an IDL version of the same program. It should be
completely equivalent to the C program. It works fine on both Linux and
on Windows. It appears to me that the idl_netcdf.dll file that ITT
provides with IDL on Windows is built with the Microsoft compiler
(judging from dumpbin /imports), but I am not certain of this. If so, it
indicates that it is possible to write netCDF classic files when
compiling with Visual Studio, and I am probably just doing something wrong.

Perhaps it is in my flags to the compiler. Here is the output when I
compile posixio.c as an example of the flags I am using:

J:\epics\devel\areaDetector\ADApp\netCDFSrc>make install.win32-x86

make -C O.win32-x86 -f ../Makefile TOP=../../.. T_A=win32-x86 install

make[1]: Entering directory
`J:/epics/devel/areaDetector/ADApp/netCDFSrc/O.win32-x86'

cl -c /nologo /D__STDC__=0 /D_CRT_SECURE_NO_DEPRECATE
/D_CRT_NONSTDC_NO_DEPRECATE /Ox /GL /W3 /w44355 /D_WIN32_WINNT=0x0503
-DHAVE_CONFIG_H /MT -DEPICS_DLL_NO - I. -I..\\O.Common - I. -I..
-I..\\..\\..\\ADApp\\netCDFSrc\\include
-I..\\..\\..\\ADApp\\netCDFSrc\\libsrc
-I..\\..\\..\\ADApp\\netCDFSrc\\libdispatch
-I..\\..\\..\\ADApp\\netCDFSrc\\liblib -I..\\..\\..\\include\\os\\WIN32
-I..\\..\\..\\include -IJ:\\epics\\devel\\asyn-4-17\\include
-IJ:\\epics\\devel\\calc-2-8\\include
-IJ:\\epics\\devel\\busy-1-3\\include
-IJ:\\epics\\devel\\sscan-2-6-6\\include
-IJ:\\epics\\devel\\mca-6-12-4\\include
-IJ:\\epics\\devel\\autosave-4-7\\include\\os\\WIN32
-IJ:\\epics\\devel\\autosave-4-7\\include
-IJ:\\epics\\devel\\areaDetector-1-7beta1\\include\\os\\WIN32
-IJ:\\epics\\devel\\areaDetector-1-7beta1\\include
-IH:\\epics\\base-3.14.12.1\\include\\os\\WIN32
-IH:\\epics\\base-3.14.12.1\\include
-I..\\..\\..\\ADApp\\netCDFSrc\\include
..\\..\\..\\ADApp\\netCDFSrc\\libsrc\\posixio.c

posixio.c

..\..\..\ADApp\netCDFSrc\libsrc\posixio.c(433) : warning C4018: '<' :
signed/unsigned mismatch

..\..\..\ADApp\netCDFSrc\libsrc\posixio.c(441) : warning C4018: '<=' :
signed/unsigned mismatch

..\..\..\ADApp\netCDFSrc\libsrc\posixio.c(449) : warning C4018: '<=' :
signed/unsigned mismatch

..\..\..\ADApp\netCDFSrc\libsrc\posixio.c(454) : warning C4018: '>' :
signed/unsigned mismatch

Thanks,

Mark

-----Original Message-----
From: Russ Rew [mailto:russ@xxxxxxxxxxxxxxxx]
Sent: Wednesday, June 29, 2011 1:34 PM
To: Mark Rivers
Cc: netcdfgroup@xxxxxxxxxxxxxxxx
Subject: Re: [netcdfgroup] Problem with netCDF "classic" files larger
than 2GB on Windows

Hi Mark,

 I am having a problem writing netCDF "classic" files larger than 2GB

 when building with the Microsoft Visual Studio 2008 compiler. The same

 code works fine when build on Linux, and on Cygwin.



 A bit of background. This is a project to build generic file writers

 for cameras and detectors in the areaDetector package

 (http://cars9.uchicago.edu/software/epics/areaDetectorDoc.html) for the

 EPICS (http://www.aps.anl.gov/epics/) real-time control system. This is

 a large project, with its own build system based on gnumake. I am

 building the basic netCDF library from the same source code on all

 supported platforms (Linux 32 and 64-bit, Windows 32 and 64-bit with

 Microsoft compiler, Windows with Cygwin gcc compilet, vxWorks, Darwin ,

 Solaris, etc.). Because I have another file writer that handles HDF5, I

 am using netCDF 3.6.3, since I only want to netCDF to create "classic"

 files. I am using 3.6.3 because it is less complex than 4.x, not

 requiring any HDF5 support, etc.

I recommend you use the latest netCDF-4 release, 4.1.3. If you don't

have and HDF5 library installed, it will be built without support for

netCDF-4, but with bug fixes since 3.6.3 was released 3 years ago. For

example, these bug fixes were mentioned in the RELEASE_NOTES for 4.1.2:

Fixed two large-file bugs with using classic format or

64-bit offset format and accessing multidimensional

variables with more than 2**32 values.

If the problem you're seeing still occurs in releases since 4.1.2, it

may be something new.

--Russ

 The application is typically streaming uncompressed images, using the

 UNLIMITED dimension as the streaming dimension. Thus, each record is

 small, only a few MB, and the file size limitations of the classic

 format are not a problem. Here is an ncdump of a file header created

 with this file writer on Linux:



 corvette:ADApp/op/adl>ncdump -h /home/epics/scratch/netcdf_test_1.nc

 netcdf netcdf_test_1 {

 dimensions:

 numArrays =3D UNLIMITED ; // (4100 currently)

 dim0 =3D 1024 ;

 dim1 =3D 1024 ;

 attrStringSize =3D 256 ;

 variables:

 int uniqueId(numArrays) ;

 double timeStamp(numArrays) ;

 byte array_data(numArrays, dim0, dim1) ;

 int Attr_ColorMode(numArrays) ;

 double Attr_AcquireTime(numArrays) ;

 double Attr_RingCurrent(numArrays) ;

 char Attr_RingCurrent_EGU(numArrays, attrStringSize) ;

 double Attr_ID_Energy(numArrays) ;

 char Attr_ID_Energy_EGU(numArrays, attrStringSize) ;

 int Attr_ImageCounter(numArrays) ;

 int Attr_MaxSizeX(numArrays) ;

 int Attr_MaxSizeY(numArrays) ;

 char Attr_CameraModel(numArrays, attrStringSize) ;

 char Attr_CameraManufacturer(numArrays, attrStringSize) ;



 // global attributes:

 :dataType =3D 1 ;

 :NDNetCDFFileVersion =3D 3. ;

 :numArrayDims =3D 2 ;

 :dimSize =3D 1024, 1024 ;

 ...



 So the only large array is called "array_data", and in this case it is

 [4100, 1024, 1024], where 4100 is the unlimited dimension. Thus, this

 file is over 4GB, and it can be written and read with no problems on

 Linux and Cygwin. It also works fine when writing files on Windows with

 the Microsoft compiler, up to file sizes of 2GB.



 However, when I try to write a file on Windows larger than 2GB using the

 program built with the Visual Studio compiler I get the following error:



 Assertion failed: pxp->bf_offset <=3D offset && offset < pxp->bf_offset =

 +

 (off_t) pxp->bf_extent, file ..\posixio.c, line 325



 When I look at the code at line 325 in posixio.c, I see that offset and

 pdxp->bf_offset are of type off_t. I added a printf() in that code to

 print the sizeof(offset) and sizeof(off_t), and it comes up as 4, not 8.





 But when I look at the config.h file that comes in the win32/NET

 directory in netCDF 3.6.3 it has the following:

 corvette:areaDetector/ADApp/netCDFSrc>grep -C3 off_t

 /usr/local/netcdf/netcdf-3.6.3/win32/NET/config.h

 /* #undef HAVE_ST_BLKSIZE */



 /* Define to `long' if <sys/types.h> doesn't define. */

 /* #undef off_t */



 /* Define to `unsigned' if <sys/types.h> doesn't define. */

 /* #undef size_t */

 --

 /* The number of bytes in a size_t */

 #define SIZEOF_SIZE_T 4



 /* The number of bytes in a off_t */

 #define SIZEOF_OFF_T 8



 /* Define to `int' if system doesn't define. */





 So it defines SIZEOF_OFF_T to be 8, not 4.



 I have generated the netCDF config.h file on Linux, but then edited it

 to correctly (?) define things on other platforms, like _WIN32 and

 vxWorks.



 The compiler flags being used on Windows are illustrated in the

 following output when I build:



 cl -c /nologo /D__STDC__=3D0 /D_CRT_SECURE_NO_DEPRECATE

 /D_CRT_NONSTDC_NO_DEPRECATE /Ox /GL /W3 /w44355

 /D_WIN32_WINNT=3D0x0503 -D_FILE_OFFSET_BITS=3D64 /MT -DEPICS_DLL_NO =

 -I.

 -I..\\O.Common - I. -I.. -I..\\..\\..\\include\\os\\WIN32

 -I..\\..\\..\\include -IJ:\\epics\\devel\\asyn-4-17\\include

 -IJ:\\epics\\devel\\calc-2-8\\include

 -IJ:\\epics\\devel\\busy-1-3\\include

 -IJ:\\epics\\devel\\sscan-2-6-6\\include

 -IJ:\\epics\\devel\\mca-6-12-4\\include

 -IJ:\\epics\\devel\\autosave-4-7\\include\\os\\WIN32

 -IJ:\\epics\\devel\\autosave-4-7\\include

 -IJ:\\epics\\devel\\areaDetector-1-7beta1\\include\\os\\WIN32

 -IJ:\\epics\\devel\\areaDetector-1-7beta1\\include

 -IH:\\epics\\base-3.14.12.1\\include\\os\\WIN32

 -IH:\\epics\\base-3.14.12.1\\include ..\\var.c



 There is something I don't understand here.



 Has netCDF 3.6.3 been tested to correctly write classic files > 2GB with

 the Microsoft compiler? Why am I getting the assert error?



 Thanks very much,

 Mark Rivers



_______________________________________________
netcdfgroup mailing list
netcdfgroup@xxxxxxxxxxxxxxxx
For list information or to unsubscribe,  visit: 
http://www.unidata.ucar.edu/mailing_lists/
/* config.h.  Generated from config.h.in by configure.  */
/* config.h.in.  Generated from configure.ac by autoheader.  */

/* What sort of HTTP client is this? */
/* #undef CNAME */

/* Should the subprocess compression for Server3 be includes? */
/* #undef COMPRESSION_FOR_SERVER3 */

#define DEFAULT_CHUNK_SIZE 4194304

/* num chunks in default per-var chunk cache. */
#define DEFAULT_CHUNKS_IN_CACHE 10

/* max size of the default per-var chunk cache. */
#define MAX_DEFAULT_CACHE_SIZE 67108864

/* default chunk cache nelems. */
#define CHUNK_CACHE_NELEMS 1000

/* default chunk cache preemption policy. */
#define CHUNK_CACHE_PREEMPTION 0.75

/* default chunk cache size in bytes. */
#define CHUNK_CACHE_SIZE 32000000

/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
   systems. This function is required for `alloca.c' support on those systems.
   */
/* #undef CRAY_STACKSEG_END */

/* Client version number */
/* #undef CVER */

/* Define to 1 if using `alloca.c'. */
/* #undef C_ALLOCA */

/* What DAP version is supported? */
/* #undef DAP_PROTOCOL_VERSION */

/* dbyte */
/* #undef DBYTE */

/* dfloat32 */
/* #undef DFLOAT32 */

/* dfloat64 */
/* #undef DFLOAT64 */

/* dint16 */
/* #undef DINT16 */

/* int32 */
/* #undef DINT32 */

/* set this only when building a DLL under MinGW */
/* #undef DLL_NETCDF */
#define DLL_NETCDF 1

/* uint16 */
/* #undef DUINT16 */

/* uint32 */
/* #undef DUINT32 */

/* Client name and version combined */
/* #undef DVR */

/* Should all the classes run ConstraintEvaluator::eval()? */
/* #undef EVAL */

/* if true, run extra tests which may not work with HDF5 beta release */
/* #undef EXTRA_TESTS */

/* use HDF5 1.6 API */
#define H5_USE_16_API 1

/* Define to 1 if you have the `alarm' function. */
/* #undef HAVE_ALARM */

/* Define to 1 if you have `alloca', as a function or macro. */
/*#define HAVE_ALLOCA 1*/

/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
   */
/*#define HAVE_ALLOCA_H 1*/

/* Define to 1 if you have the `atexit' function. */
/* #undef HAVE_ATEXIT */

/* Define to 1 if you have the `bzero' function. */
/* #undef HAVE_BZERO */

/* Define to 1 if you have the declaration of `isfinite', and to 0 if you
   don't. */
/*#define HAVE_DECL_ISFINITE 1*/

/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't.
   */
/*#define HAVE_DECL_ISINF 1*/

/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
   */
/*#define HAVE_DECL_ISNAN 1*/

/* Define to 1 if you have the declaration of `signbit', and to 0 if you
   don't. */
#define HAVE_DECL_SIGNBIT 1

/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
   */
/* #undef HAVE_DIRENT_H */

/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1

/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */

/* Define to 1 if you have the `dup2' function. */
/* #undef HAVE_DUP2 */

/* Define to 1 if you have the <fcntl.h> header file. */
/* #undef HAVE_FCNTL_H */

/* Define to 1 if you have the <float.h> header file. */
/* #undef HAVE_FLOAT_H */

/* Define to 1 if you have the `floor' function. */
/* #undef HAVE_FLOOR */

/* Define to 1 if you have the `getcwd' function. */
/* #undef HAVE_GETCWD */

/* Define to 1 if you have the `getpagesize' function. */
/* #undef HAVE_GETPAGESIZE */

/* Define to 1 if you have the <hdf5.h> header file. */
#define HAVE_HDF5_H 1

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the `hdf5' library (-lhdf5). */
#define HAVE_LIBHDF5 1

/* Define to 1 if you have the `hdf5_hl' library (-lhdf5_hl). */
#define HAVE_LIBHDF5_HL 1

/* Define to 1 if you have the <limits.h> header file. */
/* #undef HAVE_LIMITS_H */

/* Define to 1 if you have the `localtime_r' function. */
/* #undef HAVE_LOCALTIME_R */

/* Define to 1 if the system has the type `long long int'. */
#define HAVE_LONG_LONG_INT 1

/* Define to 1 if you have the <malloc.h> header file. */
/* #undef HAVE_MALLOC_H */

/* Define to 1 if you have the `memchr' function. */
/* #undef HAVE_MEMCHR */

/* Define to 1 if you have the `memmove' function. */
/* #undef HAVE_MEMMOVE */

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `memset' function. */
/* #undef HAVE_MEMSET */

/* Define to 1 if you have the `mktime' function. */
/* #undef HAVE_MKTIME */

/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */

/* Define to 1 if you have the <netinet/in.h> header file. */
/* #undef HAVE_NETINET_IN_H */

/* Define to 1 if you have the `pow' function. */
/* #undef HAVE_POW */

/* Define to 1 if the system has the type `ptrdiff_t'. */
#define HAVE_PTRDIFF_T 1

/* Define to 1 if you have the `putenv' function. */
/* #undef HAVE_PUTENV */

/* Define to 1 if you have the `regcomp' function. */
/* #undef HAVE_REGCOMP */

/* Define to 1 if you have the `setenv' function. */
/* #undef HAVE_SETENV */

/* Define to 1 if the system has the type `ssize_t'. */
/*#define HAVE_SSIZE_T 1*/

/* Define to 1 if you have the <sstream> header file. */
/* #undef HAVE_SSTREAM */

/* Define to 1 if stdbool.h conforms to C99. */
/*#define HAVE_STDBOOL_H 1*/

/* Define to 1 if you have the <stddef.h> header file. */
/* #undef HAVE_STDDEF_H */

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the `strchr' function. */
/* #undef HAVE_STRCHR */

/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the `strlcat' function. */
/*#define HAVE_STRLCAT 1*/

/* Define to 1 if you have the `strrchr' function. */
/* #undef HAVE_STRRCHR */

/* Define to 1 if you have the `strstr' function. */
/* #undef HAVE_STRSTR */

/* Define to 1 if you have the `strtol' function. */
/* #undef HAVE_STRTOL */

/* Define to 1 if you have the `strtoul' function. */
/* #undef HAVE_STRTOUL */

/* Define to 1 if `st_blksize' is member of `struct stat'. */
/*#define HAVE_STRUCT_STAT_ST_BLKSIZE 1*/

/* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use
   `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */
/*#define HAVE_ST_BLKSIZE 1*/

/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
   */
/* #undef HAVE_SYS_DIR_H */

/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
   */
/* #undef HAVE_SYS_NDIR_H */

/* Define to 1 if you have the <sys/param.h> header file. */
/* #undef HAVE_SYS_PARAM_H */

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/time.h> header file. */
/* #undef HAVE_SYS_TIME_H */

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
/* #undef HAVE_SYS_WAIT_H */

/* Define to 1 if you have the `timegm' function. */
/* #undef HAVE_TIMEGM */

/* Define to 1 if the system has the type `uchar'. */
/* #undef HAVE_UCHAR */

/* Define to 1 if you have the <unistd.h> header file. */
/*#define HAVE_UNISTD_H 1*/

/* Added to fool ncgen. */
#define YY_NO_UNISTD_H 1

/* Define to 1 if the system has the type `unsigned long long int'. */
#define HAVE_UNSIGNED_LONG_LONG_INT 1

/* Define to 1 if you have the `vprintf' function. */
/* #undef HAVE_VPRINTF */

/* Define to 1 if the system has the type `_Bool'. */
/*#define HAVE__BOOL 1*/

/* if true, use HDF5 data conversions */
/* #undef HDF5_CONVERT */

/* do large file tests */
/* #undef LARGE_FILE_TESTS */

/* Set to the prefix directory */
/* #undef LIBDAP_ROOT */

/* if true, turn on netCDF-4 logging */
/* #undef LOGGING */

/* Define to the sub-directory in which libtool stores uninstalled libraries.
   */
#define LT_OBJDIR ".libs/"

/* type definition */
#define NCBYTE_T byte

/* type definition */
#define NCSHORT_T integer*2

/* default */
#define NF_DOUBLEPRECISION_IS_C_DOUBLE 1

/* default */
#define NF_INT1_IS_C_SIGNED_CHAR 1

/* type thing */
#define NF_INT1_T byte

/* default */
#define NF_INT2_IS_C_SHORT 1

/* type thing */
#define NF_INT2_T integer*2

/* default */
#define NF_INT_IS_C_INT 1

/* default */
#define NF_REAL_IS_C_FLOAT 1

/* no IEEE float on this platform */
/* #undef NO_IEEE_FLOAT */

/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */

/* do not build the netCDF version 2 API */
/* #undef NO_NETCDF_2 */
//#define NO_NETCDF_2 1

/* no stdlib.h */
/* #undef NO_STDLIB_H */

/* no sys_types.h */
/* #undef NO_SYS_TYPES_H */

/* Name of package */
#define PACKAGE "netcdf"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "support@xxxxxxxxxxxxxxxx"

/* Define to the full name of this package. */
#define PACKAGE_NAME "netCDF"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "netCDF 4.1.3"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "netcdf"

/* Define to the version of this package. */
#define PACKAGE_VERSION "4.1.3"

/* Define as the return type of signal handlers (`int' or `void'). */
/* #undef RETSIGTYPE */

/* The size of `char', as computed by sizeof. */
/* #undef SIZEOF_CHAR */

/* The size of `double', as computed by sizeof. */
#define SIZEOF_DOUBLE 8

/* The size of `float', as computed by sizeof. */
#define SIZEOF_FLOAT 4

/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4

/* The size of `int16_t', as computed by sizeof. */
/* #undef SIZEOF_INT16_T */

/* The size of `int32_t', as computed by sizeof. */
/* #undef SIZEOF_INT32_T */

/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4

/* The size of `off_t', as computed by sizeof. */
#define SIZEOF_OFF_T 8

/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2

/* The size of `size_t', as computed by sizeof. */
#ifdef _WIN64
typedef unsigned __int64 size_t;
typedef __int64 ssize_t;
#define SIZEOF_SIZE_T 8
#else
typedef unsigned int size_t;
typedef int ssize_t;
#define SIZEOF_SIZE_T 4
#endif

/* The size of `uint16_t', as computed by sizeof. */
/* #undef SIZEOF_UINT16_T */

/* The size of `uint32_t', as computed by sizeof. */
/* #undef SIZEOF_UINT32_T */

/* The size of `uint8_t', as computed by sizeof. */
/* #undef SIZEOF_UINT8_T */

/* If using the C implementation of alloca, define if you know the
   direction of stack growth for your system; otherwise it will be
   automatically deduced at runtime.
        STACK_DIRECTION > 0 => grows toward higher addresses
        STACK_DIRECTION < 0 => grows toward lower addresses
        STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Place to put very large netCDF test files. */
#define TEMP_LARGE "."

/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
/* #undef TIME_WITH_SYS_TIME */

/* if true, build DAP Client */
//#define USE_DAP 1

/* set this to use extreme numbers in tests */
#define USE_EXTREME_NUMBERS 1

/* if true, build netCDF-4 */
#define USE_NETCDF4 1

/*#define HAVE_GETOPT_H 1*/

/* if true, parallel netCDF-4 is in use */
/* #undef USE_PARALLEL */

/* if true, compile in parallel netCDF-4 based on MPI/IO */
/* #undef USE_PARALLEL_MPIO */

/* if true, compile in parallel netCDF-4 based on MPI/POSIX */
/* #undef USE_PARALLEL_POSIX */

/* if true, build libsrc code with renamed API functions */
#define USE_RENAMEV3 1

/* if true, compile in zlib compression in netCDF-4 variables */
#define USE_ZLIB 1

/* Version number of package */
//#define VERSION "4.1.3"

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
   significant byte first (like Motorola and SPARC, unlike Intel and VAX). */
#if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
#elif ! defined __LITTLE_ENDIAN__
/* # undef WORDS_BIGENDIAN */
#endif

/* xdr float32 */
/* #undef XDR_FLOAT32 */

/* xdr float64 */
/* #undef XDR_FLOAT64 */

/* xdr int16 */
/* #undef XDR_INT16 */

/* xdr int32 */
/* #undef XDR_INT32 */

/* xdr uint16 */
/* #undef XDR_UINT16 */

/* xdr uint32 */
/* #undef XDR_UINT32 */

/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */

/* Needed by HPUX with c89 compiler. */
/* #undef _HPUX_SOURCE */

/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */

/* Define to 1 if type `char' is unsigned and you are not using gcc.  */
#ifndef __CHAR_UNSIGNED__
/* # undef __CHAR_UNSIGNED__ */
#endif

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Turned on by netCDF configure. */
/* #undef f2cFortran */

/* Turned on by netCDF configure. */
/* #undef gFortran */

/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */

/* Turned on by netCDF configure. */
/*#define pgiFortran 1*/

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

/* Define to empty if the keyword `volatile' does not work. Warning: valid
   code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */

/* Shorthand for gcc's unused attribute feature */
#if defined(__GNUG__) || defined(__GNUC__)
#define not_used __attribute__ ((unused))
#else
#define not_used 
#endif /* __GNUG__ || __GNUC__ */

/* I added the following to this config.h file by hand, after being abducted by 
   aliens last week in Kansas. (All Hail Zorlock, Mighty Destroyer of Worlds!) 
*/
#include <io.h>
#include <process.h>
#define lseek _lseeki64
#define off_t __int64
#define _off_t __int64
#define _OFF_T_DEFINED
#define snprintf sprintf_s
#define strcasecmp _stricmp

#define HAVE_STRDUP 1
  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: