Skip to content

Commit

Permalink
Merge branch 'master' into addfilter.dmh
Browse files Browse the repository at this point in the history
  • Loading branch information
WardF committed Apr 30, 2019
2 parents 8d0bced + da56955 commit 5410967
Show file tree
Hide file tree
Showing 80 changed files with 1,005 additions and 862 deletions.
36 changes: 21 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ set(PACKAGE "netCDF" CACHE STRING "")
#####

SET(NC_VERSION_MAJOR 4)
SET(NC_VERSION_MINOR 6)
SET(NC_VERSION_PATCH 4)
SET(NC_VERSION_MINOR 7)
SET(NC_VERSION_PATCH 1)
SET(NC_VERSION_NOTE "-development")
SET(netCDF_VERSION ${NC_VERSION_MAJOR}.${NC_VERSION_MINOR}.${NC_VERSION_PATCH}${NC_VERSION_NOTE})
SET(VERSION ${netCDF_VERSION})
Expand Down Expand Up @@ -315,7 +315,7 @@ SET(CHUNK_CACHE_PREEMPTION 0.75 CACHE STRING "Default file chunk cache preemptio
SET(MAX_DEFAULT_CACHE_SIZE 67108864 CACHE STRING "Default maximum cache size.")
SET(NETCDF_LIB_NAME "" CACHE STRING "Default name of the netcdf library.")
SET(TEMP_LARGE "." CACHE STRING "Where to put large temp files if large file tests are run.")
SET(NCPROPERTIES_EXTRA "" CACHE STRNG "Specify extra pairs for _NCProperties.")
SET(NCPROPERTIES_EXTRA "" CACHE STRING "Specify extra pairs for _NCProperties.")
SET(MPIEXEC "mpiexec" CACHE STRING "Command to run MPI programs if parallel tests are run.")

IF(NOT NETCDF_LIB_NAME STREQUAL "")
Expand Down Expand Up @@ -1008,14 +1008,14 @@ IF(ENABLE_PARALLEL4 AND ENABLE_NETCDF_4)
SET(STATUS_PARALLEL "ON")
configure_file("${netCDF_SOURCE_DIR}/nc_test4/run_par_test.sh.in"
"${netCDF_BINARY_DIR}/tmp/run_par_test.sh" @ONLY NEWLINE_STYLE LF)
configure_file("${netCDF_SOURCE_DIR}/nc_test4/run_par_test2.sh.in"
"${netCDF_BINARY_DIR}/tmp/run_par_test2.sh" @ONLY NEWLINE_STYLE LF)
#configure_file("${netCDF_SOURCE_DIR}/nc_test4/run_par_test2.sh.in"
# "${netCDF_BINARY_DIR}/tmp/run_par_test2.sh" @ONLY NEWLINE_STYLE LF)
FILE(COPY "${netCDF_BINARY_DIR}/tmp/run_par_test.sh"
DESTINATION ${netCDF_BINARY_DIR}/nc_test4
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
FILE(COPY "${netCDF_BINARY_DIR}/tmp/run_par_test2.sh"
DESTINATION ${netCDF_BINARY_DIR}/nc_test4
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
#FILE(COPY "${netCDF_BINARY_DIR}/tmp/run_par_test2.sh"
# DESTINATION ${netCDF_BINARY_DIR}/nc_test4
# FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

ENDIF()
ENDIF()
Expand Down Expand Up @@ -1418,6 +1418,7 @@ CHECK_FUNCTION_EXISTS(getrlimit HAVE_GETRLIMIT)
CHECK_FUNCTION_EXISTS(_filelengthi64 HAVE_FILE_LENGTH_I64)
CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
CHECK_FUNCTION_EXISTS(mremap HAVE_MREMAP)
CHECK_FUNCTION_EXISTS(fileno HAVE_FILENO)

# Check to see if MAP_ANONYMOUS is defined.
CHECK_C_SOURCE_COMPILES("
Expand Down Expand Up @@ -1783,6 +1784,9 @@ IF(ENABLE_TESTS)
IF(USE_NETCDF4)
INCLUDE_DIRECTORIES(h5_test)
ADD_SUBDIRECTORY(nc_test4)
IF(BUILD_BENCHMARKS)
ADD_SUBDIRECTORY(nc_perf)
ENDIF()
ADD_SUBDIRECTORY(h5_test)
ENDIF()
IF(ENABLE_DAP2)
Expand Down Expand Up @@ -1856,6 +1860,8 @@ SET(CC ${CMAKE_C_COMPILER})
# Process all dependency libraries and create a string
# used when parsing netcdf.pc.in

SET(NC_LIBS "")

FOREACH(_LIB ${ALL_TLL_LIBS})
GET_FILENAME_COMPONENT(_LIB_NAME ${_LIB} NAME_WE)
STRING(REGEX REPLACE "^lib" "" _NAME ${_LIB_NAME})
Expand All @@ -1865,13 +1871,13 @@ FOREACH(_LIB ${ALL_TLL_LIBS})
ENDFOREACH()

#SET(NC_LIBS "-lnetcdf ${NC_LIBS}")

STRING(REPLACE ";" " " NC_LIBS "${NC_LIBS}")
STRING(REPLACE "-lhdf5::hdf5-shared" "-lhdf5" NC_LIBS ${NC_LIBS})
STRING(REPLACE "-lhdf5::hdf5_hl-shared" "-lhdf5_hl" NC_LIBS ${NC_LIBS})
STRING(REPLACE "-lhdf5::hdf5-static" "-lhdf5" NC_LIBS ${NC_LIBS})
STRING(REPLACE "-lhdf5::hdf5_hl-static" "-lhdf5_hl" NC_LIBS ${NC_LIBS})

IF(NC_LIBS)
STRING(REPLACE ";" " " NC_LIBS "${NC_LIBS}")
STRING(REPLACE "-lhdf5::hdf5-shared" "-lhdf5" NC_LIBS ${NC_LIBS})
STRING(REPLACE "-lhdf5::hdf5_hl-shared" "-lhdf5_hl" NC_LIBS ${NC_LIBS})
STRING(REPLACE "-lhdf5::hdf5-static" "-lhdf5" NC_LIBS ${NC_LIBS})
STRING(REPLACE "-lhdf5::hdf5_hl-static" "-lhdf5_hl" NC_LIBS ${NC_LIBS})
ENDIF()

STRING(REPLACE ";" " " LINKFLAGS "${LINKFLAGS}")

Expand Down
9 changes: 7 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ if ENABLE_FILTER_TESTING
PLUGIN_DIR = plugins
endif

# If benchmarks were turned on, build and run a bunch more tests.
if BUILD_BENCHMARKS
BENCHMARKS_DIR = nc_perf
endif # BUILD_BENCHMARKS

# Define Test directories
if BUILD_TESTSETS
TESTDIRS = $(V2_TEST) nc_test $(NC_TEST4) $(HDF4_TEST_DIR) \
$(NCDAP2TESTDIR) $(NCDAP4TESTDIR)
TESTDIRS = $(V2_TEST) nc_test $(NC_TEST4) $(BENCHMARKS_DIR) \
$(HDF4_TEST_DIR) $(NCDAP2TESTDIR) $(NCDAP4TESTDIR)
endif

# This is the list of subdirs for which Makefiles will be constructed
Expand Down
5 changes: 4 additions & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ Release Notes {#RELEASE_NOTES}

This file contains a high-level description of this package's evolution. Releases are in reverse chronological order (most recent first). Note that, as of netcdf 4.2, the `netcdf-c++` and `netcdf-fortran` libraries have been separated into their own libraries.

## 4.7.1 - TBD

## 4.6.4 - TBD
## 4.7.0 - April 29, 2019

* [Enhancement] Updated behavior of `pkgconfig` and `nc-config` to allow the use of the `--static` flags, e.g. `nc-config --libs --static`, which will show information for linking against `libnetcdf` statically. See [Github #1360](https://github.com/Unidata/netcdf-c/issues/1360) and [Github #1257](https://github.com/Unidata/netcdf-c/issues/1257) for more information.

* [Enhancement] Provide byte-range reading of remote datasets. This allows
read-only access to, for example, Amazon S3 objects and also Thredds Server
Expand Down
2 changes: 2 additions & 0 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ are set when opening a binary file on Windows. */
/* Define if we have filelengthi64. */
#cmakedefine HAVE_FILE_LENGTH_I64 @HAVE_FILE_LENGTH_I64@

/* Define to 1 if you have the `fileno' function. */
#cmakedefine HAVE_FILENO 1

/* Define to 1 if you have the `fsync' function. */
#cmakedefine HAVE_FSYNC 1
Expand Down
88 changes: 28 additions & 60 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@
# the COPYRIGHT file for more information.
# Ed Hartnett, Ward Fisher, Dennis Heimbigner

# Recall that ${VAR-exp} expands to $VAR if var is set (even to null),
# and to exp otherwise.

# Running autoconf on this file will trigger a warning if
# autoconf is not at least the specified version.
AC_PREREQ([2.59])

# Initialize with name, version, and support email address.
AC_INIT([netCDF], [4.6.4-development], [support-netcdf@unidata.ucar.edu], [netcdf-c])
AC_INIT([netCDF], [4.7.1-development], [support-netcdf@unidata.ucar.edu], [netcdf-c])

##
# Prefer an empty CFLAGS variable instead of the default -g -O2.
Expand All @@ -23,8 +20,8 @@ AC_INIT([netCDF], [4.6.4-development], [support-netcdf@unidata.ucar.edu], [netcd
: ${CFLAGS=""}

AC_SUBST([NC_VERSION_MAJOR]) NC_VERSION_MAJOR=4
AC_SUBST([NC_VERSION_MINOR]) NC_VERSION_MINOR=6
AC_SUBST([NC_VERSION_PATCH]) NC_VERSION_PATCH=4
AC_SUBST([NC_VERSION_MINOR]) NC_VERSION_MINOR=7
AC_SUBST([NC_VERSION_PATCH]) NC_VERSION_PATCH=1
AC_SUBST([NC_VERSION_NOTE]) NC_VERSION_NOTE="-development"

#####
Expand Down Expand Up @@ -249,15 +246,6 @@ AC_ARG_ENABLE([remote-fortran-bootstrap], [AS_HELP_STRING([--enable-remote-fortr
test "x$enable_remote_fortran_bootstrap" = xyes || enable_remote_fortran_bootstrap=no
AC_MSG_RESULT([$enable_remote_fortran_bootstrap])

# Does the user want to run extra example tests
AC_MSG_CHECKING([whether extra example tests should be run])
AC_ARG_ENABLE([extra-example-tests],
[AS_HELP_STRING([--enable-extra-example-tests],
[Run extra example tests; requires GNU sed. Ignored if \
netCDF-4 is not enabled.])])
test "x$enable_extra_example_tests" = xyes || enable_extra_example_tests=no
AC_MSG_RESULT($enable_extra_example_tests)

# Does the user want to run extra parallel tests when parallel netCDF-4 is built?
AC_MSG_CHECKING([whether parallel IO tests should be run])
AC_ARG_ENABLE([parallel-tests],
Expand Down Expand Up @@ -368,7 +356,7 @@ fi

# --enable-dap => enable-dap4
enable_dap4=$enable_dap
# Default is now to always do the short remote tests
# Default is to do the short remote tests.
AC_MSG_CHECKING([whether dap remote testing should be enabled (default on)])
AC_ARG_ENABLE([dap-remote-tests],
[AS_HELP_STRING([--disable-dap-remote-tests],
Expand All @@ -379,7 +367,7 @@ if test "x$enable_dap" = "xno" ; then
fi
AC_MSG_RESULT($enable_dap_remote_tests)

# Default is now to do the remote authorization tests
# Default is not to do the remote authorization tests.
AC_MSG_CHECKING([whether dap remote authorization testing should be enabled (default off)])
AC_ARG_ENABLE([dap-auth-tests],
[AS_HELP_STRING([--enable-dap-auth-tests],
Expand Down Expand Up @@ -543,6 +531,9 @@ AC_ARG_ENABLE([benchmarks],
are timed. We use these tests to check netCDF performance.])])
test "x$enable_benchmarks" = xyes || enable_benchmarks=no
AC_MSG_RESULT($enable_benchmarks)
if test "x$enable_netcdf4" = xno -a "x$enable_benchmarks" = xyes; then
AC_MSG_ERROR([Can't use benchmarks if netCDF-4 is disabled.])
fi
AM_CONDITIONAL(BUILD_BENCHMARKS, [test x$enable_benchmarks = xyes])

# Does the user want to use extreme numbers in testing.
Expand Down Expand Up @@ -639,15 +630,6 @@ AC_ARG_WITH([udf1-magic-number],
[UDF1_MAGIC_NUMBER=$with_udf1_magic_number])
AC_MSG_RESULT([$UDF1_MAGIC_NUMBER])

# Did the user specify a default cache preemption?
AC_MSG_CHECKING([whether a default cache preemption for HDF5 was specified])
AC_ARG_WITH([chunk-cache-preemption],
[AS_HELP_STRING([--with-chunk-cache-preemption=<float between 0 and 1 inclusive>],
[Specify default file chunk cache preemption policy for HDF5 files (a number between 0 and 1, inclusive).])],
[CHUNK_CACHE_PREEMPTION=$with_chunk_cache_preemption], [CHUNK_CACHE_PREEMPTION=0.75])
AC_MSG_RESULT([$CHUNK_CACHE_PREEMPTION])
AC_DEFINE_UNQUOTED([CHUNK_CACHE_PREEMPTION], [$CHUNK_CACHE_PREEMPTION], [default file chunk cache preemption policy.])

# According to the autoconf mailing list gurus, we must test for
# compilers unconditionally. That is, we can't skip looking for the
# fortran compilers, just because the user doesn't want fortran. This
Expand Down Expand Up @@ -1015,7 +997,6 @@ if test "x$enable_netcdf_4" = xyes || test "x$enable_dap" = xyes; then
AC_SEARCH_LIBS([deflate], [zlibwapi zlibstat zlib zlib1 z], [], [
AC_MSG_ERROR([Can't find or link to the z library. Turn off netCDF-4 and \
DAP clients with --disable-netcdf-4 --disable-dap, or see config.log for errors.])])
AC_SEARCH_LIBS([SZ_Compress], [szip sz], [], [])
AC_SEARCH_LIBS([dlopen], [dl dld], [], [])
fi

Expand All @@ -1041,11 +1022,10 @@ if test "x$enable_hdf5" = xyes; then
[AC_MSG_ERROR([Can't find or link to the hdf5 high-level. Use --disable-netcdf-4, or see config.log for errors.])])

AC_CHECK_HEADERS([hdf5.h], [], [AC_MSG_ERROR([Compiling a test with HDF5 failed. Either hdf5.h cannot be found, or config.log should be checked for other reason.])])
AC_CHECK_FUNCS([H5Z_SZIP])

# H5Pset_fapl_mpiposix and H5Pget_fapl_mpiposix have been removed since HDF5 1.8.12.
# Use H5Pset_fapl_mpio and H5Pget_fapl_mpio, instead.
AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5resize_memory H5allocate_memory H5Pset_libver_bounds H5Pset_all_coll_metadata_ops])
AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5resize_memory H5allocate_memory H5Pset_libver_bounds H5Pset_all_coll_metadata_ops H5Z_SZIP])

# Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0)
if test "x$ac_cv_func_H5Pset_all_coll_metadata_ops" = xyes; then
Expand All @@ -1060,6 +1040,13 @@ if test "x$enable_hdf5" = xyes; then
AC_MSG_CHECKING([whether parallel io is enabled in hdf5])
AC_MSG_RESULT([$hdf5_parallel])

# Check to see if we need to search for and link against szlib.
if test "x$ac_cv_func_H5Z_SZIP" = xyes; then
AC_SEARCH_LIBS([SZ_Compress], [szip sz], [],
[AC_MSG_ERROR([libhdf5 installed with szip support, but cannot find or link to the szip library.])])
fi


if test "x$hdf5_parallel" = "xno"; then
if test "x$enable_parallel_tests" = "xyes"; then
AC_MSG_ERROR([Parallel tests requested, but no parallel HDF5 installation detected.])
Expand Down Expand Up @@ -1293,7 +1280,6 @@ AM_CONDITIONAL(ENABLE_CDF5, [test "x$enable_cdf5" = xyes])
AM_CONDITIONAL(ENABLE_DAP_REMOTE_TESTS, [test "x$enable_dap_remote_tests" = xyes])
AM_CONDITIONAL(ENABLE_DAP_AUTH_TESTS, [test "x$enable_dap_auth_tests" = xyes])
AM_CONDITIONAL(ENABLE_DAP_LONG_TESTS, [test "x$enable_dap_long_tests" = xyes])
AM_CONDITIONAL(EXTRA_EXAMPLE_TESTS, [test "x$enable_extra_example_tests" = xyes])
AM_CONDITIONAL(USE_SZIP, [test "x$ac_cv_func_H5Z_SZIP" = xyes])
AM_CONDITIONAL(USE_PNETCDF_DIR, [test ! "x$PNETCDFDIR" = x])
AM_CONDITIONAL(USE_LOGGING, [test "x$enable_logging" = xyes])
Expand Down Expand Up @@ -1398,14 +1384,6 @@ if test "x$enable_jna" = xyes ; then
AC_DEFINE([JNA], [1], [if true, include JNA bug fix])
fi

# Control large metadata performance test
AC_MSG_CHECKING([whether large metadata performance testing should be run])
AC_ARG_ENABLE([metadata-perf],
[AS_HELP_STRING([--enable-metadata-perf],
[Test performance of nc_create and nc_open on large metadata])])
test "x$enable_metadata_perf" = xyes || enable_metadata_perf=no
AC_MSG_RESULT($enable_metadata_perf)

# Control filter test/example
AC_MSG_CHECKING([whether filter testing should be run])
AC_ARG_ENABLE([filter-testing],
Expand Down Expand Up @@ -1514,36 +1492,25 @@ AX_SET_META([NC_HAS_CDF5],[$enable_cdf5],[yes])
AX_SET_META([NC_HAS_ERANGE_FILL], [$enable_erange_fill],[yes])
AX_SET_META([NC_RELAX_COORD_BOUND], [$enable_zero_length_coord_bound],[yes])
AX_SET_META([NC_HAS_BYTERANGE],[$enable_byterange],[yes])
#####
# End netcdf_meta.h definitions.
#####

# Automake says that this is always run in top_builddir
# and that srcdir is defined (== top_srcdir)
abs_top_builddir=`pwd`
cd $srcdir
abs_top_srcdir=`pwd`
cd $abs_top_builddir

# test_common.sh setup
AC_CONFIG_FILES(test_common.sh:test_common.in)
#rm -f ${abs_top_builddir}/test_common.sh
#sed -e "s|@TOPSRCDIR@|${abs_top_srcdir}|" -e "s|@TOPBUILDDIR@|${abs_top_builddir}|" <${abs_top_srcdir}/test_common.in >${abs_top_builddir}/test_common.sh

# nc_test4/findplugin.sh setup
# This would be true for a cmake build.
AC_SUBST([ISCMAKE], [])

# This would be true for a visual studio build.
AC_SUBST([MSVC], [])

AC_MSG_NOTICE([generating header files and makefiles])
AC_CONFIG_FILES(test_common.sh:test_common.in)
AC_CONFIG_FILES(nc_test4/findplugin.sh:nc_test4/findplugin.in)
AC_CONFIG_FILES(examples/C/findplugin.sh:nc_test4/findplugin.in)

# DAP 2/4 findtestserver[4].c setup
AC_CONFIG_FILES(ncdap_test/findtestserver.c:ncdap_test/findtestserver.c.in)
AC_CONFIG_FILES(dap4_test/findtestserver4.c:ncdap_test/findtestserver.c.in)

#####
# End netcdf_meta.h definitions.
#####

AC_MSG_NOTICE([generating header files and makefiles])
AC_CONFIG_FILES([nc_test4/run_par_test.sh], [chmod ugo+x nc_test4/run_par_test.sh])
AC_CONFIG_FILES([nc_test4/run_par_bm_test.sh], [chmod ugo+x nc_test4/run_par_bm_test.sh])
AC_CONFIG_FILES([nc_perf/run_par_bm_test.sh], [chmod ugo+x nc_perf/run_par_bm_test.sh])
AC_CONFIG_FILES([examples/C/run_par_test.sh], [chmod ugo+x examples/C/run_par_test.sh])
AC_CONFIG_FILES([nc-config], [chmod 755 nc-config])
AC_CONFIG_FILES([Makefile
netcdf.pc
Expand Down Expand Up @@ -1575,6 +1542,7 @@ AC_CONFIG_FILES([Makefile
docs/images/Makefile
nctest/Makefile
nc_test4/Makefile
nc_perf/Makefile
nc_test/Makefile
ncdap_test/Makefile
ncdap_test/testdata3/Makefile
Expand Down
2 changes: 1 addition & 1 deletion docs/Doxyfile.developer
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = netCDF-C
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 4.6.4-development
PROJECT_NUMBER = 4.7.1-development

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
14 changes: 7 additions & 7 deletions examples/C/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

LDADD = -lm
AM_CPPFLAGS = -I$(top_srcdir)/include
AM_LDFLAGS =
AM_CPPFLAGS += -I$(top_builddir)/liblib
AM_LDFLAGS = ${top_builddir}/liblib/libnetcdf.la

# These are the netCDF-3 examples.
check_PROGRAMS = simple_xy_wr simple_xy_rd sfc_pres_temp_wr \
Expand All @@ -21,7 +22,7 @@ TESTS = run_examples.sh

# To build netcdf-4, or not to build netcdf-4, that is the question...
if USE_HDF5
# These are the extra netCDF-4 examples.
# These are the netCDF-4 examples.
check_PROGRAMS += simple_nc4_wr simple_nc4_rd simple_xy_nc4_wr \
simple_xy_nc4_rd

Expand All @@ -33,14 +34,13 @@ endif

endif #USE_HDF5

if TEST_PARALLEL4
if USE_PNETCDF
# These are the extra netCDF-4 examples.
# This is a pnetcdf example.
check_PROGRAMS += parallel_vara
TESTS += parallel_vara
TESTS += run_par_test.sh
endif #USE_PNETCDF

AM_CPPFLAGS += -I$(top_builddir)/liblib
AM_LDFLAGS += ${top_builddir}/liblib/libnetcdf.la
endif # TEST_PARALLEL4

if USE_HDF5
TESTS += run_examples4.sh
Expand Down

0 comments on commit 5410967

Please sign in to comment.