Commit Graph

659 Commits

Author SHA1 Message Date
Dennis Heimbigner
69e84fe9f1 Fix byterange handling of some URLS
re: Issue

The byterange handling of the following URLS fails.

### Problem 1: "https://crudata.uea.ac.uk/cru/data/temperature/HadCRUT.4.6.0.0.median.nc#mode=bytes"
It turns out that byterange in hdf5 has two possible targets: S3 and not-S3 (e.g. a thredds server or the crudata URL above). Each uses a different HDF5 Virtual File Driver (VFD).
I incorrectly set up the byterange code in libhdf5 so that it would choose one or the other of the two VFD's for any netcdf-c library build. The fix is to allow it to choose either one at run-time.

### Problem 2: "https://noaa-goes16.s3.amazonaws.com/ABI-L1b-RadF/2022/001/18/OR_ABI-L1b-RadF-M6C01_G16_s20220011800205_e20220011809513_c20220011809562.nc#mode=bytes,s3"
When given what appears to be an S3-related URL, the netcdf-c library code converts it into a canonical, so-called "path" format. In casing out the possible input URL formats, I missed the case where the host contains the bucket ("noaa-goes16"), but not the region. So the fix was to check for this case.

## Misc. Related Changes
1. Since S3 is used in more than just NCZarr, I changed the automake/cmake options to replace "--enable-nczarr-s3" with "--enable-s3", but keeping the former option as a synonym for the latter. This also entailed cleaning up libnetcdf.settings WRT S3 support
2. Added the above URLS as additional test cases

## Misc. Un-Related Changes
1. CURLOPT_PUT is deprecated in favor to CURLOPT_UPLOAD
2. Fix some minor warnings

## Open Problems
* Under Ubuntu, either libcrypto or aws-sdk-cpp has a memory leak.
2023-03-02 19:51:02 -07:00
Ward Fisher
05b82feec0
Merge pull request #2641 from WardF/minor_cleanup.wif
Cleaning up a few stray issues
2023-02-27 16:49:50 -07:00
Ward Fisher
96c41b1de6
Merge pull request #2592 from mwestphal/improve_nczarr_zip_logic
Avoid optionaly depends on zip for NCZarr
2023-02-27 15:50:49 -07:00
Ward Fisher
267b26f123 Fix a logic error that was resulting in an easy-to-miss error when running configure. 2023-02-27 15:12:32 -07:00
Ward Fisher
a1d5e98896 Turn nczarr zip support off by default in cmake, add a status line indicating whether nczarr-zip-support is available, in libnetcdf.settings. 2023-02-27 13:34:26 -07:00
Ward Fisher
c05505a1b8 Added benchmarking option to cmake-based builds, turned on unit-testing by default 2023-02-16 11:20:45 -07:00
Ward Fisher
9746cfa83f Updating for v4.9.1 release. 2023-02-02 15:05:55 -07:00
Ward Fisher
00065451fc Merging https://github.com/Unidata/netcdf-c/pull/2583 manually into the v4.9.1 wellspring branch. 2023-01-10 13:42:41 -08:00
Ward Fisher
394cf6466e Correct version string change that should not have ended up in this branch. 2023-01-09 15:07:46 -08:00
Ward Fisher
ecd48ae14e Cleaning up NCZARR_S3 summary, turning on byterange by default. 2023-01-09 13:48:54 -08:00
Ward Fisher
9ea273961b Added S3 status to libnetcdf.settings, turned byterange on by default. 2023-01-09 12:11:16 -08:00
Ward Fisher
37917f0d39 Make dap4 reference dap instead of hard-wired to be disabled. 2022-11-10 14:42:37 -07:00
Dennis Heimbigner
2943a78ebb Merge main and fix conflicts 2022-11-09 12:58:40 -07:00
Ward Fisher
87b50932de
Merge pull request #2530 from Unidata/v4.9.1-wellspring.wif
Merge subset of v4.9.1 files back into main development branch
2022-11-09 12:44:18 -07:00
Dennis Heimbigner
9f848c9e53 Fix race condition in ncdump (and other) tests.
re: Issue https://github.com/Unidata/netcdf-c/issues/2551

Ryan May identified the use of a common scratch file (tmp.cdl)
across multiple test shell scripts in ncdump directory
and the nczarr_test directory.
This sometimes causes errors because of race conditions
between those scripts.

I renamed those common files to avoid the race condition.  I
also did some further checking and found some additional,
similar conflicts and fixed those. Also did some minor cleanup
of unused files.

Tests fixed:
ncdump: run_back_comp_tests.sh tst_bom.sh tst_nccopy4.sh tst_nccopy5.sh
nczarr_test: git df master -- run_nccopyz.sh run_nczarr_fill.sh run_scalar.sh
2022-11-08 20:12:38 -07:00
Ward Fisher
3c8c8d6498 Merge branch 'main' into v4.9.1-wellspring.wif 2022-11-08 10:59:03 -07:00
wkliao
a7a26081d4 typo fix 2022-10-27 15:25:25 -05:00
Ward Fisher
ccd1e6a633 Updated for next release cycle. 2022-10-17 13:34:11 -06:00
Ward Fisher
a0736a3f06 Updated SO version. 2022-10-17 13:31:39 -06:00
DWesl
4046afdfc2 BLD: Fix syntax in configure.ac.
The command looks much more like test than
any command I can think of that would be called text.
2022-10-13 19:32:48 -04:00
DWesl
543e27c8af BLD: Use host platform instead of build platform for platform-specific checks. 2022-10-12 12:58:01 -04:00
Dennis Heimbigner
52a4ecad60 Move construction of VERSION file to end of the build
re: https://github.com/Unidata/netcdf-c/issues/2521

Charlie Zender has discovered that the netcdf created file VERSION
conflicts with the C++ version file on OSX case-insensitive file systems,
and maybe other case-insensitvie file systems.

Note:
1. Cmake does not create the VERSION file
2. The VERSION file is not installed
3. It turns out that the VERSION file is not required by the autoconf build.

It is possible that clients or package build system (e.g apt or brew)
might use the VERSION file, so we cannot delete it altogether.

So as a fix, we move the creation of the VERSION file to after the
build is complete by inserting a all-local hook into netcdf-c/Makefile.am.

# Misc. other changes
1. Suppressed warning by making use of the systeminfo command contingent on the platform being Windows.
2022-10-09 19:32:20 -06:00
Ward Fisher
ec7cc936fa Adding NC_HAS_BLOSC and NC_HAS_BZ2 to netcdf_meta.h in support of https://github.com/Unidata/netcdf-c/issues/2511 2022-09-20 15:11:23 -06:00
Ward Fisher
bf7062e413
Merge pull request #2507 from WardF/zstd_dev_header.wif
Check for zstd development headers in autotools
2022-09-16 16:25:08 -06:00
Ward Fisher
c07fdaf9cc Add a check for stdint.h in order to fix a weird issue where libzstd-dev, when present, was masking a missing data type declaration. 2022-09-16 12:21:06 -06:00
Ward Fisher
c79c2a5787 Clean up (on linux) an issue with uintptr_t 2022-09-16 11:46:08 -06:00
Ward Fisher
a4c158e074 Added an additional check for zstd.h in configure.ac 2022-09-16 11:03:51 -06:00
Ward Fisher
2f265b7193
Merge branch 'main' into moreszfixes.dmh 2022-09-16 10:51:22 -06:00
Ward Fisher
0d17edf2ea
Merge branch 'main' into bloscfix.dmh 2022-09-06 13:49:18 -06:00
Dennis Heimbigner
c9af92df8c conflicts 2022-08-28 13:26:20 -06:00
Dennis Heimbigner
231ae96c4b Add support for Zarr string type to NCZarr
* re: https://github.com/Unidata/netcdf-c/pull/2278
* re: https://github.com/Unidata/netcdf-c/issues/2485
* re: https://github.com/Unidata/netcdf-c/issues/2474

This PR subsumes PR https://github.com/Unidata/netcdf-c/pull/2278.
Actually is a bit an omnibus covering several issues.

## PR https://github.com/Unidata/netcdf-c/pull/2278
Add support for the Zarr string type.
Zarr strings are restricted currently to be of fixed size.
The primary issue to be addressed is to provide a way for user to
specify the size of the fixed length strings. This is handled by providing
the following new attributes special:
1. **_nczarr_default_maxstrlen** —
This is an attribute of the root group. It specifies the default
maximum string length for string types. If not specified, then
it has the value of 64 characters.
2. **_nczarr_maxstrlen** —
This is a per-variable attribute. It specifies the maximum
string length for the string type associated with the variable.
If not specified, then it is assigned the value of
**_nczarr_default_maxstrlen**.

This PR also requires some hacking to handle the existing netcdf-c NC_CHAR
type, which does not exist in zarr. The goal was to choose numpy types for
both the netcdf-c NC_STRING type and the netcdf-c NC_CHAR type such that
if a pure zarr implementation read them, it would still work and an
NC_CHAR type would be handled by zarr as a string of length 1.

For writing variables and NCZarr attributes, the type mapping is as follows:
* "|S1" for NC_CHAR.
* ">S1" for NC_STRING && MAXSTRLEN==1
* ">Sn" for NC_STRING && MAXSTRLEN==n

Note that it is a bit of a hack to use endianness, but it should be ok since for
string/char, the endianness has no meaning.

For reading attributes with pure zarr (i.e. with no nczarr
atribute types defined), they will always be interpreted as of
type NC_CHAR.

## Issue: https://github.com/Unidata/netcdf-c/issues/2474
This PR partly fixes this issue because it provided more
comprehensive support for Zarr attributes that are JSON valued expressions.
This PR still does not address the problem in that issue where the
_ARRAY_DIMENSION attribute is incorrectly set. Than can only be
fixed by the creator of the datasets.

## Issue: https://github.com/Unidata/netcdf-c/issues/2485
This PR also fixes the scalar failure shown in this issue.
It generally cleans up scalar handling.
It also adds a note to the documentation describing that
NCZarr supports scalars while Zarr does not and also how
scalar interoperability is achieved.

## Misc. Other Changes
1. Convert the nczarr special attributes and keys to be all lower case. So "_NCZARR_ATTR" now used "_nczarr_attr. Support back compatibility for the upper case names.
2. Cleanup my too-clever-by-half handling of scalars in libnczarr.
2022-08-27 20:21:13 -06:00
Dennis Heimbigner
3623e17920 Fix some bugs in the blosc filter wrapper
re: Issue https://github.com/Unidata/netcdf-c/issues/2458

The above Github Issue revealed some bugs in the file netcdf-c/plugins/H5Zblosc.c. Fixed and added a testcase. Also discovered that the Blosc LZ sub-compressors do not work well with small datasets.

Misc. Other Change(s): I noticed that the file "dap4_test/baselinethredds/GOES16_CONUS_20170821_020218_0.47_1km_33.3N_91.4W.nc4.thredds" is still causing tar errors during "make distcheck", so I made some changes to do rename at test-time.
2022-07-12 15:19:07 -06:00
Ward Fisher
d1a3f6fbe6 configure.ac logic for disabling quantize. 2022-06-30 14:41:18 -06:00
Dennis Heimbigner
f419af9204 Cleanup szip handling some more
re: https://github.com/Unidata/netcdf-c/issues/2420

nc_test4/tst_vars3.c has the wrong conditional
around the szip tests (did I do that?).
Anyway, the current test is
> #ifdef HAVE_SZ

and it should be
> #ifdef HAVE_H5Z_SZIP

because the only thing that matters is that HDF5 lib has szip support.
2022-06-22 16:40:54 -06:00
Ward Fisher
545ce88476
Merge pull request #2377 from edwardhartnett/ejh_update_doxyfile
Updating Doxyfile.in with doxygen-1.8.17, turned on WARN_AS_ERROR, added doxygen build to CI run
2022-06-22 13:31:25 -06:00
Ward Fisher
c8a6628da2 Added a check for xml2-config as a test for the libxml2-dev header files. 2022-06-21 16:56:19 -06:00
Dennis Heimbigner
aabbdbf64c Make public a limited API for programmatic access to internal .rc tables
re: https://github.com/Unidata/netcdf-c/issues/2337
re: https://github.com/Unidata/netcdf-c/issues/2407

Add two functions to netcdf.h to allow programs to get/set
selected entries into the internal .rc tables. This should fix
the above issues by allowing HTTP.CAINFO to be set to the
certificates directory.  Note that the changes should be
performed as early as possible in the program because some of
the .rc table entries may get cached internally and changing the
entry after that caching occurs may have no effect.

The new signatures are as follows:

1. Get the value of a simple .rc entry of the form "key=value".
Note that caller must free the returned value, which might be NULL.
````
char* nc_rc_get(char* const * key);

@param key table entry key
@return value if .rc table has entry of the form key=value
@return NULL if no such entry is found.
````

2. Insert/Overwrite the specified key=value pair in the .rc table.
````
int nc_rc_set(const char* key, const char* value);

@param key table entry key -- may not be NULL
@param value table entry value -- may not be NULL
@return NC_NOERR if no error
@return NC_EINVAL if error
````

Addendum:

re: https://github.com/Unidata/netcdf-c/issues/2407

Modify dhttp.c to use the .rc entry HTTP.CAINFO if defined.
2022-06-17 14:35:12 -06:00
Ward Fisher
23e207a1c3 Make plugin dir off by default for this release. 2022-06-10 15:03:36 -06:00
Edward Hartnett
71c6046ca1 installing doxygen in CI when needed 2022-06-07 16:06:10 +03:00
Edward Hartnett
c0ffb1eb9d fixed case of --enable-doxygen but doxygen not found 2022-06-07 15:38:01 +03:00
Ward Fisher
b3b74eb9f3 Revised netCDF version and SO version 2022-06-03 10:52:00 -06:00
Dennis Heimbigner
bbe0b212a5 Fix internal bz2 problems 2022-05-27 15:45:34 -06:00
Dennis Heimbigner
d7e57d261a Update to default --with-plugin-dir to yes 2022-05-24 20:05:19 -06:00
Dennis Heimbigner
d16a894458 conflicts 2022-05-24 14:40:54 -06:00
Dennis Heimbigner
487df99c08 debug 2022-05-19 22:34:21 -06:00
Dennis Heimbigner
6ae3289701 I made a major update to this PR with the following changes:
## Overwriting
I think I solved the file overwrite problem by doing light name
mangling of the shared library names. With this change the probabilty
is very small that installing our filter wrappers in a directory will
overwrite code produced by others.

## Default Install Location
I have setup the --with-plugin-dir option default to install in
the following locations in order of preference

1. If HDF5_PLUGIN_PATH is defined (at build time remember), then the last directory in that path will be where the filter wrapper shared libraries will be installed.
2. Otherwise the default is "/usr/local/hdf5/lib/plugin" (on *nix*) or "%ALLUSERSPROFILE%\\hdf5\\lib\\plugin" for Windows or Mingw.

Currently, --with-plugin-dir is disabled by default.
I should note that even if I enable it by default, installing
netcdf-c will still not run "out of the box" because the hypothetical
naive user will not know which compressor libraries need to be
pre-installed before netcdf is installed. Nor will that user have any
way to find out what needs to be installed.
2022-05-19 22:00:40 -06:00
Dennis Heimbigner
342c20241f swith 2022-05-16 13:58:42 -06:00
Dennis Heimbigner
7b09290a3a Improve filter installation process to avoid use of an extra shell script
re: https://github.com/Unidata/netcdf-c/issues/2338
re: https://github.com/Unidata/netcdf-c/issues/2294

In issue https://github.com/Unidata/netcdf-c/issues/2338,
Ed Hartnett suggested a better way to install filters to a user
defined location -- for Automake, anyway.

This PR implements that suggestion. It turns out to be more
complicated than it appears, so there are fair number of changes;
mostly to shell scripts. Most of the change is in plugins/Makefile.am.

NOTE: this PR still does NOT address the use of HDF5_PLUGIN_PATH
as the default; this turns out to be complex when dealing with NCZarr.
So this will be addressed in a subsequent post 4.9.0 PR.

## Misc. Changes
1. Record the occurrences of incomplete codecs in libnczarr so that
   they can be included in _Codecs attribute correctly. This allows
   users to see what missing filters are referenced in the Zarr file.
   Primarily affects libnczarr/zfilter.[ch]. Also required creating a
   new no-effect filter: H5Zunknown.c.
2. Move the unknown filter test to a separate test file.
3. Incorporates PR https://github.com/Unidata/netcdf-c/pull/2343
2022-05-14 16:05:48 -06:00
Dennis Heimbigner
53890fd3a0 Fix distcheck problems
re: https://github.com/Unidata/netcdf-c/issues/2342
This PR replaces PR https://github.com/Unidata/netcdf-c/pull/2342

This PR extends the distcheck corrections in PR
https://github.com/Unidata/netcdf-c/pull/2342.  That original PR
exposed some errors in the file naming in the plugins and
nczarr_test directories.  This PR corrects those problems and
should be used instead of https://github.com/Unidata/netcdf-c/pull/2342

Ed Hartnett's suggestion about how to install the plugins in the
user specified directory will be addressed in a subsequent PR.
2022-05-09 12:10:53 -06:00
Ward Fisher
ee7039c3c2
Merge pull request #2318 from DennisHeimbigner/filterinstall.dmh
Support installation of standard pre-built filters into user-specified location
2022-05-04 17:00:03 -06:00