mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
replace USE_CDF5 with ENABLE_CDF5
This commit is contained in:
parent
a2a33b3a53
commit
f95d3e3325
@ -109,7 +109,6 @@ are set when opening a binary file on Windows. */
|
||||
|
||||
/* if true, enable CDF5 Support */
|
||||
#cmakedefine ENABLE_CDF5 1
|
||||
#cmakedefine USE_CDF5 1
|
||||
|
||||
/* if true, enable strict null byte header padding. */
|
||||
#cmakedefine USE_STRICT_NULL_BYTE_HEADER_PADDING 1
|
||||
|
@ -906,11 +906,8 @@ fi
|
||||
AC_MSG_RESULT($enable_cdf5)
|
||||
|
||||
if test "x${enable_cdf5}" = xyes; then
|
||||
AC_DEFINE([USE_CDF5], [1], [if true, enable CDF5 Support])
|
||||
AC_DEFINE([ENABLE_CDF5], [1], [if true, enable CDF5 Support])
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(USE_CDF5, [test x$enable_cdf5 = xyes ])
|
||||
AM_CONDITIONAL(ENABLE_CDF5, [test x$enable_cdf5 = xyes ])
|
||||
|
||||
$SLEEPCMD
|
||||
|
@ -2106,7 +2106,7 @@ NC_create(const char *path0, int cmode, size_t initialsz,
|
||||
model = NC_FORMATX_NC4;
|
||||
break;
|
||||
#endif
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
case NC_FORMAT_CDF5:
|
||||
xcmode |= NC_64BIT_DATA;
|
||||
model = NC_FORMATX_NC3;
|
||||
@ -2322,7 +2322,7 @@ NC_open(const char *path0, int cmode, int basepe, size_t *chunksizehintp,
|
||||
hdf4built = 1;
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
cdf5built = 1;
|
||||
#endif
|
||||
if(!hdf5built && model == NC_FORMATX_NC4) {
|
||||
|
@ -100,7 +100,7 @@ err:
|
||||
int
|
||||
nc3_cktype(int mode, nc_type type)
|
||||
{
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
if (mode & NC_CDF5) { /* CDF-5 format */
|
||||
if (type >= NC_BYTE && type < NC_STRING) return NC_NOERR;
|
||||
} else
|
||||
@ -1167,7 +1167,7 @@ nc_set_default_format(int format, int *old_formatp)
|
||||
return NC_EINVAL;
|
||||
#else
|
||||
if (format != NC_FORMAT_CLASSIC && format != NC_FORMAT_64BIT_OFFSET
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
&& format != NC_FORMAT_CDF5
|
||||
#endif
|
||||
)
|
||||
@ -1698,7 +1698,7 @@ NC3_inq_format(int ncid, int *formatp)
|
||||
return NC_NOERR;
|
||||
|
||||
/* only need to check for netCDF-3 variants, since this is never called for netCDF-4 files */
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
if (fIsSet(nc3->flags, NC_64BIT_DATA))
|
||||
*formatp = NC_FORMAT_CDF5;
|
||||
else
|
||||
|
@ -27,7 +27,7 @@ endif
|
||||
|
||||
if TEST_PARALLEL4
|
||||
if USE_PNETCDF
|
||||
if USE_CDF5
|
||||
if ENABLE_CDF5
|
||||
TESTPROGRAMS += tst_cdf5format
|
||||
endif
|
||||
endif
|
||||
|
@ -134,7 +134,7 @@ main(int argc, char *argv[])
|
||||
break;
|
||||
|
||||
case NC_FORMAT_CDF5:
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
nc_set_default_format(NC_FORMAT_CDF5, NULL);
|
||||
fprintf(stderr, "\n\nSwitching to 64-bit data format.\n");
|
||||
strcpy(testfile, "nc_test_cdf5.nc");
|
||||
|
@ -361,7 +361,7 @@ main(int argc, char *argv[])
|
||||
MPI_Init(&argc, &argv);
|
||||
|
||||
cmode |= (NC_PNETCDF);
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
cmode |= (NC_64BIT_DATA);
|
||||
#endif
|
||||
ret = nc_create_par(fname,cmode, MPI_COMM_WORLD, MPI_INFO_NULL, &id);
|
||||
|
@ -2424,7 +2424,7 @@ APIFunc(get_file_version)(char *path, int *version)
|
||||
if (strncmp(magic, "CDF", MAGIC_NUM_LEN-1)==0) {
|
||||
if (magic[MAGIC_NUM_LEN-1] == NC_FORMAT_CLASSIC ||
|
||||
magic[MAGIC_NUM_LEN-1] == NC_FORMAT_64BIT_OFFSET
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
|| magic[MAGIC_NUM_LEN-1] == NC_FORMAT_CDF5
|
||||
#endif
|
||||
)
|
||||
|
@ -54,7 +54,7 @@ int main(int argc, char** argv) {
|
||||
buf = (int*) malloc(NY*NX * sizeof(int));
|
||||
|
||||
for (k=0; k<5; k++) {
|
||||
#ifndef USE_CDF5
|
||||
#ifndef ENABLE_CDF5
|
||||
if (formats[k] == NC_FORMAT_CDF5) continue;
|
||||
#endif
|
||||
#ifndef USE_NETCDF4
|
||||
|
@ -37,7 +37,7 @@ main(int argc, char **argv)
|
||||
num_formats += 2;
|
||||
#endif
|
||||
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
num_formats++;
|
||||
#endif
|
||||
|
||||
@ -46,7 +46,7 @@ main(int argc, char **argv)
|
||||
|
||||
formats[n++] = 0;
|
||||
formats[n++] = NC_64BIT_OFFSET;
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
formats[n++] = NC_64BIT_DATA;
|
||||
#endif
|
||||
#ifdef USE_NETCDF4
|
||||
|
@ -225,7 +225,7 @@ main(int argc, char **argv)
|
||||
NC_FORMAT_CLASSIC
|
||||
,
|
||||
NC_FORMAT_64BIT_OFFSET
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
,
|
||||
NC_FORMAT_CDF5
|
||||
#endif
|
||||
|
@ -55,7 +55,7 @@ static int file_create(const char *filename, int cmode, int *ncid)
|
||||
#ifdef USE_PNETCDF
|
||||
if (default_format == NC_FORMAT_CLASSIC ||
|
||||
default_format == NC_FORMAT_64BIT_OFFSET
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
|| default_format == NC_FORMAT_64BIT_DATA
|
||||
#endif
|
||||
)
|
||||
@ -525,7 +525,7 @@ main(int argc, char **argv)
|
||||
printf("Switching to 64-bit offset format.\n");
|
||||
strcpy(testfile, "tst_small_64bit.nc");
|
||||
break;
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
case NC_FORMAT_CDF5:
|
||||
nc_set_default_format(NC_FORMAT_CDF5, NULL);
|
||||
printf("Switching to 64-bit data format.\n");
|
||||
|
@ -1706,7 +1706,7 @@ copy(char* infile, char* outfile)
|
||||
create_mode |= NC_64BIT_OFFSET;
|
||||
break;
|
||||
case NC_FORMAT_CDF5:
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
create_mode |= NC_64BIT_DATA;
|
||||
break;
|
||||
#else
|
||||
|
@ -11,7 +11,7 @@ set -e
|
||||
# This shell script runs the ncdump tests.
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
CDF5=1
|
||||
else
|
||||
CDF5=0
|
||||
@ -51,7 +51,7 @@ echo "*** creating 64-bit offset file c0_64_run_ncgen_tests.nc from c0.cdl..."
|
||||
|
||||
validateNC c0 "c0_64" -k 64-bit-offset -b
|
||||
|
||||
if test "x$USE_CDF5" = x1 ; then
|
||||
if test "x$ENABLE_CDF5" = x1 ; then
|
||||
|
||||
echo "*** creating 64-bit data file c5.nc from c5.cdl..."
|
||||
${NCGEN} -k 64-bit-data -b -o tst_c5_run_ncgen_tests.nc $top_srcdir/ncgen/c5.cdl
|
||||
|
@ -8,7 +8,7 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
# This shell script runs the ncdump tests.
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
CDF5=1
|
||||
else
|
||||
CDF5=0
|
||||
|
@ -12,7 +12,7 @@
|
||||
#define DIMMAXCLASSIC (NC_MAX_INT - 3)
|
||||
#define DIMMAX64OFFSET (NC_MAX_UINT - 3)
|
||||
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
#define DIMMAX64DATA (NC_MAX_UINT64 - 3)
|
||||
#endif
|
||||
|
||||
@ -66,7 +66,7 @@ main(int argc, char **argv)
|
||||
if(dimsize != DIMMAX64OFFSET) ERR;
|
||||
if ((stat=nc_close(ncid))) ERRSTAT(stat);
|
||||
|
||||
#ifdef USE_CDF5
|
||||
#ifdef ENABLE_CDF5
|
||||
if(sizeof(size_t) == 8) {
|
||||
printf("\n*** Writing Max Dimension Size (%llu) For NC_64BIT_DATA\n",DIMMAX64DATA);
|
||||
if ((stat=nc_create(FILE64DATA, NC_CLOBBER | NC_64BIT_DATA, &ncid))) ERRSTAT(stat);
|
||||
@ -81,7 +81,7 @@ main(int argc, char **argv)
|
||||
if(dimsize != DIMMAX64DATA) ERR;
|
||||
if ((stat=nc_close(ncid))) ERRSTAT(stat);
|
||||
}
|
||||
#endif /* USE_CDF5 */
|
||||
#endif /* ENABLE_CDF5 */
|
||||
|
||||
SUMMARIZE_ERR;
|
||||
FINAL_RESULTS;
|
||||
|
@ -6,10 +6,10 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
# This shell script runs the ncdump tests.
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
USE_CDF5=1
|
||||
if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
ENABLE_CDF5=1
|
||||
else
|
||||
USE_CDF5=0
|
||||
ENABLE_CDF5=0
|
||||
fi
|
||||
else
|
||||
echo "Cannot locate config.h"
|
||||
@ -42,9 +42,9 @@ ECODE=1
|
||||
fi
|
||||
|
||||
|
||||
# Only do following test if USE_CDF5 is true.
|
||||
# Only do following test if ENABLE_CDF5 is true.
|
||||
|
||||
if test "x$USE_CDF5" = x1 ; then
|
||||
if test "x$ENABLE_CDF5" = x1 ; then
|
||||
echo "Test extended format output for a 64-bit CDF-5 classic file"
|
||||
rm -f tmp_tst_formatx3
|
||||
${NCGEN} -k5 -b -o ./tst_formatx3.nc $srcdir/ref_tst_small.cdl
|
||||
|
@ -5,7 +5,7 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi
|
||||
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
HAVE_CDF5=1
|
||||
else
|
||||
HAVE_CDF5=0
|
||||
|
@ -13,7 +13,7 @@ echo ""
|
||||
|
||||
# get some config.h parameters
|
||||
if test -f ${top_builddir}/config.h ; then
|
||||
if fgrep -e '#define USE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
if fgrep -e '#define ENABLE_CDF5 1' ${top_builddir}/config.h >/dev/null ; then
|
||||
HAVE_CDF5=1
|
||||
else
|
||||
HAVE_CDF5=0
|
||||
|
@ -512,7 +512,7 @@ main(
|
||||
|
||||
/* Compute the k_flag (1st pass) using rules in the man page (ncgen.1).*/
|
||||
|
||||
#ifndef USE_CDF5
|
||||
#ifndef ENABLE_CDF5
|
||||
if(k_flag == NC_FORMAT_CDF5) {
|
||||
derror("Output format CDF5 requested, but netcdf was built without cdf5 support.");
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user