diff --git a/config.h.cmake.in b/config.h.cmake.in index 611ceb7a0..2710361df 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -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 diff --git a/configure.ac b/configure.ac index 5864395c4..2bf1b5ac3 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/libdispatch/dfile.c b/libdispatch/dfile.c index 99c926e5c..98d1681bc 100644 --- a/libdispatch/dfile.c +++ b/libdispatch/dfile.c @@ -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) { diff --git a/libsrc/nc3internal.c b/libsrc/nc3internal.c index fb99798d9..102e2a3ca 100644 --- a/libsrc/nc3internal.c +++ b/libsrc/nc3internal.c @@ -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 diff --git a/nc_test/Makefile.am b/nc_test/Makefile.am index e92a04dc0..841995c30 100644 --- a/nc_test/Makefile.am +++ b/nc_test/Makefile.am @@ -27,7 +27,7 @@ endif if TEST_PARALLEL4 if USE_PNETCDF -if USE_CDF5 +if ENABLE_CDF5 TESTPROGRAMS += tst_cdf5format endif endif diff --git a/nc_test/nc_test.c b/nc_test/nc_test.c index 5800c339e..9e5490e82 100644 --- a/nc_test/nc_test.c +++ b/nc_test/nc_test.c @@ -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"); diff --git a/nc_test/t_nc.c b/nc_test/t_nc.c index ec3be5e0e..afddd61d5 100644 --- a/nc_test/t_nc.c +++ b/nc_test/t_nc.c @@ -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); diff --git a/nc_test/test_write.m4 b/nc_test/test_write.m4 index edc303aed..4650e3706 100644 --- a/nc_test/test_write.m4 +++ b/nc_test/test_write.m4 @@ -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 ) diff --git a/nc_test/tst_def_var_fill.c b/nc_test/tst_def_var_fill.c index 96e7f9145..affd3156e 100644 --- a/nc_test/tst_def_var_fill.c +++ b/nc_test/tst_def_var_fill.c @@ -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 diff --git a/nc_test/tst_global_fillval.c b/nc_test/tst_global_fillval.c index 5058eb7e4..4812d3f72 100644 --- a/nc_test/tst_global_fillval.c +++ b/nc_test/tst_global_fillval.c @@ -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 diff --git a/nc_test/tst_names.c b/nc_test/tst_names.c index 8127f1b56..5f63c43e4 100644 --- a/nc_test/tst_names.c +++ b/nc_test/tst_names.c @@ -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 diff --git a/nc_test/tst_small.c b/nc_test/tst_small.c index 114218f44..60ef9a5c0 100644 --- a/nc_test/tst_small.c +++ b/nc_test/tst_small.c @@ -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"); diff --git a/ncdump/nccopy.c b/ncdump/nccopy.c index f5f033a3a..5a8901ec8 100644 --- a/ncdump/nccopy.c +++ b/ncdump/nccopy.c @@ -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 diff --git a/ncdump/run_ncgen_tests.sh b/ncdump/run_ncgen_tests.sh index eb516e12d..752072ae3 100755 --- a/ncdump/run_ncgen_tests.sh +++ b/ncdump/run_ncgen_tests.sh @@ -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 diff --git a/ncdump/tst_64bit.sh b/ncdump/tst_64bit.sh index 838dabfcd..861b01998 100755 --- a/ncdump/tst_64bit.sh +++ b/ncdump/tst_64bit.sh @@ -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 diff --git a/ncdump/tst_dimsizes.c b/ncdump/tst_dimsizes.c index edb0eb80d..376a199d8 100644 --- a/ncdump/tst_dimsizes.c +++ b/ncdump/tst_dimsizes.c @@ -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; diff --git a/ncdump/tst_formatx3.sh b/ncdump/tst_formatx3.sh index 548b56bf9..ea395e400 100755 --- a/ncdump/tst_formatx3.sh +++ b/ncdump/tst_formatx3.sh @@ -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 diff --git a/ncdump/tst_lengths.sh b/ncdump/tst_lengths.sh index dbe5c6810..a21f6a404 100755 --- a/ncdump/tst_lengths.sh +++ b/ncdump/tst_lengths.sh @@ -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 diff --git a/ncdump/tst_nccopy3.sh b/ncdump/tst_nccopy3.sh index 1b023e549..449e89686 100755 --- a/ncdump/tst_nccopy3.sh +++ b/ncdump/tst_nccopy3.sh @@ -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 diff --git a/ncgen/main.c b/ncgen/main.c index 45c1336bd..8af6909cd 100644 --- a/ncgen/main.c +++ b/ncgen/main.c @@ -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;