Commit Graph

944 Commits

Author SHA1 Message Date
Greg Sjaardema
c2fac03d1a
Use consistent form for find_package
Remove the double quotes I had used in the find_package...
2021-10-11 14:56:52 -06:00
Greg Sjaardema
6650bddfcf
Better detection of libz library
Instead of just specifying "z" as a dependent library, use `find_package`
2021-10-11 14:54:21 -06:00
Greg Sjaardema
e48ebe7b80
Remove another duplicate find_path
There was another almost duplicate `find_path` call in the code that is now removed.  It wasn't a part of this PR, but removing just for completeness
2021-10-11 11:08:19 -06:00
Greg Sjaardema
5c2a8f282f
Remove duplicate line
Not sure where the almost duplicate `find_path` line came from.  Removed it.
2021-10-11 11:01:19 -06:00
Dennis Heimbigner
289103d2b1 Merge branch 'master' into zarrs3.dmh 2021-10-07 15:10:03 -06:00
Greg Sjaardema
c457b050d4
fix last commit. 2021-10-05 13:04:35 -06:00
Greg Sjaardema
a007971bd4
Put threads find_package back where it was.
Moving the threads find_package affects the windows build.
2021-10-05 13:03:19 -06:00
Greg Sjaardema
7b2ad585a6
Refactor Z library detection
HDF5 can depend on the Z library (in fact required for netCDF).  Moved the detection of whether hdf5 was built with zlib up before any other tests that may require linking of the hdf5 library to determine presence/absence of symbols.  These tests require that the link line include "-lz" if the hdf5 library was built with libz support.  

This is typically handled somewhat automatically if shared libraries are being used, but in the static library case, the explicit dependency needs to be specified.  For internal CMake checks, it uses the `CMAKE_REQUIRED_LIBRARIES` list to specify the libraries that should be used in a `CHECK_C_SOURCE_COMPILE` or a `CHECK_LIBRARY_EXISTS` call.   In the current CMakeLists.txt ordering, the zlib detection is done _after_ the `CHECK_LIBRARY_EXISTS` calls which can cause them to fail and give an incorrect result about whether the function being tested for exists.   With the reordering in this PR, I am able to correctly configure netCDF on a CRAY HPC system that uses static libraries by default.
2021-10-04 10:52:23 -06:00
Ward Fisher
437060b69a
Merge pull request #2088 from edwardhartnett/ejh_quantize_2
Adding nc_def_var_quantize()/nc_inq_var_quantize() - second attempt
2021-10-01 17:06:05 -05:00
Greg Sjaardema
6b8a940ab2
Make sure HDF5_C_LIBRARY and HDF5_HL_LIBRARY set
On some versions of the HDF5 find_package call, it sets `HDF5_C_LIBRARIES` and `HDF5_HL_LIBRARIES`, but does not set the `HDF5_C_LIBRARY` or `HDF5_HL_LIBRARY` to anything.  Control then falls out of the if block with these unset and it falls into the default setting at line 792.  This does not include the path, so then when the later `CHECK_LIBRARY_EXISTS` calls are run, they do not have the full path to the library and will not link correctly.  Since the link fails, the code defaults to thinking that none of the symbols are defined.

I don't think this change will have any affect since it only sets the symbols if they are unset.
2021-10-01 13:34:58 -06:00
Dennis Heimbigner
6b69b9c52c Significantly Improve Amazon S3 Cloud Storage Support
## S3 Related Fixes

* Add comprehensive support for specifying AWS profiles to provide access credentials.
* Parse the files "~/.aws/config" and "~/.aws/credentials to provide credentials for the HDF5 ROS3 driver and to locate default region.
* Add a function to obtain the currently active S3 credentials. The search rules are defined in docs/nczarr.md.
* Provide documentation for the new features.
* Modify the struct NCauth (in include/ncauth.h) to replace specific S3 credentials with a profile name.
* Add a unit test to test the operation of profile and credentials management.
* Add support for URLS of the form "s3://<bucket>/<key>"; this requires obtaining a default region.
* Allows the specification of profile and/or region in a URL of the form "#mode=nczarr,...&aws.region=...&aws.profile=..."

## Misc. Fixes

* Move the ezxml code to libdispatch so that it can be used both by DAP4 and nczarr.
* Modify nclist to provide a deep clone operation.
* Modify ncuri to provide a deep clone operation.
* Modify the .rc file format to allow the specification of a path to be tested when looking for an entry in the .rc file.
* Ensure that the NC_rcload function is called.
* Modify nchttp to support setting request headers.
2021-09-27 18:36:33 -06:00
Edward Hartnett
0ce463761c
Merge branch 'main' into ejh_quantize_2 2021-09-07 10:44:45 -06:00
Milton Woods
1c50c4d313 Use relative pathnames in __FILE__ macros on mingw 2021-09-04 10:28:24 +10:00
Milton Woods
918fef9334 hostname lacks arguments on mingw 2021-09-04 10:28:24 +10:00
Milton Woods
2aabae95cc Avoid setting RPATH in mingw 2021-09-04 10:28:24 +10:00
Milton Woods
d03c0056ae valgrind not supported by mingw 2021-09-04 10:28:24 +10:00
Milton Woods
8525818d90 Support ANSI *printf specifiers on mingw-w64 2021-09-04 10:28:24 +10:00
Dennis Heimbigner
11fe00ea05 Add filter support to NCZarr
Filter support has three goals:

1. Use the existing HDF5 filter implementations,
2. Allow filter metadata to be stored in the NumCodecs metadata format used by Zarr,
3. Allow filters to be used even when HDF5 is disabled

Detailed usage directions are define in docs/filters.md.

For now, the existing filter API is left in place. So filters
are defined using ''nc_def_var_filter'' using the HDF5 style
where the id and parameters are unsigned integers.

This is a big change since filters affect many parts of the code.

In the following, the terms "compressor" and "filter" and "codec" are generally
used synonomously.

### Filter-Related Changes:
* In order to support dynamic loading of shared filter libraries, a new library was added in the libncpoco directory; it helps to isolate dynamic loading across multiple platforms.
* Provide a json parsing library for use by plugins; this is created by merging libdispatch/ncjson.c with include/ncjson.h.
* Add a new _Codecs attribute to allow clients to see what codecs are being used; let ncdump -s print it out.
* Provide special headers to help support compilation of HDF5 filters when HDF5 is not enabled: netcdf_filter_hdf5_build.h and netcdf_filter_build.h.
* Add a number of new test to test the new nczarr filters.
* Let ncgen parse _Codecs attribute, although it is ignored.

### Plugin directory changes:
* Add support for the Blosc compressor; this is essential because it is the most common compressor used in Zarr datasets. This also necessitated adding a CMake FindBlosc.cmake file
* Add NCZarr support for the big-four filters provided by HDF5: shuffle, fletcher32, deflate (zlib), and szip
* Add a Codec defaulter (see docs/filters.md) for the big four filters.
* Make plugins work with windows by properly adding __declspec declaration.

### Misc. Non-Filter Changes
* Replace most uses of USE_NETCDF4 (deprecated) with USE_HDF5.
* Improve support for caching
* More fixes for path conversion code
* Fix misc. memory leaks
* Add new utility -- ncdump/ncpathcvt -- that does more or less the same thing as cygpath.
* Add a number of new test to test the non-filter fixes.
* Update the parsers
* Convert most instances of '#ifdef _MSC_VER' to '#ifdef _WIN32'
2021-09-02 17:04:26 -06:00
Edward Hartnett
684f73c574 merged master 2021-09-01 02:03:19 -06:00
Ward Fisher
d0561d6a58 Caching HDF5_VERSION string for diagnostic purposes. 2021-08-30 16:29:40 -06:00
Ward Fisher
a777d97cb4 Added logic for checking the version when the HDF5 libraries and include directories are set explicitly. 2021-08-30 15:37:21 -06:00
Ward Fisher
a76245df73 Plugged a hole where HDF5_VERSION wouldn't be checked against minimum HDF5 required version. 2021-08-30 14:21:37 -06:00
Ward Fisher
ebbe3b438e Revamping the HDF5_VERSION logic. 2021-08-30 09:10:14 -06:00
Edward Hartnett
2db4311b87
Merge branch 'master' into ejh_quantize_2 2021-08-26 23:05:59 -06:00
Edward Hartnett
f3435da592 merged configure.ac and CMakeLists.txt with changes from master branch 2021-08-24 02:03:30 -06:00
Edward Hartnett
74c4b9db83 fixed version numbers 2021-08-24 01:57:27 -06:00
Edward Hartnett
9a18689ffa getting ready for next try at quantization code 2021-08-24 00:45:38 -06:00
Edward Hartnett
0218fc6e54 added info about logging to build summary, fixed info about byterange in build summary 2021-08-24 00:17:03 -06:00
Ward Fisher
e9175090ec
Merge pull request #2075 from Unidata/v4.8.1-wellspring.wif
v4.8.1 Wellspring changes to merge back upstream
2021-08-20 10:37:24 -06:00
Ward Fisher
417de618e8 Corrected a syntax issue with shell scripts invoked by cmake that could result in a false positive. 2021-08-18 11:48:39 -06:00
Ward Fisher
c8f03b8910 Bump version numbers for the next development cycle. 2021-08-17 10:41:07 -06:00
Ben Boeckel
78f9f5fbac cmake: extract the HDF5 version when finding HDF5 manually 2021-08-16 13:49:09 -04:00
Ben Boeckel
7727a68db4 hdf5: try and fill in HDF5_C_LIBRARY from HDF5_hdf5_LIBRARY if possible
A fairly vanilla build of 1.12.1 into a non-default directory ends up
with `HDF5_C_LIBRARY` set to `hdf5` which ends up failing all of the
`try_compile` checks because `-lhdf5` cannot be found.
2021-08-11 20:27:45 -04:00
Ward Fisher
a89e259431 Added -fno-strict-aliasing to CFLAGS when the compiler supports it and cmake is in use. 2021-07-27 11:22:48 -06:00
Ward Fisher
e8303135bd
Merge pull request #2015 from gsjaardema/patch-48
Simply version check logic
2021-06-28 14:18:42 -06:00
Ward Fisher
1a7ee7170a
Merge pull request #1972 from catenacyber/ossfuzz
Adds fuzz target for oss-fuzz integration
2021-06-17 14:32:48 -06:00
Greg Sjaardema
31f0c80ade
Remove a debug print 2021-06-02 12:55:36 -06:00
Greg Sjaardema
477c4de95b
Clean up curl symbol tests
* Set `CMAKE_REQUIRED_INCLUDES` to include the path found for `curl.h`.  The `CHECK_C_SOURCE_COMPILES` function uses this and not the `INCLUDE_DIRECTORIES`

* Make the test for version 7.66 or later match the same test in `configure.ac`
* If the version is 7.66 or later, then we can skip the tests for the curl symbols which were all added in versions prior to 7.66.
* If the version is earlier than 7.66, then continue to perform the tests.
2021-06-02 12:54:05 -06:00
Greg Sjaardema
e755a08f11
Simply version check logic
We use the CMake `VERSION_LESS` test other places, might as well use it here and  eliminate another compile-based test.
2021-06-02 11:40:01 -06:00
Ward Fisher
94262989eb
Merge pull request #1991 from gsjaardema/eliminate_need_for_hdf5-1.6-API
Remove need for HDF5-1.6 API being defined
2021-06-01 16:36:28 -06:00
Dennis Heimbigner
e632d02041 Re-enable DAP2 authorization tests
The thredds-test server now has some password protected datasets
that can be used to test DAP2 authorization support.
The general location is
````
https://thredds.ucar.edu/thredds/tdscapabilities/authTest.html
````
and specifically:
````
https://thredds.ucar.edu/thredds/dodsC/test3/testData.nc.html
````

This PR replaces old testcases with ncdap_test/testauth.sh.
This testcase allows us to test use of the .dodsrc file and .netrc file
and embedded user+pwd.

As part of this, I had to create a program (ncdap_test/pathcvt.c)
that is essentially the equivalent to cygpath. Given a path in
windows, unix, msys or cygwin format, it converts it to the
equivalent format in one of those four cases.  So it can be used
to convert a cygwin path to a windows path, for example. This is
needed in testpathcvt and testauth to make sure that the paths
in .daprc (e.g. the reference to .netrc) are of the proper
format.

Misc. Other Changes:
1. Fix some memory leaks in libdap2
2. Setting the env variable CURLOPT_VERBOSE allows tracking of curl
   operations.
3. Make tst_charvlenbug be conditional on NC_VLEN_NOTEST.
2021-05-29 21:30:33 -06:00
Greg Sjaardema
e2d0bbb8ea
Merge branch 'master' into eliminate_need_for_hdf5-1.6-API 2021-05-28 07:11:13 -06:00
Ward Fisher
991069ea93
Merge pull request #1973 from gsjaardema/patch-48
Fix some HDF5-related tests
2021-05-27 12:31:30 -06:00
Greg Sjaardema
cbcee382b0 Remove need for HDF5-1.6 API being defined 2021-04-28 13:59:24 -06:00
Dennis Heimbigner
74b40fd788 Upgrade the nczarr code to match Zarr V2
Re: https://github.com/zarr-developers/zarr-python/pull/716

The Zarr version 2 spec has been extended to include the ability
to choose the dimension separator in chunk name keys. The legal
separators has been extended from {'.'} to {'.' '/'}.  So now it
is possible to use a key like "0/1/2/0" for chunk names.

This PR implements this for NCZarr. The V2 spec now says that
this separator can be set on a per-variable basis. For now, I
have chosen to allow this be set only globally by adding a key
named "ZARR.DIMENSION_SEPARATOR=<char>" in the
.daprc/.dodsrc/ncrc file. Currently, the only legal separator
characters are '.' (the default) and '/'. On writing, this key
will only be written if its value is different than the default.
This change caused problems because supporting a separator of '/'
is difficult to parse when keys/paths use '/' as the path separator.
A test case was added for this.

Additionally, make nczarr be enabled default by default. This required
some additional changes so that if zip and/or AWS S3 sdk are unavailable,
then they are disabled for NCZarr.

In addition the following unrelated changes were made.

1. Tested that pure-zarr mode could read an nczarr formatted store.
1. The .rc file handling now merges all known .rc files (.ncrc,.daprc, and .dodsrc) in that order and using those in HOME first, then in current directory. For duplicate entries, the later ones override the earlier ones. This change is to remove some of the conflicts inherent in the current .rc file load process. A set of test cases was also added.
1. Re-order tests in configure.ac and CMakeLists.txt so that if libcurl
   is not found then the other options that depend upon it properly
   are disabled.
1. I decided that xarray support should be enabled by default for pure
   zarr. In order to allow disabling, I added a new mode flag "noxarray".
1. Certain test in nczarr_test depend on use of .dodsrc. In order for these
   to work when testing in parallel, some inter-test dependencies needed to
   be added.
1. Improved authorization testing to use changes in thredds.ucar.edu
2021-04-24 19:48:15 -06:00
Ward Fisher
ad51b0a79a Updated release notes, made if-block syntax more verbose. 2021-04-01 11:46:44 -06:00
Ward Fisher
35bf5f4b79 Corrected a typo. 2021-04-01 11:43:15 -06:00
Ward Fisher
17b4c2bebb Refactored the HDF5 version detection logic in CMakeLists.txt in support of https://github.com/Unidata/netcdf-c/issues/1962 2021-04-01 11:24:11 -06:00
Greg Sjaardema
6118776d60
Fix use of ininitialized CMake variable
The `ISCMAKE` was defined after its first use in a `configure_file` call.  Moved to before its first use.
2021-04-01 08:13:13 -06:00
Greg Sjaardema
2e6af31e5f
Fix some HDF5-related tests
Some of the tests for HDF5 symbols are failing due to not finding the include file which skews the test results.  Added the `CMAKE_REQUIRED_INCLUDES` command to set the path.  In one place this was already set, but used `HAVE_HDF5_H` which is not an include path and isn't even set at the location where it was used.  We may not need these set more than once, but I added them before each `CHECK_C_SOURCE_COMPILES` in case those blocks get moved around and the value gets unset when it should be set.

Also changed the `H5Literate_vers` check to check  that it is defined instead of checking the value.  As best I can see, as long as it is defined, then the `H5Literate` symbol will be defined which is what is needed.  Checked with 1.10.7 and 1.12.0
2021-03-31 14:08:40 -06:00
Philippe Antoine
5c0dd4d6d4 Adds fuzz target for oss-fuzz integration 2021-03-31 11:27:27 +02:00
Ward Fisher
ac4ade4f18 Merge branch '4.8.0-wellspring-prs.wif' into 4.8.0-wellspring.wif 2021-03-22 16:59:15 -06:00
Ward Fisher
4a7f5aeef2 Added check for H5Literate symbol (hdf5 1.8.x, 1.10.x) or macro (1.12.x)) in support of https://github.com/Unidata/netcdf-c/issues/1965 2021-03-22 13:40:11 -06:00
Ward Fisher
094e2a4ea3 Amend check for H5Literate to work with 1.10.x 2021-03-22 13:24:03 -06:00
Ward Fisher
3e0b36a355 Added check for H5Literate in support of https://github.com/Unidata/netcdf-c/issues/1965 2021-03-22 13:05:23 -06:00
Ward Fisher
fc4bfc6196 Merge branch 'dispatchversion.dmh' of https://github.com/DennisHeimbigner/netcdf-c into 4.8.0-wellspring-prs.wif 2021-03-22 12:41:03 -06:00
Ward Fisher
f75c1c4d7b
Merge branch 'master' into dispatchversion.dmh 2021-03-22 12:40:09 -06:00
Ward Fisher
ffa8a7067f Merge branch '951' of https://github.com/brtnfld/netcdf-c into 4.8.0-wellspring-prs.wif 2021-03-22 11:51:54 -06:00
Ward Fisher
98abfb7749 Bumped version numbers to next development version. 2021-03-19 11:49:09 -06:00
Ward Fisher
7535a9c98f Updated SO version in cmakelists.txt in preparation for the 4.8.0 release. 2021-03-19 11:30:38 -06:00
Dennis Heimbigner
0b7a5382e7 Codify cross-platform file paths
The netcdf-c code has to deal with a variety of platforms:
Windows, OSX, Linux, Cygwin, MSYS, etc.  These platforms differ
significantly in the kind of file paths that they accept.  So in
order to handle this, I have created a set of replacements for
the most common file system operations such as _open_ or _fopen_
or _access_ to manage the file path differences correctly.

A more limited version of this idea was already implemented via
the ncwinpath.h and dwinpath.c code. So this can be viewed as a
replacement for that code. And in path in many cases, the only
change that was required was to replace '#include <ncwinpath.h>'
with '#include <ncpathmgt.h>' and then replace file operation
calls with the NCxxx equivalent from ncpathmgr.h Note that
recently, the ncwinpath.h was renamed ncpathmgmt.h, so this pull
request should not require dealing with winpath.

The heart of the change is include/ncpathmgmt.h, which provides
alternate operations such as NCfopen or NCaccess and which properly
parse and rebuild path arguments to work for the platform on which
the code is executing. This mostly matters for Windows because of the
way that it uses backslash and drive letters, as compared to *nix*.
One important feature is that the user can do string manipulations
on a file path without having to worry too much about the platform
because the path management code will properly handle most mixed cases.
So one can for example concatenate a path suffix that uses forward
slashes to a Windows path and have it work correctly.

The conversion code is in libdispatch/dpathmgr.c, and the
important function there is NCpathcvt which does the proper
conversions to the local path format.

As a rule, most code should just replace their file operations with
the corresponding NCxxx ones defined in include/ncpathmgmt.h. These
NCxxx functions all call NCpathcvt on their path arguments before
executing the actual file operation.

In some rare cases, the client may need to directly use NCpathcvt,
but this should be avoided as much as possible. If there is a need
for supporting a new file operation not already in ncpathmgmt.h, then
use the code in dpathmgr.c as a template. Also please notify Unidata
so we can include it as a formal part or our supported operations.
Also, if you see an operation in the library that is not using the
NCxxx form, then please submit an issue so we can fix it.

Misc. Changes:
* Clean up the utf8 testing code; it is impossible to get some
  tests to work under windows using shell scripts; the args do
  not pass as utf8 but as some other encoding.
* Added an extra utf8 test case: test_unicode_path.sh
* Add a true test for HDF5 1.10.6 or later because as noted in
  PR https://github.com/Unidata/netcdf-c/pull/1794,
  HDF5 changed its Windows file path handling.
2021-03-04 13:41:31 -07:00
Wojciech Śmigaj
e9ef96b733
Fix name of the HDF5_C_LIBRARY_hdf5 CMake variable 2021-03-02 16:27:19 +00:00
Dennis Heimbigner
7a44ae9184 Unify definition of NC_DISPATCH_VERSION
re: Issue

The netcdf dispatch table version was defined in several places.
Modify to only require defining it in CMakeLists.txt and configure.ac.

Fix entailed the following changes:
* Up the NC_DISPATCH_VERSION from 2 to 3 in configure.ac and CMakeLists.txt
* Create include/netcdf_dispatch.h.in and use it to configure include/netcdf_dispatch.h
* For CMAKE, make it search CMAKE_CURRENT_BINARY_DIR so code can locate the configured netcdf_dispatch.h
* Add entry to config.h.cmake.in for NC_DISPATCH_VERSION
* Move NCerror from include/ncdispatch.h to libdap2/nccomon.h
* Fix an API problem re nchttp.h
* Fix a conversion warning in libdispatch/dinfermodel.c
2021-01-31 21:40:08 -07:00
Dennis Heimbigner
e7d5f24078 Add zip file support
The primary change is to support the use of a zip file as a
storage format. Simultaneously the .nz4 support is made obsolete

Use of zip requires the libzip support library, so a number of
changes to the build files (Makefile.am, CMakeLists.txt) are
necessary to locate and incorporate libzip.  The nczarr_tests
tests are also changed to add zip testing.

Other changes:
* Make sure distcheck leaves no files around.
* Add some functions to netcdf_aux to export some functions of libnetcdf.
* Add a new error NC_EFOUND as the complement of NC_EEMPTY.
* Add tracing support to nclog and use it in libnczarr.
* Modify the zmap interface to support the writeonce semantics of zip.
* Create a new s3util.c to support a variety of S3 auxilliary functions.
* EXTERNL'ize a number of functions so they can be used in s3util.
* Add support for the S3 ListObjects CommonPrefixes mechanism
  to improve search.
* Add experimental support for running nczarr X s3 tests against
  the actual Amazon S3 cloud.
2021-01-28 20:11:01 -07:00
Ward Fisher
52011297f3
Merge branch 'master' into fix-hdf5-zlib-check 2021-01-26 11:47:52 -07:00
Dan Ibanez
9ad3e49371 more missing includes for MPI without wrapper 2021-01-19 10:33:08 -07:00
Scot Breitenfeld
a464bea84b removed the check for H5Pset_libver_bounds (HAVE_H5PSET_LIBVER_BOUNDS) since API
function was introduced in 1.8.0 (and some tests used  H5Pset_libver_bounds without
checking HAVE_H5PSET_LIBVER_BOUNDS.
2021-01-11 16:36:23 -06:00
Dennis Heimbigner
2ce6b0b5c8 Fix CMake bug 2020-12-30 13:30:12 -07:00
Greg Sjaardema
29d37adc3d
Fix detection and use of SZIP library
Potential fix for #1915
2020-12-21 08:25:37 -07:00
Greg Sjaardema
143c191898
Fix CMake build so netcdf_meta.h has correct form
The `NC_HAS_MULTIFILTERS` line in `netcdf_meta.h` was not of the correct form  -- showed as
```
#define NC_HAS_MULTIFILTERS
```
Instead of the better form:
```
#define NC_HAS_MULTIFILTERS 0  (or 1 if enabled)
```
2020-12-17 16:13:39 -07:00
Dennis Heimbigner
d2316f866c Additional Fixes to NCZarr
Primary Fixes:
* Add a whole variable optimization -- used in the rare case that nc_get/put_vara covers the whole of a variable and the variable has a single chunk.
* Fix chunking error when stride causes whole chunks to be skipped.
* Fix some memory leaks
* Add test cases
* Add one performance test to nczarr_test/. This uses the timer utils from unit_test: timer_utils.[ch].
* Move ncdumpchunks utility from ncdump to nczarr_test

Misc. Other Changes:
* Make check for aws libraries conditional on --enable-nczarr-s3
* Remove all but one bm tests from nczarr_test until they are working.
* Remove another dependency on HDF5 from supposedly non-HDF5 specific code; specifically hdf5_log_hdf5.
* Make the BAIL2 macro be hdf5 specific and replace elsewhere with an HDF5 independent equivalent.
* Move hdf5cache.c to libsrc4/nc4cache.c because it is used by nczarr.
* Modify unit_tests so that some of them are run even if using Windows.
* Misc. small bug fixes and refactors and memory leaks.
* Rename some conflicting tests for cmake.
* Attempted to make nc_perf work with cmake and failed.
2020-12-16 20:48:02 -07:00
Ward Fisher
66a2cd371a More tweaking. 2020-12-07 14:45:14 -07:00
Ward Fisher
6fafa6612c Merge remote-tracking branch 'origin/gh1739.wif' into gh1740.wif 2020-12-07 12:49:28 -07:00
Dennis Heimbigner
90fd1406bc Make use of clock_gettime be conditional.
Re: GH Issue https://github.com/Unidata/netcdf-c/issues/1900

Apparently the clock_gettime() function is not always available.
It is used in unit_test/tst_exhash.c and unit_test/tst_xcache.c.

To solve this, a number of things were changed:
* Move the timing code to a new file unit_tests/timer_utils.[ch]
* Modify the timing code to choose one of several timing methods
depending on availability. The prioritized order is as follows:
    1. If Windows, use the QueryPerformanceCounter mechanism else
    2. Use clock_gettime if available else
    3. Use gettimeofday if available else
    4. Use getrusage if available

Note that the resolution of 3 and 4 is less than 1 or 2.

Misc. Other Changes:
* Move the test in CMakeLists.txt that disables unit tests for WIN32 to unit_test/CMakeLists.txt since some unit tests actually work under Visual Studio.
* Fix some of the unit tests to work under visual studio
* Fix problem with using remove() in zmap_nzf.c
* Remove some warning about use of EXTERNL
2020-12-06 18:19:53 -07:00
Dennis Heimbigner
c25ebd7787 Fix a number of CMake problems 2020-11-19 22:24:13 -07:00
Dennis Heimbigner
eb3d9eb0c9 Provide a Number of fixes/improvements to NCZarr
Primary changes:
* Add an improved cache system to speed up performance.
* Fix NCZarr to properly handle scalar variables.

Misc. Related Changes:
* Added unit tests for extendible hash and for the generic cache.
* Add config parameter to set size of the NCZarr cache.
* Add initial performance tests but leave them unused.
* Add CRC64 support.
* Move location of ncdumpchunks utility from /ncgen to /ncdump.
* Refactor auth support.

Misc. Unrelated Changes:
* More cleanup of the S3 support
* Add support for S3 authentication in .rc files: HTTP.S3.ACCESSID and HTTP.S3.SECRETKEY.
* Remove the hashkey from the struct OBJHDR since it is never used.
2020-11-19 17:01:04 -07:00
Dennis Heimbigner
730aa1f6bc Improve the building of NCZARR S3 support in CMake and Autoconf
There were some irregularities in the flags for handling NCZarr S3 support.

The primary change is to regularize the flags controlling this to the following.

1. Automake: --enable-nczarr-s3 and CMake: ENABLE_NCZARR_S3
2. Automake: --enable-nczarr-s3-tests and CMake: ENABLE_NCZARR_S3_TESTS

Flag 1 indicates that NCZarr should be built with S3 support enabled.
Flag 2 indicates that the NCZarr S3 tests should be run

These two flags are separate because running the NCZarr S3 tests
requires access to protected S3 resources. Currently, running
these tests is restricted to Unidata personnel. However, users
may want to enable S3 support even if they cannot run the tests.
It is, of course, an error to specify 2 without specifying 1.

Additionally, if the AWS S3 SDK library is not found, then the NCZARR S3
support and testing must be disabled. Otherwise an error is signaled
during the build.

Some of these NCZarr and S3 changes are propagated to nc-config.

Misc. Other Changes:

1. Allow testing for CYGWIN or MSVC in shell scripts.
2. Add specific test for HDF5 library version 1.10.6.
   This is encoded as "HDF5_UTF8_PATHS" because that is the first
   version where HDF5 properly supports it under Windows. This is used
   in hdf5internal/nc4_ndf5_ansi_to_utf8.
3. Add a AM Conditional -- AX_IGNORE -- for use in testing
   when it is desirable to temporarily suppress Makefile code.
4. Add MULTIFILTER flag to CMakeLists.txt
2020-10-16 15:04:51 -06:00
Dennis Heimbigner
f3218a2e2c Use the built-in HDF5 byte-range reader, if available.
re: Issue https://github.com/Unidata/netcdf-c/issues/1848

The existing Virtual File Driver built to support byte-range
read-only file access is quite old. It turns out to be extremely
slow (reason unknown at the moment).

Starting with HDF5 1.10.6, the HDF5 library has its own version
of such a file driver. The HDF5 developers have better knowledge
about building such a driver and what incantations are needed to
get good performance.

This PR modifies the byte-range code in hdf5open.c so
that if the HDF5 file driver is available, then it is used
in preference to the one written by the Netcdf group.

Misc. Other Changes:

1. Moved all of nc4print code to ncdump to keep appveyor quiet.
2020-09-24 14:33:58 -06:00
Ward Fisher
85621dd06f Fixe szlib write status message for cmake-based builds. 2020-09-15 15:00:02 -06:00
Ward Fisher
a89e1f73b8 Merge branch 'ncgenchunks.dmh' of https://github.com/DennisHeimbigner/netcdf-c into master 2020-09-09 10:24:33 -06:00
Ward Fisher
31dee0c4da
Revert "Revert "Fix nczarr-experimental: improve build support, disengage hdf5 vs netcdf4 flags, and find AWS libraries"" 2020-08-17 19:15:47 -06:00
Ward Fisher
16c27ca13f
Revert "Fix nczarr-experimental: improve build support, disengage hdf5 vs netcdf4 flags, and find AWS libraries" 2020-08-17 15:51:01 -06:00
Dennis Heimbigner
616812f204
Merge branch 'master' into nczarr-update1.dmh 2020-08-14 13:03:24 -06:00
Dennis Heimbigner
d85bb6fe20 The big change for this commit is complete the
disengagement of enable-netcdf4 from enable-hdf5.
That is, with the advent of nczarr, it is possible
to turn off hdf5 but still need netcdf-4 enabled
because nczarr uses libsrc4, but not libhdf5.
This change involves a bunch of things:
1. Modify configure.ac and CMakelist to make enable_hdf5
   control if hdf5 support is provided. For back compatibility,
   disable-netcdf4 is treated as disable-hdf5. But internally,
   netcdf4 support is controlled only by the enabling of formats
   that require it.
2. In support of #1, modify .travis.yml to use enable/disable-hdf5
   instead of enable/disable-netcdf4.
3. test_common.in is modified to track selected features,
   including enable-hdf5 and enable-s3-tests. This is used in
   selected tests that mix netcdf-3 and netcdf4 tests.
4. The conflation of USE_HDF5 and USE_NETCDF4 is common in
   code, tests, and build files, so all of those had to be weeded out.
5. It turns out that some of the NC4_dim functions really are HDF5 specific,
   but are not treated as such. So they are moved from nc4dim.c to
   hdf5dim.c or hdf5dispatch.c
6. Some generic functions in libhdf5 can be (and were) moved to libsrc4.
2020-08-12 15:42:50 -06:00
Magnus Ulimoen
12d86675ef H5Znoop1.c copied to BINARY_DIR instead of SOURCE_DIR 2020-08-12 17:03:33 +02:00
Magnus Ulimoen
9d10e605c2 Move generated file to BINARY_DIR 2020-08-12 16:55:14 +02:00
Magnus Ulimoen
a3f2c5847f Configure netcdf_meta.h directly to BINARY_DIR 2020-08-12 16:14:23 +02:00
Magnus Ulimoen
8f1fc8a73c Generate m4 files out of tree 2020-08-12 16:14:23 +02:00
Dennis Heimbigner
70c873cd91 Merge branch 'nczarr-update1.dmh' of https://github.com/DennisHeimbigner/netcdf-c into nczarr-update1.dmh 2020-08-04 17:31:39 -06:00
Dennis Heimbigner
6074c8a02d Fix items in netcdf_meta.h 2020-08-04 17:31:24 -06:00
Dennis Heimbigner
a905c886d1
Merge branch 'master' into nczarr-update1.dmh 2020-07-27 19:17:57 -06:00
Edward Hartnett
088528987f fixed dispatch version number in CMakeLists.txt 2020-07-15 06:58:16 -06:00
Dennis Heimbigner
b3ec7140e1 Move closer to getting S3 support work with CMake under Visual
Studio. The code will build and all the tests will run except for the
S3 tests in nczarr_test.
2020-07-14 19:24:20 -06:00
Dennis Heimbigner
d538cf38c2 Fix nczarr-experimental to better support CMake and find AWS libraries
The primary fix is to improve CMake build support.
Specific changes include:
* CMake: Provide a better soln to locating the AWS SDK
  libraries; the new way is the preferred method as described in
  the aws-cpp-sdk documentation.
* CMake (and Automake): allow -DENABLE_S3_SDK (default off) to suppress
  looking for AWS libraries.
* CMake: add the complete set of nczarr tests
* CMake: add EXTERNL as needed to various .h files.
* Improve support for windows drive letters in paths.
* Add nczarr and s3 flags to nc-config
* For VisualStudio X nczarr, cleanup the NAN+INFINITY handling
* Convert _MSC_VER -> _WIN32 and vice versa as needed
* NCZarr - support multiple platform paths including windows, cygwin.
  mingw, etc.
* NCZarr - sort the test outputs because different platforms
  produce directory contents in different orders.

One big change concerns netcdf-c/CMakeLists.txt and netcdf-c/configure.ac.
In the current versions, it was the case that --disable-hdf5
disabled netcdf-4 (libsrc4). With nczarr, this can no longer
be the case because nczarr requires libsrc4 even if libhdf5
is disabled. So, I modified the above files to move the
format options (HDF5, NCZarr, HDF4, etc) to a single place
near the front of the files. Now it is the case that:
* Enabling any of the formats that require libsrc4
  also does an implicit --enable-netcdf4.
* --disable-netcdf4 | --disable-netcdf-4 now becomes
  and alias for --disable-hdf5.

There are probably some bugs in this change in terms of
dependencies between format options.

Problems:
* CMake S3 support is still not working for Visual Studio
* A recent issue points out that there is work to do on handling
  UTF8 filenames, but that will be addressed in a separate fix.

Notes:
* Consider converting all of our includes/.h files to use EXTERNL
2020-07-12 12:21:56 -06:00
Dennis Heimbigner
59e04ae071 This PR adds EXPERIMENTAL support for accessing data in the
cloud using a variant of the Zarr protocol and storage
format. This enhancement is generically referred to as "NCZarr".

The data model supported by NCZarr is netcdf-4 minus the user-defined
types and the String type. In this sense it is similar to the CDF-5
data model.

More detailed information about enabling and using NCZarr is
described in the document NUG/nczarr.md and in a
[Unidata Developer's blog entry](https://www.unidata.ucar.edu/blogs/developer/en/entry/overview-of-zarr-support-in).

WARNING: this code has had limited testing, so do use this version
for production work. Also, performance improvements are ongoing.
Note especially the following platform matrix of successful tests:

Platform | Build System | S3 support
------------------------------------
Linux+gcc      | Automake     | yes
Linux+gcc      | CMake        | yes
Visual Studio  | CMake        | no

Additionally, and as a consequence of the addition of NCZarr,
major changes have been made to the Filter API. NOTE: NCZarr
does not yet support filters, but these changes are enablers for
that support in the future.  Note that it is possible
(probable?) that there will be some accidental reversions if the
changes here did not correctly mimic the existing filter testing.

In any case, previously filter ids and parameters were of type
unsigned int. In order to support the more general zarr filter
model, this was all converted to char*.  The old HDF5-specific,
unsigned int operations are still supported but they are
wrappers around the new, char* based nc_filterx_XXX functions.
This entailed at least the following changes:
1. Added the files libdispatch/dfilterx.c and include/ncfilter.h
2. Some filterx utilities have been moved to libdispatch/daux.c
3. A new entry, "filter_actions" was added to the NCDispatch table
   and the version bumped.
4. An overly complex set of structs was created to support funnelling
   all of the filterx operations thru a single dispatch
   "filter_actions" entry.
5. Move common code to from libhdf5 to libsrc4 so that it is accessible
   to nczarr.

Changes directly related to Zarr:
1. Modified CMakeList.txt and configure.ac to support both C and C++
   -- this is in support of S3 support via the awd-sdk libraries.
2. Define a size64_t type to support nczarr.
3. More reworking of libdispatch/dinfermodel.c to
   support zarr and to regularize the structure of the fragments
   section of a URL.

Changes not directly related to Zarr:
1. Make client-side filter registration be conditional, with default off.
2. Hack include/nc4internal.h to make some flags added by Ed be unique:
   e.g. NC_CREAT, NC_INDEF, etc.
3. cleanup include/nchttp.h and libdispatch/dhttp.c.
4. Misc. changes to support compiling under Visual Studio including:
   * Better testing under windows for dirent.h and opendir and closedir.
5. Misc. changes to the oc2 code to support various libcurl CURLOPT flags
   and to centralize error reporting.
6. By default, suppress the vlen tests that have unfixed memory leaks; add option to enable them.
7. Make part of the nc_test/test_byterange.sh test be contingent on remotetest.unidata.ucar.edu being accessible.

Changes Left TO-DO:
1. fix provenance code, it is too HDF5 specific.
2020-06-28 18:02:47 -06:00
Dennis Heimbigner
65414eeaa4 Fix some protocol differences between netcdf-c and the Hyrax server.
re: Partly addresses issue https://github.com/Unidata/netcdf-c/issues/1712.

1. Turn on Hyrax Hack to accept Hyrax style attribute containers.
2. Support Url type as alias for String.
3. Accept the special attribute, "__DAP4_Checksum_CRC32",
   to control per-variable checksums.
4. Make _DAP4_xxx attributes be reserved and only accessible
   by name (ala _SuperBlock attribute).
5. Fix handling of checksums. There is a hack in the code
   that uses an extra flag in the chunk header to indicate
   that all variables have checksums. This violates the spec
   and will be removed once it is possible to regenerate the
   test cases.

Note that checksumming with the Hyrax test server has not
been tested. This, along with some other probable inconsistencies,
needs fixing when OPeNDAP and Unidata can agree on the proper
specification. Testing will be included.
2020-05-30 17:36:25 -06:00
Ward Fisher
31712192b2 More m4 fenceposting. 2020-05-26 16:09:10 -06:00
Ward Fisher
5961d6dc37 Added a check for m4 and throw an error if m4 isn't on the path and the generated file isn't present (as it would be in a point release). In support of https://github.com/Unidata/netcdf-c/issues/1739 2020-05-26 14:46:32 -06:00
Dennis Heimbigner
dc51d436f6 master merge update 2020-05-20 10:23:47 -06:00
Antonio Valentino
1fbe1afb85 Fix HDF5_ZLIB check 2020-05-20 16:02:10 +02:00
Ward Fisher
c2ea69df23
Merge pull request #1732 from DennisHeimbigner/vsfix.dmh
Fix undefined references when using Visual Studio
2020-05-19 16:21:04 -06:00
Dennis Heimbigner
c68c4c804d Fix undefined references when using Visual Studio
Fix Issue https://github.com/Unidata/netcdf-c/issues/1725.
Replace PR https://github.com/Unidata/netcdf-c/pull/1726
Also replace PR https://github.com/Unidata/netcdf-c/pull/1694

The general problem is that under Visual Studio, we are seeing
a number of undefined reference and other scoping errors.
The reason is that the code is not properly using Visual Studio
_declspec() declarations.

The basic solution is to ensure that when compiling the code itself
one needs to ensure that _declspec(dllexport) is used. There
are several sets of macros to handle this, but they all rely
on the flag DLL_EXPORT being define when the code is compiled,
but not being defined when the code is used via a .h file.

As a test, I modified XGetOpt.c to build properly. I also
fixed the oc2 library to properly _declspec things like ocdebug.

I also made some misc. changes to get all the tests to run
if cygwin is installed (to get bash, sed, etc).

Misc. Changes:
* Put XGetOpt.c into libsrc and copy at build time
  to the other directories where it is needed.
2020-05-18 19:36:28 -06:00
Peter Hill
e1ef7a958c Fix wrong header include in testing HDF5 for zlib 2020-05-16 12:45:13 +01:00
Dennis Heimbigner
a9cede7647 handle missing H5Dread_chunks 2020-05-14 12:59:00 -06:00
Ward Fisher
fc1d75f842
Merge pull request #1721 from gsjaardema/patch-39
Different method of setting Parallel Filters variables
2020-05-13 15:05:34 -06:00
Ward Fisher
9f6981bc6b
Merge pull request #1719 from DennisHeimbigner/filterrepeat.dmh
Allow redefinition of variable filters
2020-05-12 16:03:51 -06:00
Greg Sjaardema
485810262d
Fix CMake generation of netcdf_meta.h
These changes seem to be correct for the generation of `netcdf_meta.h` in a CMake build.  I think this addresses #1723 

There is still an issue with the libnetcdf.settings
2020-05-11 16:53:30 -06:00
Greg Sjaardema
8d7d5ac9e5
Different method of setting Parallel Filters variables
The current method of setting the `HDF5_HAS_PAR_FILTERS` and `HAS_PAR_FILTERS` variables is done purely based on the `HDF5_VERSION` and that variable is only set inside the if block which finds the HDF5 library based on CMake package files.  If the user specifies the explicit location of the HDF5 library and include files (for example, via:
```
         -DHDF5_C_LIBRARY:PATH=${INSTALL_PATH}/lib/libhdf5.${LD_EXT} \
         -DHDF5_HL_LIBRARY:PATH=${INSTALL_PATH}/lib/libhdf5_hl.${LD_EXT} \
         -DHDF5_INCLUDE_DIR:PATH=${INSTALL_PATH}/include
```
Then, the code path which determines whether the par filters variables is set is not run.  However, later on in the file, there is another check for parallel filter support (near line 759):
```
  # Check to see if this is hdf5-1.10.3 or later.
  CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Dread_chunk "" HDF5_SUPPORTS_PAR_FILTERS)
```

This PR moves the code that sets the two other par filters variables down after this check and instead of setting their values based on the version, it bases it on the results of this test.

I'm not totally sure why there are three variables; it looks like the `HDF5_SUPPORTS_PAR_FILTERS` and `HDF5_HAS_PAR_FILTERS` could be combined.  I think the `HAS_PAR_FILTERS` is a string which is used to show the results of the configuration and the other two are booleans.

The new check should work for both types of HDF5 installs (cmake-based and configure-based)
2020-05-11 11:11:24 -06:00
Dennis Heimbigner
84c69afca7 Allow redefinition of variable filters
re: Github issue https://github.com/Unidata/netcdf-c/issues/1713

If nc_def_var_filter or nc_def_var_deflate or nc_def_var_szip is
called multiple times with the same filter id, but possibly with
different sets of parameters, then the first invocation is
sticky and later invocations are ignored. The desired behavior
is to have the last invocation be used.

This PR implements that desired behavior, with some special
cases.  If you call nc_def_var_deflate multiple times, then the
last invocation rule applies with respect to deflate. However,
the shuffle filter, if enabled, is always applied just before
applying deflate.

Misc unrelated changes:
1. Make client-side filters be disabled by default
2. Fix the definition of uintptr_t and use in oc2 and libdap4
3. Add some test cases
4. modify filter order tests to use plugin filters rather
   than client-side filters
2020-05-11 09:42:31 -06:00
Dennis Heimbigner
313121a229 Use proper CURLOPT values for VERIFYHOST and VERIFYPEER
re: https://github.com/Unidata/netcdf-c/issues/1684
re: e-support VZL-904142

Two issues:
1. As of libcurl 7.66, the semantics of CURLOPT_SSL_VERIFYHOST
   changed so that the non-zero values affects certificate processing.
2. The current library was forcing the values of VERIFYPEER
   and VERIFYHOST to zero instead of leaving them to the default values.

Solution was first to leave the defaults in place for VERIFYPEER and VERIFYHOST
as long as they are not set in .ocrc/.dodsrc file.
Second, the value of HTTP.SSL.VERIFYPEER or HTTP.SSL.VERIFYHOST
as set in .ocrc/.dodrc is used to set the corresponding CURLOPT flags.
So for example, adding
> HTTP.SSL.VERIFYHOST=2
will set the value of CURLOPT_SSL_VERIFYHOST to 2, the default.
Using
> HTTP.SSL.VERIFYHOST=0
will set the value of CURLOPT_SSL_VERIFYHOST to 0, which disables it.
Similarly for VERIFYPEER.

Finally the semantics of HTTP.SSL.VALIDATE is now equivalent to
> HTTP.SSL.VERIFYPEER=1
> HTTP.SSL.VERIFYHOST=2
2020-04-10 13:42:27 -06:00
Ward Fisher
65a17399b9 Corrected parallel (mpi) testing on cmake builds. 2020-04-02 10:09:57 -06:00
Ward Fisher
b0e2d78ffa Corrected an issue with parallel filter test logic in cmake-based builds. 2020-04-01 17:08:24 -06:00
Ward Fisher
9d482c3f20 Added hard failure to script, modified cmake default. 2020-04-01 16:20:33 -06:00
Ward Fisher
d9e69bbb6b Updated soversion, bump to next development version in preparation of upstream merge back into master from 4.7.4 wellspring. 2020-03-26 11:31:43 -06:00
Greg Sjaardema
aca7b5cc2e
Better finding of the hdf5.h include path
The `FIND_PATH` function has a non-intuitive order in which is searches for include paths and the original form could find a system-installed version of HDF5 even though the developer specified an explicit path via `HDF5_INCLUDE_DIR`.  See https://cmake.org/cmake/help/latest/command/find_path.html for more information.

The form in this patch is the recommended method from that page for changing the default search order to find the explicitly specified path *first*


> The default search order is designed to be most-specific to least-specific for common use cases. Projects may override the order by simply calling the command multiple times and using the NO_* options:
```
find_path (<VAR> NAMES name PATHS paths... NO_DEFAULT_PATH)
find_path (<VAR> NAMES name)
```
> Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
2020-03-05 14:44:38 -07:00
Dennis Heimbigner
b488c272d5 Fix conflicts with master 2020-02-27 14:06:45 -07:00
Dennis Heimbigner
44d0dcaad2 Add support for multiple filters per variable.
re: https://github.com/Unidata/netcdf-c/issues/1584

Support has been added for multiple filters per variable.  This
affects a number of components in netcdf. The new APIs are
documented in NUG/filters.md.

The primary changes are:
* A set of new functions are provided (see __include/netcdf_filter.h__).
    - Obtain a list of the filters associated with a variable
    - Obtain the parameters for a specific filter.
* The existing __nc_inq_var_filter__ function now returns info
  about the first defined filter.
* The utilities (ncgen, ncdump, and nccopy) now support
  an extended format for specifying a sequence of filters.
  The general form is __<filter>|<filter>..._.
* The ncdump **_Filter** attribute now dumps a list of all the
  filters associated with a variable using the above new format.
* Filter specifications can now use a filter name instead of number
  for filters known to the netcdf library, which in turn is taken
  from the HDF5 filter registration page.
* New errors are defined: NC_EFILTER and NC_ENOFILTER. The latter
  is returned if an attempt is made to access an unknown filter.
* Internally, the dispatch table has been extended to add a function
  to handle all of the filter functions.
* New, filter-related, tests were added to nc_test4.
* A new plugin was added to the plugins directory to help with testing.

Notes:
1. The shuffle and fletcher32 filters are not part of the multifilter system.

Misc. changes:
1. A debug module was added to libhdf5 to help catch error locations.
2020-02-16 12:59:33 -07:00
Ward Fisher
b01fbb058d
Merge pull request #1619 from NOAA-GSD/ejh_more_szip
fixed libnetcdf.settings output in cmake build wrt szip
2020-02-06 12:42:27 -07:00
Ward Fisher
1573fead56
Merge pull request #1606 from NOAA-GSD/ejh_no_zlib
detect if HDF5 was built without zlib, and error out of configure/cmake
2020-02-06 12:42:04 -07:00
Edward Hartnett
dfd496d3a5 fixed libnetcdf.settings output in cmake build wrt szip 2020-02-02 13:55:58 -07:00
Ward Fisher
e8c2d22ddd Cleaned up szlib status message in libnetcdf.settings. 2020-01-24 16:36:29 -07:00
Edward Hartnett
0672310411 fixed cmake check for zlib in HDF5 library 2020-01-23 06:51:44 -07:00
Edward Hartnett
adf2aa31e4 moved cmake detection of lack of zlib to be with other HDF5 stuff 2020-01-23 05:43:48 -07:00
Edward Hartnett
60cfe7782d detecting lack of zlib in cmake build 2020-01-23 05:40:44 -07:00
Edward Hartnett
0735a45178 switch cmake build to check for func H5Dread_chunk to detect 1.10.3 or later 2020-01-21 07:42:14 -07:00
Edward Hartnett
21a204c4e8 start using par filters in HDF5-1.10.3 2020-01-17 14:01:07 -07:00
Edward Hartnett
fb51e4475b adding NC_HAS_SZIP_WRITE and NC_HAS_PAR_FILTERS to cmake build 2020-01-17 10:30:14 -07:00
Ward Fisher
488b7e43d1
Merge pull request #1588 from oxelson/jsremotetest
changed/removed references to jetstream remotetest instance.
2020-01-13 16:07:17 -07:00
Ward Fisher
8771d0bdf4
Merge pull request #1582 from NOAA-GSD/ejh_parallel_zlib
Allow user to turn on zlib, shuffle, and/or fletcher32 filters with parallel I/O for HDF5-1.10.2+
2020-01-13 16:06:51 -07:00
Jennifer Oxelson
1b343324ea
Merge branch 'master' into jsremotetest 2020-01-10 17:35:34 -07:00
Ward Fisher
438119dd69
Merge pull request #1560 from NOAA-GSD/ejh_cache_docs
increase default cache size for netCDF-4/HDF5 files, also improve cache docs and add benchmarking program
2020-01-07 11:46:30 -07:00
Ward Fisher
20a8db5a7b
Merge pull request #1532 from NetCDF-World-Domination-Council/ejh_cmake_unit_tests
Adding rest of unit_tests to CMake build, but not running them on Windows
2020-01-07 11:44:56 -07:00
Jennifer Oxelson
feb7da82ec changed/removed references to jetstream remotetest instance. 2020-01-03 13:12:58 -07:00
Dennis Heimbigner
30b3401358 Forgot to create pingurl4.c for Cmake 2020-01-02 11:47:25 -07:00
Edward Hartnett
680e44f628 changed name of macro 2019-12-20 13:58:01 -07:00
Edward Hartnett
32a776badf getting parallel I/O with zlib working in cmake builds 2019-12-20 09:43:56 -07:00
James Sharpe
c5d1e4bdec Call find_package(MPI) to locate MPI paths and link to libdispatch if required 2019-12-18 16:48:40 +00:00
Edward Hartnett
4a5ae05dbf cleanup of RELAX_COORD_BOUND in cmake build 2019-11-26 06:59:03 -07:00
Edward Hartnett
8c648b5a2d changed cmake build to only allow relaxed coord builds 2019-11-26 05:40:03 -07:00
Edward Hartnett
a4465da974 new cache default in cmake build 2019-11-25 17:23:07 -07:00
Ward Fisher
dac41651ee Merge branch 'feature/cmake-targets' of https://github.com/kprussing/netcdf-c into v4.7.3-wellspring.wif 2019-11-19 14:12:41 -07:00
Keith F. Prussing
808803ceeb Add namespace for CMake targets
The usual convention with modern CMake is to namespace the targets.
This gives the netCDF namespace to the package.
2019-11-19 14:45:21 -05:00
Keith F. Prussing
adf2f4d098 Add include directories as netcdf property
Modern CMake tracks the properties of targets so that down stream
libraries do not have to worry about include directories.  However, the
include directories must be added to the target and not just at the
directory level.
2019-11-19 14:39:46 -05:00
Ward Fisher
e4efdd4cfb Bumped version to next development version. 2019-11-18 14:35:01 -07:00
Ward Fisher
a268e6d69f Ctest security stance. 2019-11-18 12:07:01 -07:00
Ward Fisher
7cbbc32dad Adding new security stance to cdash instance. 2019-11-18 10:58:44 -07:00
edwardhartnett
14f2b50f2f turned off unit tests for windows 2019-11-16 07:20:45 -07:00
edwardhartnett
f6ace74afb merged master 2019-11-16 07:19:40 -07:00
edwardhartnett
c1989b738e fixed setting of NC_DISPATCH_VERSION in cmake build 2019-11-15 14:57:07 -07:00
edwardhartnett
7b2ddf2537 trying unit tests on windows 2019-11-15 14:22:34 -07:00
edwardhartnett
a0f984f997 added dispatch version to netcdf_meta.h and libnetcdf.settings 2019-11-15 10:06:46 -07:00
Turing Eret
84a293351e Changes to make it possible to nest this project inside of another CMake
project.
2019-11-07 14:00:53 -07:00
Ward Fisher
f8a588843d Preparing for 4.7.3 development pushed back upstream, forking off to 4.7.2 release branch. 2019-10-18 12:09:28 -06:00
John Buonagurio
bc2a3babf9 Enable HDF5 parallel support for MSVC; add MPI dependency. 2019-09-21 21:56:39 -04:00
Greg Sjaardema
56c0d5cf8a Spelling fixes 2019-09-18 08:03:01 -06:00
Ward Fisher
7aab16254a Bumped to next development version. 2019-08-26 13:07:51 -06:00
Ward Fisher
9a92201c94 Wiring unit test directory into cmake-based builds. 2019-08-21 14:50:09 -06:00
edwardhartnett
e123957618 removed commented lines refering to run_par_test2.sh, which does not exist 2019-08-16 04:42:57 -06:00
Ward Fisher
103e5a3ff5
Merge pull request #1385 from Unidata/mmapfix.dmh
Fix cmake wrt mmap
2019-05-02 11:09:12 -06:00
Ward Fisher
44fce0904e
Merge pull request #1387 from Unidata/fixffilter.dmh
Minor config.h changes to support filters in Fortran
2019-05-01 14:44:53 -06:00
Dennis Heimbigner
62e2b472b4 Minor config.h changes to support filters in Fortran 2019-04-29 16:36:08 -06:00
Ward Fisher
c86593aca3 Corrected cmake syntax, working with a list not a string. 2019-04-26 16:28:53 -06:00
Ward Fisher
dda48ced44 Corrected a case in CMake Syntax where an empty string would cause a failure. 2019-04-26 16:00:28 -06:00
Ward Fisher
88de6f0e1c Updated versions, Release Notes. 2019-04-25 15:40:04 -06:00
Dennis Heimbigner
c9d16d82d6 Fix cmake X mmap
supercede PR: https://github.com/Unidata/netcdf-c/pull/1384

Since we have an mmap user, undeprecate it and make sure
it works. Other changes:

* fix test cases to work with make -j
* fix exposed ncgen error.
2019-04-19 20:32:26 -06:00
Ward Fisher
832c90bb56 Merge branch 'master' into cleanup.wif 2019-04-02 10:44:51 -06:00
Ward Fisher
d0a46d0eed
Merge pull request #1371 from NetCDF-World-Domination-Council/ejh_move_perf
Move performance testing from nc_test4 to new directory nc_perf
2019-04-01 11:08:13 -06:00
Ward Fisher
3823307b9e Disable run_par_test2.sh.in template processing code temporarily. 2019-03-26 15:38:22 -06:00
Ward Fisher
7addb30afd
Merge pull request #1367 from jschueller/patch-1
Fix STRNG typo in CMakeList
2019-03-26 15:33:00 -06:00
Ed Hartnett
d4ab03ea23 merged upstream/master 2019-03-26 11:29:01 -06:00
Dennis Heimbigner
4026323383 Fix minor --ansi warnings in dinfermodel.c and bzlib.c
re:

Needed to provide centralized definitions of fileno and fdopen;
also need to #include sys/types.h
2019-03-22 15:16:47 -06:00
Ward Fisher
e2b31ffae4
Merge branch 'master' into byterange.dmh 2019-03-19 12:05:44 -06:00
Ed Hartnett
5c06d40006 attempting to get cmake build working with new nc_perf directory 2019-03-18 08:15:57 -06:00
Ed Hartnett
51b8ba10b4 attempting to get cmake build working with new nc_perf directory 2019-03-18 08:09:46 -06:00
Julien Schueller
5a5981989c
Fix STRNG typo in CMakeList 2019-03-17 09:09:16 +01:00
Ward Fisher
a4d18bdd66 Bumped SO version in line with http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning 2019-02-28 13:25:56 -07:00
Ward Fisher
eb9f6097d5 Bringing netcdf.pc generated by cmake in line with netcdf.pc generated by configure, in support of https://github.com/Unidata/netcdf-c/issues/gh1324 2019-02-27 14:36:42 -07:00
Ward Fisher
18c403aa02 Prepping for 4.6.3 release, bumping to subsequent version in dev branch. 2019-02-26 14:00:59 -07:00
Dennis Heimbigner
0c59e13bf7 Master merge, conflict resolution, cleanup 2019-02-24 16:54:13 -07:00
Dennis Heimbigner
45a8a265b8 master merge 2019-02-23 17:14:12 -07:00
Ward Fisher
d6c845370b Added fenceposting around H5free_memory, H5allocate_memory, H5resize_memory, as these were all introduced in hdf5 1.8.15. 2019-02-21 14:02:46 -07:00
Dennis Heimbigner
c59d5ce205 Fix handling of '/' characters in names in DAP2.
re: https://github.com/Unidata/thredds/issues/1224
[note that this is an issue in thredds, but the fix is in netcdf-c]

A thredds server can encode a netcdf-4 file into DAP2
by flattening names to include the containing group path,
where the group names are separated by '/'.

But the '/' is prohibited in netcdf names even if escaped
(a decision before my time).

So, if the netcdf-c/libdap2 code encounters a DAP2 name with '/'
characters, the '/' characters are converted to the string
%2f. Unfortunately, there is a glitch, namely that converting
the leading '/' produces a name that is still illegal. This PR
modifies the code to just drop the leading '/' character.
2019-02-14 20:25:40 -07:00
Ward Fisher
1fde39c8d7
Merge branch 'master' into byterange.dmh 2019-02-07 14:28:23 -07:00
Ward Fisher
b27c7d899d Merge branch 'master' into byterange.dmh 2019-01-25 14:50:23 -07:00
Ward Fisher
766d2acfc3 Update CmakeLists.txt in support of https://github.com/Unidata/netcdf-c/issues/1295 2019-01-25 11:26:26 -07:00
Ward Fisher
591b1fd131 Merge branch 'bugfix/debian-stable-default-compilation' of https://github.com/t-b/netcdf-c into pr-aggregation.wif 2019-01-23 15:10:15 -07:00
Ward Fisher
35d0815f82 Merge remote-tracking branch 'origin/gh1245.wif' into pr-aggregation.wif 2019-01-15 15:05:51 -07:00
Ward Fisher
440a9e2ca4
Merge branch 'master' into ansifix.dmh 2019-01-10 13:36:19 -07:00
Ward Fisher
f323a5fec9 Modified cmake configuration file in support of https://github.com/Unidata/netcdf-c/issues/1253 2019-01-08 16:37:33 -07:00
Thomas Braun
531df26af0 CMakeLists.txt: Fix compilation with default settings on debian stretch
Since 209c31d3 (Bringing config.h as generagted by cmake in line with config.h as generated by autotools., 2017-01-27)
we check that we can find the hdf5.h main include file.

But this file may reside in non-standard location so we have to search
in HDF5_INCLUDE_DIR as well.
2019-01-05 14:27:45 +01:00
Dennis Heimbigner
bf2746b8ea Provide byte-range reading of remote datasets
re: issue https://github.com/Unidata/netcdf-c/issues/1251

Assume that you have the URL to a remote dataset
which is a normal netcdf-3 or netcdf-4 file.

This PR allows the netcdf-c to read that dataset's
contents as a netcdf file using HTTP byte ranges
if the remote server supports byte-range access.

Originally, this PR was set up to access Amazon S3 objects,
but it can also access other remote datasets such as those
provided by a Thredds server via the HTTPServer access protocol.
It may also work for other kinds of servers.

Note that this is not intended as a true production
capability because, as is known, this kind of access to
can be quite slow. In addition, the byte-range IO drivers
do not currently do any sort of optimization or caching.

An additional goal here is to gain some experience with
the Amazon S3 REST protocol.

This architecture and its use documented in
the file docs/byterange.dox.

There are currently two test cases:

1. nc_test/tst_s3raw.c - this does a simple open, check format, close cycle
   for a remote netcdf-3 file and a remote netcdf-4 file.
2. nc_test/test_s3raw.sh - this uses ncdump to investigate some remote
   datasets.

This PR also incorporates significantly changed model inference code
(see the superceded PR https://github.com/Unidata/netcdf-c/pull/1259).

1. It centralizes the code that infers the dispatcher.
2. It adds support for byte-range URLs

Other changes:

1. NC_HDF5_finalize was not being properly called by nc_finalize().
2. Fix minor bug in ncgen3.l
3. fix memory leak in nc4info.c
4. add code to walk the .daprc triples and to replace protocol=
   fragment tag with a more general mode= tag.

Final Note:
Th inference code is still way too complicated. We need to move
to the validfile() model used by netcdf Java, where each
dispatcher is asked if it can process the file. This decentralizes
the inference code. This will be done after all the major new
dispatchers (PIO, Zarr, etc) have been implemented.
2019-01-01 18:27:36 -07:00
Ward Fisher
264dc38bf3 Fixed plugin compilation using MSVC in support of https://github.com/Unidata/netcdf-c/issues/1245 2018-12-18 13:26:49 -07:00
Dennis Heimbigner
735ae80928 merge master and fix conflicts 2018-12-12 11:47:54 -07:00
Ward Fisher
d135fb4200 Removed confounding text from a reference file, turned on filter testing by default in Cmake-based builds. 2018-12-07 14:44:47 -07:00
Dennis Heimbigner
1a7531392f Make the netcdf-c library compile with gcc -ansi.
Primary fixes to get -ansi to work.
1. Convert all '//' C++ style comments to /*...*/ or to use #if 0...#endif
2. It turns out that when -ansi is specified, then a number of
   functions no longer are defined in the header -- but they are still
   in the .so file.<br>
   The big example is strdup(). So, added code to include/ncconfig.h to define
   externs for those missing functions that occur in more than one place.
   These are enabled if !_WIN32 && __STDC__ == 1 (__STDC__ is supposed to
   be the equivalent compile time flag to -ansi). Note that this requires
   config.h (which references ncconfig.h) to be included in files where it is
   currently not included. Single uses will be only in the file that uses them.
3. Added mmap test for the MAP_ANONYMOUS flag to configure.ac. Apparently
   this is not always defined with -ansi.
4. fix some large integer constants in nc_test4/tst_atts3.c and nc_test4/tst_filterparser.c
   to avoid compiler complaints.
5. fix a double constant in nc_test4/tst_filterparser.c to avoid compiler complaints.

[Note I suspect #4 and #5 will be a problem on big-endian machines, but we have no way to test]

Misc. Changes:
1. convert more instances of _MSC_VER to _WIN32.
2. added some debugging code to include/nctestserver.h
3. added comment about libdispatch/drc.c always being compiled.
4. modify parser generation in ncgen to remove unneeded files.
2018-12-05 19:20:43 -07:00
Ward Fisher
ce78cf2d73
Merge branch 'master' into MT-for-MSVC-release 2018-11-15 15:49:05 -07:00
Greg Sjaardema
d18457a2d0
RPATH handling is not needed for archive library
If not building shared libraries, then the RPATH handling should not be specified.  Although ignored on some compilers, the CRAY / Intel compiler will error out when installing the NetCDF executables if the RPATH settings are enabled.
2018-11-06 10:11:57 -07:00
Ward Fisher
6eec91bc5f Merge branch 'leak1.dmh' into v4.6.2-release-branch.wif 2018-11-01 12:09:53 -06:00
Dennis Heimbigner
245961de00 re: github issues
https://github.com/Unidata/netcdf-c/issues/1168
    https://github.com/Unidata/netcdf-c/issues/1163
    https://github.com/Unidata/netcdf-c/issues/1162

This PR partially fixes memory leaks in the netcdf-c library,
in the ncdump utility, and in some test cases.

The netcdf-c library now runs memory clean with the assumption
that the --disable-utilities option is used. The primary remaining
problem is ncgen. Once that is fixed, I believe the netcdf-c library
will run memory clean with no limitations.

Notes
-----------
1. Memory checking was performed using gcc -fsanitize=address.
   Valgrind-based testing has yet to be performed.
2. The pnetcdf, hdf4, and examples code has not been tested.

Misc. Non-leak changes
1. Make tst_diskless2 only run when netcdf4 is enabled (issue 1162)
2. Fix CmakeLists.txt to turn off logging if ENABLE_NETCDF_4 is OFF
3. Isolated all my debug scripts into a single top-level directory
   called debug
4. Fix some USE_NETCDF4 dependencies in nc_test and nc_test4 Makefile.am
2018-10-30 20:48:12 -06:00
Ward Fisher
f5482d5f37 Recreating 4.6.2 release branch. 2018-10-22 16:52:07 -06:00